KVM: arm64: Introduce support for userspace SMCCC filtering
authorOliver Upton <oliver.upton@linux.dev>
Tue, 4 Apr 2023 15:40:46 +0000 (15:40 +0000)
committerMarc Zyngier <maz@kernel.org>
Wed, 5 Apr 2023 11:07:41 +0000 (12:07 +0100)
commit821d935c87bc95253f82deec3cbb457ccf3de003
treef1c5b3ba2f0d8cd98396d520027f907ea46a7d93
parentd824dff1919bbd523d4d5c860437d043c0ad121d
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
Documentation/virt/kvm/api.rst
Documentation/virt/kvm/devices/vm.rst
arch/arm64/include/uapi/asm/kvm.h
arch/arm64/kvm/arm.c
arch/arm64/kvm/hypercalls.c
include/kvm/arm_hypercalls.h