Commit bb17fb31 authored by Oliver Upton's avatar Oliver Upton

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: default avatarMarc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20231004234947.207507-2-oliver.upton@linux.devSigned-off-by: default avatarOliver Upton <oliver.upton@linux.dev>
parent 6465e260
...@@ -158,6 +158,11 @@ static void init_smccc_filter(struct kvm *kvm) ...@@ -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) 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)); 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) ...@@ -201,7 +206,7 @@ static u8 kvm_smccc_filter_get_action(struct kvm *kvm, u32 func_id)
unsigned long idx = func_id; unsigned long idx = func_id;
void *val; 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; return KVM_SMCCC_FILTER_HANDLE;
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment