aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/svm
diff options
context:
space:
mode:
authorSean Christopherson <seanjc@google.com>2025-08-06 12:56:47 -0700
committerSean Christopherson <seanjc@google.com>2025-09-18 12:57:19 -0700
commit5a1a726e68ff256f564cf51ad21a96bceb4dd954 (patch)
treeb704729a2afcb5cb60870cd54abcbff200fdf537 /arch/x86/kvm/svm
parentKVM: x86: Rework KVM_REQ_MSR_FILTER_CHANGED into a generic RECALC_INTERCEPTS (diff)
downloadlinux-5a1a726e68ff256f564cf51ad21a96bceb4dd954.tar.gz
linux-5a1a726e68ff256f564cf51ad21a96bceb4dd954.zip
KVM: x86: Use KVM_REQ_RECALC_INTERCEPTS to react to CPUID updates
Defer recalculating MSR and instruction intercepts after a CPUID update via RECALC_INTERCEPTS to converge on RECALC_INTERCEPTS as the "official" mechanism for triggering recalcs. As a bonus, because KVM does a "recalc" during vCPU creation, and every functional VMM sets CPUID at least once, for all intents and purposes this saves at least one recalc. Tested-by: Xudong Hao <xudong.hao@intel.com> Link: https://lore.kernel.org/r/20250806195706.1650976-26-seanjc@google.com Signed-off-by: Sean Christopherson <seanjc@google.com>
Diffstat (limited to 'arch/x86/kvm/svm')
-rw-r--r--arch/x86/kvm/svm/svm.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c
index 711f160113d1..22c5e4ffa132 100644
--- a/arch/x86/kvm/svm/svm.c
+++ b/arch/x86/kvm/svm/svm.c
@@ -1225,7 +1225,7 @@ static void init_vmcb(struct kvm_vcpu *vcpu)
svm_hv_init_vmcb(vmcb);
- svm_recalc_intercepts(vcpu);
+ kvm_make_request(KVM_REQ_RECALC_INTERCEPTS, vcpu);
vmcb_mark_all_dirty(vmcb);
@@ -4478,8 +4478,6 @@ static void svm_vcpu_after_set_cpuid(struct kvm_vcpu *vcpu)
if (sev_guest(vcpu->kvm))
sev_vcpu_after_set_cpuid(svm);
-
- svm_recalc_intercepts(vcpu);
}
static bool svm_has_wbinvd_exit(void)