aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/svm/svm.c
diff options
context:
space:
mode:
authorSean Christopherson <seanjc@google.com>2025-06-10 15:57:27 -0700
committerSean Christopherson <seanjc@google.com>2025-06-20 13:07:31 -0700
commit40ba80e4b04364bc5ee7991d6a41475ef8c4e8a1 (patch)
tree1fd45279a691ad40cdf5de6701332e66386e5600 /arch/x86/kvm/svm/svm.c
parentKVM: SVM: Rename init_vmcb_after_set_cpuid() to make it intercepts specific (diff)
downloadlinux-40ba80e4b04364bc5ee7991d6a41475ef8c4e8a1.tar.gz
linux-40ba80e4b04364bc5ee7991d6a41475ef8c4e8a1.zip
KVM: SVM: Fold svm_vcpu_init_msrpm() into its sole caller
Fold svm_vcpu_init_msrpm() into svm_recalc_msr_intercepts() now that there is only the one caller (and because the "init" misnomer is even more misleading than it was in the past). No functional change intended. Link: https://lore.kernel.org/r/20250610225737.156318-23-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.c27
1 files changed, 11 insertions, 16 deletions
diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c
index dd5da5e4f844..c17eeeea8e64 100644
--- a/arch/x86/kvm/svm/svm.c
+++ b/arch/x86/kvm/svm/svm.c
@@ -773,21 +773,6 @@ static void svm_recalc_lbr_msr_intercepts(struct kvm_vcpu *vcpu)
svm_set_intercept_for_msr(vcpu, MSR_IA32_DEBUGCTLMSR, MSR_TYPE_RW, intercept);
}
-static void svm_vcpu_init_msrpm(struct kvm_vcpu *vcpu)
-{
- svm_disable_intercept_for_msr(vcpu, MSR_STAR, MSR_TYPE_RW);
- svm_disable_intercept_for_msr(vcpu, MSR_IA32_SYSENTER_CS, MSR_TYPE_RW);
-
-#ifdef CONFIG_X86_64
- svm_disable_intercept_for_msr(vcpu, MSR_GS_BASE, MSR_TYPE_RW);
- svm_disable_intercept_for_msr(vcpu, MSR_FS_BASE, MSR_TYPE_RW);
- svm_disable_intercept_for_msr(vcpu, MSR_KERNEL_GS_BASE, MSR_TYPE_RW);
- svm_disable_intercept_for_msr(vcpu, MSR_LSTAR, MSR_TYPE_RW);
- svm_disable_intercept_for_msr(vcpu, MSR_CSTAR, MSR_TYPE_RW);
- svm_disable_intercept_for_msr(vcpu, MSR_SYSCALL_MASK, MSR_TYPE_RW);
-#endif
-}
-
void svm_set_x2apic_msr_interception(struct vcpu_svm *svm, bool intercept)
{
static const u32 x2avic_passthrough_msrs[] = {
@@ -846,7 +831,17 @@ static void svm_recalc_msr_intercepts(struct kvm_vcpu *vcpu)
{
struct vcpu_svm *svm = to_svm(vcpu);
- svm_vcpu_init_msrpm(vcpu);
+ svm_disable_intercept_for_msr(vcpu, MSR_STAR, MSR_TYPE_RW);
+ svm_disable_intercept_for_msr(vcpu, MSR_IA32_SYSENTER_CS, MSR_TYPE_RW);
+
+#ifdef CONFIG_X86_64
+ svm_disable_intercept_for_msr(vcpu, MSR_GS_BASE, MSR_TYPE_RW);
+ svm_disable_intercept_for_msr(vcpu, MSR_FS_BASE, MSR_TYPE_RW);
+ svm_disable_intercept_for_msr(vcpu, MSR_KERNEL_GS_BASE, MSR_TYPE_RW);
+ svm_disable_intercept_for_msr(vcpu, MSR_LSTAR, MSR_TYPE_RW);
+ svm_disable_intercept_for_msr(vcpu, MSR_CSTAR, MSR_TYPE_RW);
+ svm_disable_intercept_for_msr(vcpu, MSR_SYSCALL_MASK, MSR_TYPE_RW);
+#endif
if (lbrv)
svm_recalc_lbr_msr_intercepts(vcpu);