Commit c1340fe3 authored by Aaron Lewis's avatar Aaron Lewis Committed by Paolo Bonzini

KVM: x86: Add a VALID_MASK for the flag in kvm_msr_filter

Add the mask KVM_MSR_FILTER_VALID_MASK for the flag in the struct
kvm_msr_filter.  This makes it easier to introduce new flags in the
future.

No functional change intended.
Signed-off-by: default avatarAaron Lewis <aaronlewis@google.com>
Message-Id: <20220921151525.904162-4-aaronlewis@google.com>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent db205f7e
...@@ -226,6 +226,7 @@ struct kvm_msr_filter { ...@@ -226,6 +226,7 @@ struct kvm_msr_filter {
#define KVM_MSR_FILTER_DEFAULT_ALLOW (0 << 0) #define KVM_MSR_FILTER_DEFAULT_ALLOW (0 << 0)
#endif #endif
#define KVM_MSR_FILTER_DEFAULT_DENY (1 << 0) #define KVM_MSR_FILTER_DEFAULT_DENY (1 << 0)
#define KVM_MSR_FILTER_VALID_MASK (KVM_MSR_FILTER_DEFAULT_DENY)
__u32 flags; __u32 flags;
struct kvm_msr_filter_range ranges[KVM_MSR_FILTER_MAX_RANGES]; struct kvm_msr_filter_range ranges[KVM_MSR_FILTER_MAX_RANGES];
}; };
......
...@@ -6441,7 +6441,7 @@ static int kvm_vm_ioctl_set_msr_filter(struct kvm *kvm, ...@@ -6441,7 +6441,7 @@ static int kvm_vm_ioctl_set_msr_filter(struct kvm *kvm,
int r = 0; int r = 0;
u32 i; u32 i;
if (filter->flags & ~KVM_MSR_FILTER_DEFAULT_DENY) if (filter->flags & ~KVM_MSR_FILTER_VALID_MASK)
return -EINVAL; return -EINVAL;
for (i = 0; i < ARRAY_SIZE(filter->ranges); i++) for (i = 0; i < ARRAY_SIZE(filter->ranges); i++)
......
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