diff options
author | 2023-04-04 15:40:46 +0000 | |
---|---|---|
committer | 2023-04-05 12:07:41 +0100 | |
commit | 821d935c87bc95253f82deec3cbb457ccf3de003 (patch) | |
tree | f1c5b3ba2f0d8cd98396d520027f907ea46a7d93 /arch/arm64/include/uapi/asm | |
parent | KVM: arm64: Add support for KVM_EXIT_HYPERCALL (diff) | |
download | linux-821d935c87bc95253f82deec3cbb457ccf3de003.tar.gz linux-821d935c87bc95253f82deec3cbb457ccf3de003.tar.bz2 linux-821d935c87bc95253f82deec3cbb457ccf3de003.zip |
KVM: arm64: Introduce support for userspace SMCCC filtering
As the SMCCC (and related specifications) march towards an 'everything
and the kitchen sink' interface for interacting with a system it becomes
less likely that KVM will support every related feature. We could do
better by letting userspace have a crack at it instead.
Allow userspace to define an 'SMCCC filter' that applies to both HVCs
and SMCs initiated by the guest. Supporting both conduits with this
interface is important for a couple of reasons. Guest SMC usage is table
stakes for a nested guest, as HVCs are always taken to the virtual EL2.
Additionally, guests may want to interact with a service on the secure
side which can now be proxied by userspace.
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-10-oliver.upton@linux.dev
Diffstat (limited to 'arch/arm64/include/uapi/asm')
-rw-r--r-- | arch/arm64/include/uapi/asm/kvm.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/arch/arm64/include/uapi/asm/kvm.h b/arch/arm64/include/uapi/asm/kvm.h index f86446c5a7e3..3dcfa4bfdf83 100644 --- a/arch/arm64/include/uapi/asm/kvm.h +++ b/arch/arm64/include/uapi/asm/kvm.h @@ -372,6 +372,10 @@ enum { #endif }; +/* Device Control API on vm fd */ +#define KVM_ARM_VM_SMCCC_CTRL 0 +#define KVM_ARM_VM_SMCCC_FILTER 0 + /* Device Control API: ARM VGIC */ #define KVM_DEV_ARM_VGIC_GRP_ADDR 0 #define KVM_DEV_ARM_VGIC_GRP_DIST_REGS 1 @@ -479,6 +483,13 @@ enum kvm_smccc_filter_action { #endif }; +struct kvm_smccc_filter { + __u32 base; + __u32 nr_functions; + __u8 action; + __u8 pad[15]; +}; + /* arm64-specific KVM_EXIT_HYPERCALL flags */ #define KVM_HYPERCALL_EXIT_SMC (1U << 0) |