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
@@ -1618,6 +1620,15 @@ special_insn:
int err;
sel = c->src.val;
+ if (c->modrm_reg == VCPU_SREG_SS) {
+ u32 int_shadow =
+ kvm_x86_ops->get_interrupt_shadow(ctxt->vcpu,
+ X86_SHADOW_INT_MOV_SS);
+ /* See sti emulation for an explanation of this */
+ if (!(int_shadow & X86_SHADOW_INT_MOV_SS))
+ ctxt->interruptibility = X86_SHADOW_INT_MOV_SS;
+ }