aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/x86.c
diff options
context:
space:
mode:
authorGlauber Costa <glommer@redhat.com>2009-05-12 16:21:06 -0400
committerAvi Kivity <avi@redhat.com>2009-06-10 04:48:54 -0400
commit310b5d306c1aee7ebe32f702c0e33e7988d50646 (patch)
tree101bb4c72f1bb3eb3d4f60406435703f538c0ced /arch/x86/kvm/x86.c
parent2809f5d2c4cfad171167b131bb2a21ab65eba40f (diff)
KVM: Deal with interrupt shadow state for emulated instructions
We currently unblock shadow interrupt state when we skip an instruction, but failing to do so when we actually emulate one. This blocks interrupts in key instruction blocks, in particular sti; hlt; sequences If the instruction emulated is an sti, we have to block shadow interrupts. The same goes for mov ss. pop ss also needs it, but we don't currently emulate it. Without this patch, I cannot boot gpxe option roms at vmx machines. This is described at https://bugzilla.redhat.com/show_bug.cgi?id=494469 Signed-off-by: Glauber Costa <glommer@redhat.com> CC: H. Peter Anvin <hpa@zytor.com> CC: Gleb Natapov <gleb@redhat.com> Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86/kvm/x86.c')
-rw-r--r--arch/x86/kvm/x86.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 7475b029b2ad..48f744ff0bc1 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -2379,7 +2379,7 @@ int emulate_instruction(struct kvm_vcpu *vcpu,
2379 u16 error_code, 2379 u16 error_code,
2380 int emulation_type) 2380 int emulation_type)
2381{ 2381{
2382 int r; 2382 int r, shadow_mask;
2383 struct decode_cache *c; 2383 struct decode_cache *c;
2384 2384
2385 kvm_clear_exception_queue(vcpu); 2385 kvm_clear_exception_queue(vcpu);
@@ -2433,6 +2433,10 @@ int emulate_instruction(struct kvm_vcpu *vcpu,
2433 } 2433 }
2434 2434
2435 r = x86_emulate_insn(&vcpu->arch.emulate_ctxt, &emulate_ops); 2435 r = x86_emulate_insn(&vcpu->arch.emulate_ctxt, &emulate_ops);
2436 shadow_mask = vcpu->arch.emulate_ctxt.interruptibility;
2437
2438 if (r == 0)
2439 kvm_x86_ops->set_interrupt_shadow(vcpu, shadow_mask);
2436 2440
2437 if (vcpu->arch.pio.string) 2441 if (vcpu->arch.pio.string)
2438 return EMULATE_DO_MMIO; 2442 return EMULATE_DO_MMIO;