Skip to content

Commit bb17fb3

Browse files
committed
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Oliver Upton <[email protected]>
1 parent 6465e26 commit bb17fb3

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

arch/arm64/kvm/hypercalls.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,11 @@ static void init_smccc_filter(struct kvm *kvm)
158158

159159
}
160160

161+
static bool kvm_smccc_filter_configured(struct kvm *kvm)
162+
{
163+
return test_bit(KVM_ARCH_FLAT_SMCCC_FILTER_CONFIGURED, &kvm->arch.flags);
164+
}
165+
161166
static int kvm_smccc_set_filter(struct kvm *kvm, struct kvm_smccc_filter __user *uaddr)
162167
{
163168
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)
201206
unsigned long idx = func_id;
202207
void *val;
203208

204-
if (!test_bit(KVM_ARCH_FLAG_SMCCC_FILTER_CONFIGURED, &kvm->arch.flags))
209+
if (!kvm_smccc_filter_configured(kvm))
205210
return KVM_SMCCC_FILTER_HANDLE;
206211

207212
/*

0 commit comments

Comments
 (0)