From: Catalin Marinas <catalin.marinas@arm.com>
To: Suzuki K Poulose <suzuki.poulose@arm.com>
Cc: "Aneesh Kumar K.V" <aneesh.kumar@kernel.org>,
linux-arm-kernel@lists.infradead.org,
Lorenzo Pieralisi <lpieralisi@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Sudeep Holla <sudeep.holla@kernel.org>,
Will Deacon <will@kernel.org>,
Steven Price <steven.price@arm.com>,
Andre Przywara <andre.przywara@arm.com>,
Russell King <linux@armlinux.org.uk>,
kernel test robot <lkp@intel.com>
Subject: Re: [PATCH] firmware: smccc: Pass only the required device probe arguments
Date: Mon, 12 Oct 2026 12:09:42 +0100 [thread overview]
Message-ID: <asy_9kA8-y-OjH6N@arm.com> (raw)
In-Reply-To: <fa110c56-3faa-4819-bb94-0d82935c4ac5@arm.com>
On Mon, Oct 12, 2026 at 10:39:14AM +0100, Suzuki K Poulose wrote:
> On 11/10/2026 14:25, Aneesh Kumar K.V wrote:
> > Suzuki K Poulose <suzuki.poulose@arm.com> writes:
> > > On 10/10/2026 11:02, Aneesh Kumar K.V (Arm) wrote:
> > > > The device probe passes zeroes for all seven argument registers to
> > > > arm_smccc_1_1_invoke(). On ARM32 Thumb-2, this binds an input to r7 and
> > > > GCC 8.5 reports "r7 cannot be used in asm here".
> > > >
> > > > The current smccc_devices entries need at most one argument after the
> > > > function ID: TRNG_VERSION has none and RSI_ABI_VERSION takes a requested
> > > > version. Pass zero for that argument and omit the unused arguments,
> > > > avoiding the r7 constraint. Check argument requirements when adding new
> > > > probe functions to smccc_devices.
> > >
> > > Is it safer to use x1-x3 to 0 as they could be the results that we
> > > get back from SMCCC v1.0 onwards ?
> >
> > I'm not sure I follow. Passing additional zero arguments only
> > initializes the input registers; it should not affect how return values
> > are handled. arm_smccc_1_1_invoke() already declares x0-x3 as outputs.
> > Since these probe functions require no inputs in x2 or x3 and we only
> > inspect x0 on return, why do we need to initialize them to zero?
>
> Agree, I meant, passing 0s for x0-x3 future proofs the new calls.
> We know that x0-x3 could get overwritten by these calls, and is
> safe to be zero'd on a call.
>
> But agree, for the existing users just x1 is enough.
I'd keep it like this for now, it's pretty random anyway. The next time
we need a meaningful argument to pass, we'll probably add an args array
in struct smccc_device_info.
> Either way,
>
> Reviewed-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Thanks.
--
Catalin
next prev parent reply other threads:[~2026-10-12 11:09 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-10 10:02 [PATCH] firmware: smccc: Pass only the required device probe arguments Aneesh Kumar K.V (Arm)
2026-10-11 9:45 ` Suzuki K Poulose
2026-10-11 13:25 ` Aneesh Kumar K.V
2026-10-12 9:39 ` Suzuki K Poulose
2026-10-12 11:09 ` Catalin Marinas [this message]
2026-10-12 8:55 ` Sudeep Holla
2026-10-12 16:43 ` Catalin Marinas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=asy_9kA8-y-OjH6N@arm.com \
--to=catalin.marinas@arm.com \
--cc=andre.przywara@arm.com \
--cc=aneesh.kumar@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux@armlinux.org.uk \
--cc=lkp@intel.com \
--cc=lpieralisi@kernel.org \
--cc=mark.rutland@arm.com \
--cc=steven.price@arm.com \
--cc=sudeep.holla@kernel.org \
--cc=suzuki.poulose@arm.com \
--cc=will@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.