aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/kvm
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/kvm')
-rw-r--r--drivers/kvm/kvm_main.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/kvm/kvm_main.c b/drivers/kvm/kvm_main.c
index af2d288c881d..8c458f262872 100644
--- a/drivers/kvm/kvm_main.c
+++ b/drivers/kvm/kvm_main.c
@@ -2054,12 +2054,21 @@ again:
2054 2054
2055 kvm_x86_ops->run(vcpu, kvm_run); 2055 kvm_x86_ops->run(vcpu, kvm_run);
2056 2056
2057 kvm_guest_exit();
2058 vcpu->guest_mode = 0; 2057 vcpu->guest_mode = 0;
2059 local_irq_enable(); 2058 local_irq_enable();
2060 2059
2061 ++vcpu->stat.exits; 2060 ++vcpu->stat.exits;
2062 2061
2062 /*
2063 * We must have an instruction between local_irq_enable() and
2064 * kvm_guest_exit(), so the timer interrupt isn't delayed by
2065 * the interrupt shadow. The stat.exits increment will do nicely.
2066 * But we need to prevent reordering, hence this barrier():
2067 */
2068 barrier();
2069
2070 kvm_guest_exit();
2071
2063 preempt_enable(); 2072 preempt_enable();
2064 2073
2065 /* 2074 /*