]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
KVM: SVM: Add a helper to get LBR field pointer to dedup MSR accesses
authorSean Christopherson <seanjc@google.com>
Tue, 10 Mar 2026 22:04:14 +0000 (15:04 -0700)
committerSean Christopherson <seanjc@google.com>
Fri, 13 Mar 2026 20:05:54 +0000 (13:05 -0700)
commit0b4a043a54144aef3e5a2597c29c6adb5e6c47dc
tree1efed2c8eb7e7e4574d9ee3ff515c42f9eada2b2
parent3900e56eb184abcc8a16ab52af24ea255589acc2
KVM: SVM: Add a helper to get LBR field pointer to dedup MSR accesses

Add a helper to get a pointer to the corresponding VMCB field given an LBR
MSR index, and use it to dedup the handling in svm_{g,s}et_msr().

No functional change intended.

Suggested-by: Yosry Ahmed <yosry@kernel.org>
Reviewed-by: Yosry Ahmed <yosry@kernel.org>
Link: https://patch.msgid.link/20260310220414.2569208-1-seanjc@google.com
[sean: use KVM_BUG_ON() instead of BUILD_BUG(), clang ain't smart enough]
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/kvm/svm/svm.c