KVM: arm64: Refactor hvc filtering to support different actions
authorOliver Upton <oliver.upton@linux.dev>
Tue, 4 Apr 2023 15:40:43 +0000 (15:40 +0000)
committerMarc Zyngier <maz@kernel.org>
Wed, 5 Apr 2023 11:07:41 +0000 (12:07 +0100)
commita8308b3fc9494953c453480fb277e24f82f7d2b9
treea53565c93c7b91dd385a98555d67cccb518beb06
parentc2d2e9b3d8ce9db825a5630d9d52d542f5138ae0
KVM: arm64: Refactor hvc filtering to support different actions

KVM presently allows userspace to filter guest hypercalls with bitmaps
expressed via pseudo-firmware registers. These bitmaps have a narrow
scope and, of course, can only allow/deny a particular call. A
subsequent change to KVM will introduce a generalized UAPI for filtering
hypercalls, allowing functions to be forwarded to userspace.

Refactor the existing hypercall filtering logic to make room for more
than two actions. While at it, generalize the function names around
SMCCC as it is the basis for the upcoming UAPI.

No functional change intended.

Reviewed-by: Suzuki K Poulose <suzuki.poulose@arm.com>
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-7-oliver.upton@linux.dev
arch/arm64/include/uapi/asm/kvm.h
arch/arm64/kvm/hypercalls.c