KVM: x86: Add helpers to identify CTL and STATUS MCi MSRs
authorSean Christopherson <seanjc@google.com>
Thu, 12 May 2022 22:27:16 +0000 (22:27 +0000)
committerSean Christopherson <seanjc@google.com>
Fri, 8 Jul 2022 21:57:20 +0000 (14:57 -0700)
commit54ad60ba9d2673293c72a7c1c4f092622a1f8789
treee6863ffb0bc7bd25c521d37e6aca80be59c39f33
parentf5223a332f3647a0e3725e9b4a102e9659c84ce4
KVM: x86: Add helpers to identify CTL and STATUS MCi MSRs

Add helpers to identify CTL (control) and STATUS MCi MSR types instead of
open coding the checks using the offset.  Using the offset is perfectly
safe, but unintuitive, as understanding what the code does requires
knowing that the offset calcuation will not affect the lower three bits.

Opportunistically comment the STATUS logic to save readers a trip to
Intel's SDM or AMD's APM to understand the "data != 0" check.

No functional change intended.

Signed-off-by: Sean Christopherson <seanjc@google.com>
Reviewed-by: Jim Mattson <jmattson@google.com>
Link: https://lore.kernel.org/r/20220512222716.4112548-4-seanjc@google.com
arch/x86/kvm/x86.c