This patch resolves the problem encountered with HLT emulation with FreeDOS's 
HIMEM XMS Driver. 

HLT is the only instruction that goes to the done label unconditionally, 
causing the EIP value not to be updated which leads to the guest looping
forever on the same instruction.

Signed-off-by: Mohammed Gamal <[EMAIL PROTECTED]>

---

 arch/x86/kvm/x86_emulate.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/arch/x86/kvm/x86_emulate.c b/arch/x86/kvm/x86_emulate.c
index dd4efe1..04d7f02 100644
--- a/arch/x86/kvm/x86_emulate.c
+++ b/arch/x86/kvm/x86_emulate.c
@@ -1769,13 +1769,15 @@ writeback:
 
        /* Commit shadow register state. */
        memcpy(ctxt->vcpu->arch.regs, c->regs, sizeof c->regs);
-       kvm_rip_write(ctxt->vcpu, c->eip);
 
 done:
        if (rc == X86EMUL_UNHANDLEABLE) {
                c->eip = saved_eip;
                return -1;
        }
+       else
+               kvm_rip_write(ctxt->vcpu, c->eip);
+
        return 0;
 
 twobyte_insn:

 

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to