]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
KVM: arm64: Prevent the host from using an smc with imm16 != 0
authorSebastian Ene <sebastianene@google.com>
Mon, 30 Mar 2026 10:54:41 +0000 (10:54 +0000)
committerMarc Zyngier <maz@kernel.org>
Wed, 1 Apr 2026 15:39:10 +0000 (16:39 +0100)
commitcf6348af645bd8e38758114e6afcc406c5bb515f
tree0f35e38af89a29d669b76047083ea98479d13aee
parentf338e77383789c0cae23ca3d48adcc5e9e137e3c
KVM: arm64: Prevent the host from using an smc with imm16 != 0

The ARM Service Calling Convention (SMCCC) specifies that the function
identifier and parameters should be passed in registers, leaving the
16-bit immediate field un-handled in pKVM when an SMC instruction is
trapped.
Since the HVC is a private interface between EL2 and the host,
enforce the host kernel running under pKVM to use an immediate value
of 0 only when using SMCs to make it clear for non-compliant software
talking to Trustzone that we only use SMCCC.

Signed-off-by: Sebastian Ene <sebastianene@google.com>
Reviewed-by: Vincent Donnefort <vdonnefort@google.com>
Link: https://patch.msgid.link/20260330105441.3226904-1-sebastianene@google.com
Signed-off-by: Marc Zyngier <maz@kernel.org>
arch/arm64/kvm/hyp/nvhe/hyp-main.c