KVM: arm64: Only insert reserved ranges when SMCCC filter is used
authorOliver Upton <oliver.upton@linux.dev>
Wed, 4 Oct 2023 23:49:46 +0000 (23:49 +0000)
committerOliver Upton <oliver.upton@linux.dev>
Thu, 5 Oct 2023 09:33:15 +0000 (09:33 +0000)
commitd34b76489ea0c6168d230d4f9ad065422ba5f6d6
tree3119655c62cbdf254dfc217333abfe3e594b09e8
parentbb17fb31f00ebd8df478a9533c6b77d6eebe6464
KVM: arm64: Only insert reserved ranges when SMCCC filter is used

The reserved ranges are only useful for preventing userspace from
adding a rule that intersects with functions we must handle in KVM. If
userspace never writes to the SMCCC filter than this is all just wasted
work/memory.

Insert reserved ranges on the first call to KVM_ARM_VM_SMCCC_FILTER.

Reviewed-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20231004234947.207507-3-oliver.upton@linux.dev
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
arch/arm64/kvm/hypercalls.c