aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/svm/svm.c
diff options
context:
space:
mode:
authorSean Christopherson <seanjc@google.com>2025-06-10 15:57:30 -0700
committerSean Christopherson <seanjc@google.com>2025-06-20 13:07:33 -0700
commit5c9c084763637460acaeb3e22508c692a70b6905 (patch)
treedb2492ff7a3ff5a2939f1490feabaae92bc8c837 /arch/x86/kvm/svm/svm.c
parentKVM: SVM: Drop explicit check on MSRPM offset when emulating SEV-ES accesses (diff)
downloadlinux-5c9c084763637460acaeb3e22508c692a70b6905.tar.gz
linux-5c9c084763637460acaeb3e22508c692a70b6905.zip
KVM: SVM: Move svm_msrpm_offset() to nested.c
Move svm_msrpm_offset() from svm.c to nested.c now that all usage of the u32-index offsets is nested virtualization specific. No functional change intended. Link: https://lore.kernel.org/r/20250610225737.156318-26-seanjc@google.com Signed-off-by: Sean Christopherson <seanjc@google.com>
Diffstat (limited to 'arch/x86/kvm/svm/svm.c')
-rw-r--r--arch/x86/kvm/svm/svm.c23
1 files changed, 0 insertions, 23 deletions
diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c
index 6a87e684110b..2f315fea5cc2 100644
--- a/arch/x86/kvm/svm/svm.c
+++ b/arch/x86/kvm/svm/svm.c
@@ -196,29 +196,6 @@ static DEFINE_MUTEX(vmcb_dump_mutex);
*/
static int tsc_aux_uret_slot __read_mostly = -1;
-static const u32 msrpm_ranges[] = {0, 0xc0000000, 0xc0010000};
-
-u32 svm_msrpm_offset(u32 msr)
-{
- u32 offset;
- int i;
-
- for (i = 0; i < ARRAY_SIZE(msrpm_ranges); i++) {
- if (msr < msrpm_ranges[i] ||
- msr >= msrpm_ranges[i] + SVM_MSRS_PER_RANGE)
- continue;
-
- offset = (msr - msrpm_ranges[i]) / SVM_MSRS_PER_BYTE;
- offset += (i * SVM_MSRPM_BYTES_PER_RANGE); /* add range offset */
-
- /* Now we have the u8 offset - but need the u32 offset */
- return offset / 4;
- }
-
- /* MSR not in any range */
- return MSR_INVALID;
-}
-
static int get_npt_level(void)
{
#ifdef CONFIG_X86_64