diff options
author | 2023-04-04 15:40:45 +0000 | |
---|---|---|
committer | 2023-04-05 12:07:41 +0100 | |
commit | d824dff1919bbd523d4d5c860437d043c0ad121d (patch) | |
tree | 0ea664fd97f3afdb2edd9bb787b7d79161530535 /arch/arm64/include/uapi/asm | |
parent | KVM: arm64: Use a maple tree to represent the SMCCC filter (diff) | |
download | linux-d824dff1919bbd523d4d5c860437d043c0ad121d.tar.gz linux-d824dff1919bbd523d4d5c860437d043c0ad121d.tar.bz2 linux-d824dff1919bbd523d4d5c860437d043c0ad121d.zip |
KVM: arm64: Add support for KVM_EXIT_HYPERCALL
In anticipation of user hypercall filters, add the necessary plumbing to
get SMCCC calls out to userspace. Even though the exit structure has
space for KVM to pass register arguments, let's just avoid it altogether
and let userspace poke at the registers via KVM_GET_ONE_REG.
This deliberately stretches the definition of a 'hypercall' to cover
SMCs from EL1 in addition to the HVCs we know and love. KVM doesn't
support EL1 calls into secure services, but now we can paint that as a
userspace problem and be done with it.
Finally, we need a flag to let userspace know what conduit instruction
was used (i.e. SMC vs. HVC).
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20230404154050.2270077-9-oliver.upton@linux.dev
Diffstat (limited to 'arch/arm64/include/uapi/asm')
-rw-r--r-- | arch/arm64/include/uapi/asm/kvm.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/arm64/include/uapi/asm/kvm.h b/arch/arm64/include/uapi/asm/kvm.h index f9672ef1159a..f86446c5a7e3 100644 --- a/arch/arm64/include/uapi/asm/kvm.h +++ b/arch/arm64/include/uapi/asm/kvm.h @@ -472,12 +472,16 @@ enum { enum kvm_smccc_filter_action { KVM_SMCCC_FILTER_HANDLE = 0, KVM_SMCCC_FILTER_DENY, + KVM_SMCCC_FILTER_FWD_TO_USER, #ifdef __KERNEL__ NR_SMCCC_FILTER_ACTIONS #endif }; +/* arm64-specific KVM_EXIT_HYPERCALL flags */ +#define KVM_HYPERCALL_EXIT_SMC (1U << 0) + #endif #endif /* __ARM_KVM_H__ */ |