Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1473552

Re: [PATCH 1/2] arm64: kernel: Add SMC Session ID to results

Path csiph.com!eternal-september.org!feeder.eternal-september.org!aioe.org!gothmog.csi.it!bofh.it!news.nic.it!robomod
From Will Deacon <will.deacon@arm.com>
Newsgroups linux.kernel
Subject Re: [PATCH 1/2] arm64: kernel: Add SMC Session ID to results
Date Wed, 31 Aug 2016 16:40:02 +0200
Message-ID <sceQi-3B0-29@gated-at.bofh.it> (permalink)
References <s87u1-7r7-3@gated-at.bofh.it> <s87u1-7r7-1@gated-at.bofh.it> <s8XLY-6Xy-11@gated-at.bofh.it> <s8Y5j-7jf-13@gated-at.bofh.it> <s8YRH-7Bq-11@gated-at.bofh.it> <s97UZ-53o-3@gated-at.bofh.it> <s9hhE-2L7-31@gated-at.bofh.it> <sbXFM-1b9-23@gated-at.bofh.it>
MIME-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Disposition inline
User-Agent Mutt/1.5.23 (2014-03-12)
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 41
Organization linux.* mail to news gateway
X-Original-Cc Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>, Stephen Boyd <sboyd@codeaurora.org>, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, Catalin Marinas <catalin.marinas@arm.com>, Srinivas Kandagatla <srinivas.kandagatla@linaro.org>, stanimir.varbanov@linaro.org, linux-kernel@vger.kernel.org, patches@linaro.org, Bjorn Andersson <bjorn.andersson@linaro.org>, sudeep.holla@arm.com
X-Original-Date Wed, 31 Aug 2016 15:36:29 +0100
X-Original-Message-ID <20160831143629.GD29505@arm.com>
X-Original-References <1471672274-19317-1-git-send-email-andy.gross@linaro.org> <1471672274-19317-2-git-send-email-andy.gross@linaro.org> <20160822134313.GJ14680@arm.com> <20160822140246.GA30923@hector.attlocal.net> <20160822145326.GK14680@arm.com> <20160823003831.GN6502@codeaurora.org> <20160823103841.GD8724@red-moon> <20160830201642.GD24683@hector.attlocal.net>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1473552

Show key headers only | View raw


On Tue, Aug 30, 2016 at 03:16:42PM -0500, Andy Gross wrote:
> On Tue, Aug 23, 2016 at 11:38:41AM +0100, Lorenzo Pieralisi wrote:
> > On Mon, Aug 22, 2016 at 05:38:31PM -0700, Stephen Boyd wrote:
> > 
> > [...]
> > 
> > > This all comes about because the firmware generates a session id
> > > for the SMC call and jams it in x6. The assembly on the
> > > non-secure side is written with a tight loop around the smc
> > > instruction so that when the return value indicates
> > > "interrupted", x6 is kept intact and the non-secure OS can jump
> > > back to the secure OS without register reloading. Perhaps
> > > referring to x6 as result value is not correct because it's
> > > really a session id that's irrelevant once the smc call
> > > completes.
> > 
> > Sorry I missed this bit. The session id is _generated_ by secure
> > firmware (probably only when the value passed in x6 == 0 (?))
> > and actually returned to the caller so that subsequent (interrupted)
> > calls can re-issue the same value, is that correct ?
> > 
> > If that's the case the value in x6 is a result value from an SMCCC
> > perspective and your current FW is not SMCCC compliant.
> > 
> 
> So is Will's solution to this ok?  If so I will respin with the minor change to
> get it working and resend.  If not, do I roll my own smccc wrapper?

Obviously I'm biased, but I prefer to handle this as a quirk to make it
clear that it's a vendor-specific extension to the SMCCC, so if you
could post a patch based on the diff I sent, that would be great.

You'll also need to:

  (1) Make sure you don't break 32-bit ARM
  (2) Make sure that struct arm_smccc_res is always zero-initialised by
      its other users (to ensure that QUIRK_NONE is set). In fact, it
      might be nicer to pass the quirk structure as a separate argument,
      rather than embed it in arm_smccc_res.

Will

Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

Re: [PATCH 1/2] arm64: kernel: Add SMC Session ID to results Andy Gross <andy.gross@linaro.org> - 2016-08-30 22:20 +0200
  Re: [PATCH 1/2] arm64: kernel: Add SMC Session ID to results Will Deacon <will.deacon@arm.com> - 2016-08-31 16:40 +0200

csiph-web