History

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.

Aaron Lewis committed 4 years ago

Commit db205f71 parent be837942 files · +4 −3Browse files

Showing the changes to include/uapi (1 of 2 files). Show all

Unified · Split

include/uapi/linux/kvm.h+3−0
@@ -485,6 +485,9 @@ struct kvm_run { · 484 unmodified lines
485485 #define KVM_MSR_EXIT_REASON_INVAL (1 << 0)
486486 #define KVM_MSR_EXIT_REASON_UNKNOWN (1 << 1)
487487 #define KVM_MSR_EXIT_REASON_FILTER (1 << 2)
488+#define KVM_MSR_EXIT_REASON_VALID_MASK (KVM_MSR_EXIT_REASON_INVAL | \
489+ KVM_MSR_EXIT_REASON_UNKNOWN | \
490+ KVM_MSR_EXIT_REASON_FILTER)
488491 __u32 reason; /* kernel -> user */
489492 __u32 index; /* kernel -> user */
490493 __u64 data; /* kernel <-> user */