]> git.ipfire.org Git - thirdparty/linux.git/commit
KVM: SVM: Clean up macros related to architectural MSRPM definitions
authorSean Christopherson <seanjc@google.com>
Tue, 10 Jun 2025 22:57:14 +0000 (15:57 -0700)
committerSean Christopherson <seanjc@google.com>
Fri, 20 Jun 2025 20:07:11 +0000 (13:07 -0700)
commit16e9584cc0a8cfca1f36e6c2bead842105fcb125
tree19048fec011cfb81e14fa675e7d3bf83b55f7588
parent925149b6d054046cc0b61e89596245f58e884575
KVM: SVM: Clean up macros related to architectural MSRPM definitions

Move SVM's MSR Permissions Map macros to svm.h in anticipation of adding
helpers that are available to SVM code, and opportunistically replace a
variety of open-coded literals with (hopefully) informative macros.

Opportunistically open code ARRAY_SIZE(msrpm_ranges) instead of wrapping
it as NUM_MSR_MAPS, which is an ambiguous name even if it were qualified
with "SVM_MSRPM".

Deliberately leave the ranges as open coded literals, as using macros to
define the ranges actually introduces more potential failure points, since
both the definitions and the usage have to be careful to use the correct
index.  The lack of clear intent behind the ranges will be addressed in
future patches.

No functional change intended.

Link: https://lore.kernel.org/r/20250610225737.156318-10-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/kvm/svm/svm.c
arch/x86/kvm/svm/svm.h