]> rtime.felk.cvut.cz Git - lisovros/linux_canprio.git/commitdiff
KVM: x86 emulator: Fix HLT instruction
authorMohammed Gamal <m.gamal005@gmail.com>
Wed, 23 Jul 2008 08:43:41 +0000 (11:43 +0300)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 1 Aug 2008 19:42:59 +0000 (12:42 -0700)
Original-Commit-Hash: bcc542267538e9ba933d08b4cd4ebd796e03a3d7

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
arch/x86/kvm/x86_emulate.c

index 932f216d890c343bc5ca4ebfd8a15e1955334969..d41b9bcb4921276ddd6388ac7d5473481e612f94 100644 (file)
@@ -1666,7 +1666,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;