diff options
-rw-r--r-- | arch/x86/kvm/x86.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 35f82f2c66f6..c10135bc0f2f 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c | |||
@@ -4007,13 +4007,15 @@ int kvm_emulate_wbinvd(struct kvm_vcpu *vcpu) | |||
4007 | return X86EMUL_CONTINUE; | 4007 | return X86EMUL_CONTINUE; |
4008 | 4008 | ||
4009 | if (kvm_x86_ops->has_wbinvd_exit()) { | 4009 | if (kvm_x86_ops->has_wbinvd_exit()) { |
4010 | preempt_disable(); | 4010 | int cpu = get_cpu(); |
4011 | |||
4012 | cpumask_set_cpu(cpu, vcpu->arch.wbinvd_dirty_mask); | ||
4011 | smp_call_function_many(vcpu->arch.wbinvd_dirty_mask, | 4013 | smp_call_function_many(vcpu->arch.wbinvd_dirty_mask, |
4012 | wbinvd_ipi, NULL, 1); | 4014 | wbinvd_ipi, NULL, 1); |
4013 | preempt_enable(); | 4015 | put_cpu(); |
4014 | cpumask_clear(vcpu->arch.wbinvd_dirty_mask); | 4016 | cpumask_clear(vcpu->arch.wbinvd_dirty_mask); |
4015 | } | 4017 | } else |
4016 | wbinvd(); | 4018 | wbinvd(); |
4017 | return X86EMUL_CONTINUE; | 4019 | return X86EMUL_CONTINUE; |
4018 | } | 4020 | } |
4019 | EXPORT_SYMBOL_GPL(kvm_emulate_wbinvd); | 4021 | EXPORT_SYMBOL_GPL(kvm_emulate_wbinvd); |