From: Sebastian Ene <sebastianene@google.com>
To: Marc Zyngier <maz@kernel.org>
Cc: catalin.marinas@arm.com, kvmarm@lists.linux.dev,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, android-kvm@google.com,
joey.gouly@arm.com, korneld@google.com,
mrigendra.chaubey@gmail.com, oupton@kernel.org,
perlarsen@google.com, suzuki.poulose@arm.com, will@kernel.org,
yuzenghui@huawei.com
Subject: Re: [PATCH] KVM: arm64: Pass a 64bit function-id in the SMC handlers
Date: Wed, 1 Apr 2026 17:21:58 +0000 [thread overview]
Message-ID: <ac1UNj7Z1uVL4Nf6@google.com> (raw)
In-Reply-To: <86341e4to0.wl-maz@kernel.org>
On Wed, Apr 01, 2026 at 03:55:11PM +0100, Marc Zyngier wrote:
> On Wed, 01 Apr 2026 13:32:01 +0100,
> Sebastian Ene <sebastianene@google.com> wrote:
> >
> > Make the SMC handlers accept a 64bit value for the function-id to keep
> > it uniform with the rest of the code and prevent a u64 -> u32 -> u64
> > conversion as it currently happens when we handle PSCI.
>
> That seems overly creative. The spec says (2.5, from ARM DEN 0028 1.6
> G):
I'm not plannig to be *overly creative*. Thanks for pointing out the ARM
spec.
>
> "The Function Identifier is passed on W0 on every SMC and HVC
> call. Its 32-bit integer value indicates which function is being
> requested by the caller. It is always passed as the first argument to
> every SMC or HVC call in R0 or W0."
>
> which indicates that it is *always* a 32bit value.
>
> So if you have a 64bit value somewhere, *that* should be fixed, not
> propagated arbitrarily.
If you have a non SMCCC call that happen to have the first 32-bits of
the function-id matching either PSCI or FF-A you will end up handling
them instead of forwarding it to Trustzone because func_id is declared as:
DECLARE_REG(u64, func_id, host_ctxt, 0);
>
> Thanks,
>
> M.
>
> --
> Without deviation from the norm, progress is not possible.
Thanks,
Sebastian
next prev parent reply other threads:[~2026-04-01 17:22 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-01 12:32 [PATCH] KVM: arm64: Pass a 64bit function-id in the SMC handlers Sebastian Ene
2026-04-01 14:55 ` Marc Zyngier
2026-04-01 17:21 ` Sebastian Ene [this message]
2026-04-01 18:28 ` Marc Zyngier
2026-04-01 18:34 ` Marc Zyngier
2026-04-02 18:46 ` Sebastian Ene
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=ac1UNj7Z1uVL4Nf6@google.com \
--to=sebastianene@google.com \
--cc=android-kvm@google.com \
--cc=catalin.marinas@arm.com \
--cc=joey.gouly@arm.com \
--cc=korneld@google.com \
--cc=kvmarm@lists.linux.dev \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maz@kernel.org \
--cc=mrigendra.chaubey@gmail.com \
--cc=oupton@kernel.org \
--cc=perlarsen@google.com \
--cc=suzuki.poulose@arm.com \
--cc=will@kernel.org \
--cc=yuzenghui@huawei.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox