summaryrefslogtreecommitdiff
path: root/arch/x86
diff options
context:
space:
mode:
authorAaron Lewis <aaronlewis@google.com>2022-09-21 18:15:22 +0300
committerPaolo Bonzini <pbonzini@redhat.com>2022-11-09 20:31:29 +0300
commitdb205f7e1edc8d8f0880f0218d3a03b13fe94af3 (patch)
tree7a8f9287b5b89d839660cef305079cca2b4f0e79 /arch/x86
parentbe83794210e7020fef98596f4513aafbed659cd1 (diff)
downloadlinux-db205f7e1edc8d8f0880f0218d3a03b13fe94af3.tar.xz
KVM: x86: Add a VALID_MASK for the MSR exit reason flags
Add the mask KVM_MSR_EXIT_REASON_VALID_MASK for the MSR exit reason flags. This simplifies checks that validate these flags, and makes it easier to introduce new flags in the future. No functional change intended. Signed-off-by: Aaron Lewis <aaronlewis@google.com> Message-Id: <20220921151525.904162-3-aaronlewis@google.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/kvm/x86.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index cbec2e675c18..9ba8c1b73db4 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -6230,9 +6230,7 @@ split_irqchip_unlock:
break;
case KVM_CAP_X86_USER_SPACE_MSR:
r = -EINVAL;
- if (cap->args[0] & ~(KVM_MSR_EXIT_REASON_INVAL |
- KVM_MSR_EXIT_REASON_UNKNOWN |
- KVM_MSR_EXIT_REASON_FILTER))
+ if (cap->args[0] & ~KVM_MSR_EXIT_REASON_VALID_MASK)
break;
kvm->arch.user_space_msr_mask = cap->args[0];
r = 0;