Skip to content

Commit c2162e1

Browse files
Wanpeng Libonzini
Wanpeng Li
authored andcommitted
KVM: X86: Fix missing local pCPU when executing wbinvd on all dirty pCPUs
In order to deal with noncoherent DMA, we should execute wbinvd on all dirty pCPUs when guest wbinvd exits to maintain data consistency. smp_call_function_many() does not execute the provided function on the local core, therefore replace it by on_each_cpu_mask(). Reported-by: Nadav Amit <[email protected]> Cc: Nadav Amit <[email protected]> Signed-off-by: Wanpeng Li <[email protected]> Message-Id: <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
1 parent b318e8d commit c2162e1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/x86/kvm/x86.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6629,7 +6629,7 @@ static int kvm_emulate_wbinvd_noskip(struct kvm_vcpu *vcpu)
66296629
int cpu = get_cpu();
66306630

66316631
cpumask_set_cpu(cpu, vcpu->arch.wbinvd_dirty_mask);
6632-
smp_call_function_many(vcpu->arch.wbinvd_dirty_mask,
6632+
on_each_cpu_mask(vcpu->arch.wbinvd_dirty_mask,
66336633
wbinvd_ipi, NULL, 1);
66346634
put_cpu();
66356635
cpumask_clear(vcpu->arch.wbinvd_dirty_mask);

0 commit comments

Comments
 (0)