diff options
author | Avi Kivity <avi@qumranet.com> | 2008-07-03 14:59:22 +0300 |
---|---|---|
committer | Avi Kivity <avi@qumranet.com> | 2008-10-15 10:15:13 +0200 |
commit | 26eef70c3e8c76e73dff2579c792fc7355f8a291 (patch) | |
tree | 2ec10a2e0f68ca0de77d446fa6d5be9189809e8d /arch/x86/kvm/x86.c | |
parent | 668f612fa0d8d4120ec5dc0725d7e1ca3152a954 (diff) | |
download | lwn-26eef70c3e8c76e73dff2579c792fc7355f8a291.tar.gz lwn-26eef70c3e8c76e73dff2579c792fc7355f8a291.zip |
KVM: Clear exception queue before emulating an instruction
If we're emulating an instruction, either it will succeed, in which case
any previously queued exception will be spurious, or we will requeue the
same exception.
Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'arch/x86/kvm/x86.c')
-rw-r--r-- | arch/x86/kvm/x86.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 2f0696bc7d2f..5620df2685db 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -20,6 +20,7 @@ #include "i8254.h" #include "tss.h" #include "kvm_cache_regs.h" +#include "x86.h" #include <linux/clocksource.h> #include <linux/kvm.h> @@ -2121,6 +2122,7 @@ int emulate_instruction(struct kvm_vcpu *vcpu, int r; struct decode_cache *c; + kvm_clear_exception_queue(vcpu); vcpu->arch.mmio_fault_cr2 = cr2; /* * TODO: fix x86_emulate.c to use guest_read/write_register |