]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
KVM: x86 emulator: Fix HLT instruction
authorMohammed Gamal <m.gamal005@gmail.com>
Sun, 6 Jul 2008 13:51:26 +0000 (16:51 +0300)
committerAvi Kivity <avi@qumranet.com>
Sun, 20 Jul 2008 09:42:38 +0000 (12:42 +0300)
This patch fixes issue encountered with HLT instruction
under FreeDOS's HIMEM XMS Driver.

The HLT instruction jumped directly to the done label and
skips updating the EIP value, therefore causing the guest
to spin endlessly on the same instruction.

The patch changes the instruction so that it writes back
the updated EIP value.

Signed-off-by: Mohammed Gamal <m.gamal005@gmail.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
arch/x86/kvm/x86_emulate.c

index 18ca25c2d4a4d7a7a3349479d2b653d72e76293b..8bc63f62fbbd6c687b62b8ec396aefc2f3b54de2 100644 (file)
@@ -1731,7 +1731,7 @@ special_insn:
                break;
        case 0xf4:              /* hlt */
                ctxt->vcpu->arch.halt_request = 1;
-               goto done;
+               break;
        case 0xf5:      /* cmc */
                /* complement carry flag from eflags reg */
                ctxt->eflags ^= EFLG_CF;