Home Home > GIT Browse > openSUSE-15.0
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoerg Roedel <jroedel@suse.de>2019-07-17 10:35:27 +0200
committerJoerg Roedel <jroedel@suse.de>2019-07-17 10:35:27 +0200
commit3eef5f61d68ca0c8979dfc4688e875f0cde67fb1 (patch)
treea7a49d43da750bf5aa1862d50dfafcb4074e4119
parent495ce323ca89f7ca695cc5c66ccebab67c954f15 (diff)
kvm: svm/avic: Do not send AVIC doorbell to self (bsc#1140133).
-rw-r--r--arch/x86/kvm/svm.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
index ef51543e0146..38d07170fec1 100644
--- a/arch/x86/kvm/svm.c
+++ b/arch/x86/kvm/svm.c
@@ -5076,10 +5076,13 @@ static void svm_deliver_avic_intr(struct kvm_vcpu *vcpu, int vec)
kvm_lapic_set_irr(vec, vcpu->arch.apic);
smp_mb__after_atomic();
- if (avic_vcpu_is_running(vcpu))
- wrmsrl(SVM_AVIC_DOORBELL,
- kvm_cpu_get_apicid(vcpu->cpu));
- else
+ if (avic_vcpu_is_running(vcpu)) {
+ int cpuid = vcpu->cpu;
+
+ if (cpuid != get_cpu())
+ wrmsrl(SVM_AVIC_DOORBELL, kvm_cpu_get_apicid(cpuid));
+ put_cpu();
+ } else
kvm_vcpu_wake_up(vcpu);
}