diff options
-rw-r--r-- | arch/x86/kvm/x86.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 0f3e04b74a66..e2713716e732 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c | |||
@@ -4569,7 +4569,7 @@ static void vcpu_kick_intr(void *info) | |||
4569 | void kvm_vcpu_kick(struct kvm_vcpu *vcpu) | 4569 | void kvm_vcpu_kick(struct kvm_vcpu *vcpu) |
4570 | { | 4570 | { |
4571 | int ipi_pcpu = vcpu->cpu; | 4571 | int ipi_pcpu = vcpu->cpu; |
4572 | int cpu = get_cpu(); | 4572 | int cpu; |
4573 | 4573 | ||
4574 | if (waitqueue_active(&vcpu->wq)) { | 4574 | if (waitqueue_active(&vcpu->wq)) { |
4575 | wake_up_interruptible(&vcpu->wq); | 4575 | wake_up_interruptible(&vcpu->wq); |
@@ -4579,6 +4579,7 @@ void kvm_vcpu_kick(struct kvm_vcpu *vcpu) | |||
4579 | * We may be called synchronously with irqs disabled in guest mode, | 4579 | * We may be called synchronously with irqs disabled in guest mode, |
4580 | * So need not to call smp_call_function_single() in that case. | 4580 | * So need not to call smp_call_function_single() in that case. |
4581 | */ | 4581 | */ |
4582 | cpu = get_cpu(); | ||
4582 | if (vcpu->guest_mode && vcpu->cpu != cpu) | 4583 | if (vcpu->guest_mode && vcpu->cpu != cpu) |
4583 | smp_call_function_single(ipi_pcpu, vcpu_kick_intr, vcpu, 0); | 4584 | smp_call_function_single(ipi_pcpu, vcpu_kick_intr, vcpu, 0); |
4584 | put_cpu(); | 4585 | put_cpu(); |