浏览代码

KVM: x86 emulator: Fix HLT instruction

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>
Mohammed Gamal 17 年之前
父节点
当前提交
19fdfa0d13
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      arch/x86/kvm/x86_emulate.c

+ 1 - 1
arch/x86/kvm/x86_emulate.c

@@ -1731,7 +1731,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;