summaryrefslogtreecommitdiff
path: root/arch/arm64/kvm/hypercalls.c
diff options
context:
space:
mode:
authorOliver Upton <oliver.upton@linux.dev>2023-10-05 02:49:45 +0300
committerOliver Upton <oliver.upton@linux.dev>2023-10-05 12:33:15 +0300
commitbb17fb31f00ebd8df478a9533c6b77d6eebe6464 (patch)
treeb38b087f701f5fd1e947dab1bda7971caa402670 /arch/arm64/kvm/hypercalls.c
parent6465e260f48790807eef06b583b38ca9789b6072 (diff)
downloadlinux-bb17fb31f00ebd8df478a9533c6b77d6eebe6464.tar.xz
KVM: arm64: Add a predicate for testing if SMCCC filter is configured
Eventually we can drop the VM flag, move around the existing implementation for now. Reviewed-by: Marc Zyngier <maz@kernel.org> Link: https://lore.kernel.org/r/20231004234947.207507-2-oliver.upton@linux.dev Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
Diffstat (limited to 'arch/arm64/kvm/hypercalls.c')
-rw-r--r--arch/arm64/kvm/hypercalls.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/arch/arm64/kvm/hypercalls.c b/arch/arm64/kvm/hypercalls.c
index 7fb4df0456de..35e023322cdb 100644
--- a/arch/arm64/kvm/hypercalls.c
+++ b/arch/arm64/kvm/hypercalls.c
@@ -158,6 +158,11 @@ static void init_smccc_filter(struct kvm *kvm)
}
+static bool kvm_smccc_filter_configured(struct kvm *kvm)
+{
+ return test_bit(KVM_ARCH_FLAT_SMCCC_FILTER_CONFIGURED, &kvm->arch.flags);
+}
+
static int kvm_smccc_set_filter(struct kvm *kvm, struct kvm_smccc_filter __user *uaddr)
{
const void *zero_page = page_to_virt(ZERO_PAGE(0));
@@ -201,7 +206,7 @@ static u8 kvm_smccc_filter_get_action(struct kvm *kvm, u32 func_id)
unsigned long idx = func_id;
void *val;
- if (!test_bit(KVM_ARCH_FLAG_SMCCC_FILTER_CONFIGURED, &kvm->arch.flags))
+ if (!kvm_smccc_filter_configured(kvm))
return KVM_SMCCC_FILTER_HANDLE;
/*