]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commitada823e7e9cd77b9a3ad05d88dc4ec636a1e0898
treee6863ffb0bc7bd25c521d37e6aca80be59c39f33
parent3af99747ecfe4a17a9eccd3fa50514fe2bf3b5e1
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