[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20061120102939.C032125015E@cleopatra.q>
Date: Mon, 20 Nov 2006 10:29:39 -0000
From: Avi Kivity <avi@...ranet.com>
To: kvm-devel@...ts.sourceforge.net
Cc: akpm@...l.org, kvm-devel@...ts.sourceforge.net,
yaniv.kamay@...ranet.com, linux-kernel@...r.kernel.org
Subject: [PATCH] KVM: Fix emulator mov cr decoding
From: Yaniv Kamay <yaniv@...ranet.com>
Decoding of the mov cr instructions was wrong.
Signed-off-by: Yaniv Kamay <yaniv@...ranet.com>
Signed-off-by: Avi Kivity <avi@...ranet.com>
Index: linux-2.6/drivers/kvm/x86_emulate.c
===================================================================
--- linux-2.6.orig/drivers/kvm/x86_emulate.c
+++ linux-2.6/drivers/kvm/x86_emulate.c
@@ -1268,13 +1268,13 @@ twobyte_special_insn:
b = insn_fetch(u8, 1, _eip);
if ((b & 0xc0) != 0xc0)
goto cannot_emulate;
- _regs[(b >> 3) & 7] = realmode_get_cr(ctxt->vcpu, b & 7);
+ _regs[b & 7] = realmode_get_cr(ctxt->vcpu, (b >> 3) & 7);
break;
case 0x22: /* mov reg, cr */
b = insn_fetch(u8, 1, _eip);
if ((b & 0xc0) != 0xc0)
goto cannot_emulate;
- realmode_set_cr(ctxt->vcpu, b & 7, _regs[(b >> 3) & 7] & -1u,
+ realmode_set_cr(ctxt->vcpu, (b >> 3) & 7, _regs[b & 7] & -1u,
&_eflags);
break;
case 0xc7: /* Grp9 (cmpxchg8b) */
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists