Home Home > GIT Browse > SLE12-SP4
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
commita34d4f31408f4a97616e5df98a025e7cbe274cfc (patch)
tree69c1d4582d5564303b1b4f1597fb3b5cdd8514d7
parent3131f46c4f3630a1338a040d939bae36650c7f67 (diff)
kvm: svm/avic: Do not send AVIC doorbell to self (bsc#1140133).
-rw-r--r--patches.arch/kvm-svm-avic-do-not-send-avic-doorbell-to-self46
-rw-r--r--series.conf1
2 files changed, 47 insertions, 0 deletions
diff --git a/patches.arch/kvm-svm-avic-do-not-send-avic-doorbell-to-self b/patches.arch/kvm-svm-avic-do-not-send-avic-doorbell-to-self
new file mode 100644
index 0000000000..4b0a313a88
--- /dev/null
+++ b/patches.arch/kvm-svm-avic-do-not-send-avic-doorbell-to-self
@@ -0,0 +1,46 @@
+From: "Suthikulpanit, Suravee" <Suravee.Suthikulpanit@amd.com>
+Date: Fri, 3 May 2019 06:38:53 -0700
+Subject: kvm: svm/avic: Do not send AVIC doorbell to self
+Git-commit: 0532dd52dfec0cf774188d3e692d50c197bc4210
+References: bsc#1140133
+Patch-mainline: v5.3-rc1
+
+AVIC doorbell is used to notify a running vCPU that interrupts
+has been injected into the vCPU AVIC backing page. Current logic
+checks only if a VCPU is running before sending a doorbell.
+However, the doorbell is not necessary if the destination
+CPU is itself.
+
+Add logic to check currently running CPU before sending doorbell.
+
+Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
+Reviewed-by: Alexander Graf <graf@amazon.com>
+Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
+Acked-by: Joerg Roedel <jroedel@suse.de>
+---
+ arch/x86/kvm/svm.c | 11 +++++++----
+ 1 file changed, 7 insertions(+), 4 deletions(-)
+
+diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
+index a7ea34bed3fe..c56f40d430e5 100644
+--- a/arch/x86/kvm/svm.c
++++ b/arch/x86/kvm/svm.c
+@@ -5163,10 +5163,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);
+ }
+
+
diff --git a/series.conf b/series.conf
index cd84bc24d9..7d1a7c867f 100644
--- a/series.conf
+++ b/series.conf
@@ -22925,6 +22925,7 @@
patches.fixes/0001-ocfs2-add-last-unlock-times-in-locking_state.patch
patches.fixes/0002-ocfs2-add-locking-filter-debugfs-file.patch
patches.fixes/0003-ocfs2-add-first-lock-wait-time-in-locking_state.patch
+ patches.arch/kvm-svm-avic-do-not-send-avic-doorbell-to-self
patches.arch/powerpc-watchpoint-Restore-NV-GPRs-while-returning-f.patch
patches.arch/powerpc-mm-drconf-Use-NUMA_NO_NODE-on-failures-inste.patch
patches.arch/powerpc-mm-Fix-node-look-up-with-numa-off-boot.patch