Home Home > GIT Browse > SLE15-AZURE
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoerg Roedel <jroedel@suse.de>2019-08-13 11:04:46 +0200
committerJoerg Roedel <jroedel@suse.de>2019-08-13 13:25:27 +0200
commit7602c6953b0b1c470be5badfc7caa7a81c133ab8 (patch)
treea6d4c33ebd9a1da94770de38042dfa6389d7b71b
parentd0be7ab1369bf133599e0ae519ff93d6a8995a5f (diff)
KVM: x86: Unconditionally enable irqs in guest context
(bsc#1145396). suse-commit: 001ad67439c3fc5efe4822c79979315419ec0039
-rw-r--r--arch/x86/kvm/svm.c8
-rw-r--r--arch/x86/kvm/x86.c9
2 files changed, 10 insertions, 7 deletions
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
index 3fab7537aca0..9302dbaeda2e 100644
--- a/arch/x86/kvm/svm.c
+++ b/arch/x86/kvm/svm.c
@@ -6060,13 +6060,7 @@ out:
static void svm_handle_external_intr(struct kvm_vcpu *vcpu)
{
- local_irq_enable();
- /*
- * We must have an instruction with interrupts enabled, so
- * the timer interrupt isn't delayed by the interrupt shadow.
- */
- asm("nop");
- local_irq_disable();
+
}
static void svm_sched_in(struct kvm_vcpu *vcpu, int cpu)
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 3a7c419a277e..d97eaf438c72 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -7293,7 +7293,16 @@ static int vcpu_enter_guest(struct kvm_vcpu *vcpu)
kvm_x86_ops->handle_external_intr(vcpu);
+ /*
+ * Consume any pending interrupts, including the possible source of
+ * VM-Exit on SVM and any ticks that occur between VM-Exit and now.
+ * An instruction is required after local_irq_enable() to fully unblock
+ * interrupts on processors that implement an interrupt shadow, the
+ * stat.exits increment will do nicely.
+ */
+ local_irq_enable();
++vcpu->stat.exits;
+ local_irq_disable();
guest_exit_irqoff();