Commit 205cb934 authored by Mohammed Gamal's avatar Mohammed Gamal Committed by Greg Kroah-Hartman

KVM: x86 emulator: Fix HLT instruction

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: default avatarMohammed Gamal <m.gamal005@gmail.com>
Signed-off-by: default avatarAvi Kivity <avi@qumranet.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 5c9e0efd
...@@ -1666,7 +1666,7 @@ special_insn: ...@@ -1666,7 +1666,7 @@ special_insn:
break; break;
case 0xf4: /* hlt */ case 0xf4: /* hlt */
ctxt->vcpu->arch.halt_request = 1; ctxt->vcpu->arch.halt_request = 1;
goto done; break;
case 0xf5: /* cmc */ case 0xf5: /* cmc */
/* complement carry flag from eflags reg */ /* complement carry flag from eflags reg */
ctxt->eflags ^= EFLG_CF; ctxt->eflags ^= EFLG_CF;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment