Skip to content

Commit 55aed8c

Browse files
committed
KVM: x86: Use wbinvd_on_cpu() instead of an open-coded equivalent
Use wbinvd_on_cpu() to target a single CPU instead of open-coding an equivalent, and drop KVM's wbinvd_ipi() now that all users have switched to x86 library versions. No functional change intended. Reviewed-by: Tom Lendacky <thomas.lendacky@amd.com> Link: https://lore.kernel.org/r/20250522233733.3176144-6-seanjc@google.com Signed-off-by: Sean Christopherson <seanjc@google.com>
1 parent 4fdc343 commit 55aed8c

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

arch/x86/kvm/x86.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4983,11 +4983,6 @@ long kvm_arch_dev_ioctl(struct file *filp,
49834983
return r;
49844984
}
49854985

4986-
static void wbinvd_ipi(void *garbage)
4987-
{
4988-
wbinvd();
4989-
}
4990-
49914986
static bool need_emulate_wbinvd(struct kvm_vcpu *vcpu)
49924987
{
49934988
return kvm_arch_has_noncoherent_dma(vcpu->kvm);
@@ -5011,8 +5006,7 @@ void kvm_arch_vcpu_load(struct kvm_vcpu *vcpu, int cpu)
50115006
if (kvm_x86_call(has_wbinvd_exit)())
50125007
cpumask_set_cpu(cpu, vcpu->arch.wbinvd_dirty_mask);
50135008
else if (vcpu->cpu != -1 && vcpu->cpu != cpu)
5014-
smp_call_function_single(vcpu->cpu,
5015-
wbinvd_ipi, NULL, 1);
5009+
wbinvd_on_cpu(vcpu->cpu);
50165010
}
50175011

50185012
kvm_x86_call(vcpu_load)(vcpu, cpu);

0 commit comments

Comments
 (0)