Hi Avi,
  Attached is the patch to correct the implementation of instruction:
        cmp
        opcodes: 0x3c, 0x3d
  Please Apply.
-- 
Thanks & Regards,
Nitin
Open Source Technology Center, Intel Corporation
-----------------------------------------------------------------
The mind is like a parachute; it works much better when it's open
commit 637711de0b9b2431c32cfdd880fed6baabec3982
Author: Nitin A Kamble <[EMAIL PROTECTED]>
Date:   Thu Sep 13 19:52:21 2007 -0700

    Correct emulation of instruction
    	cmp
    	opcodes: 0x3c & 0x3d
    
    Signed-off-by: Nitin A Kamble <[EMAIL PROTECTED]>

diff --git a/drivers/kvm/x86_emulate.c b/drivers/kvm/x86_emulate.c
index 5ca4626..2e4c631 100644
--- a/drivers/kvm/x86_emulate.c
+++ b/drivers/kvm/x86_emulate.c
@@ -985,10 +985,31 @@ done_prefixes:
 	      xor:		/* xor */
 		emulate_2op_SrcV("xor", src, dst, _eflags);
 		break;
-	case 0x38 ... 0x3d:
+	case 0x38 ... 0x3b:
 	      cmp:		/* cmp */
 		emulate_2op_SrcV("cmp", src, dst, _eflags);
 		break;
+	case 0x3c:
+		dst.type = OP_REG;
+		dst.ptr = &_regs[VCPU_REGS_RAX];
+		dst.val = *(u8 *)dst.ptr;
+		dst.bytes = 1;
+		dst.orig_val = dst.val;
+		goto cmp;
+	case 0x3d:
+		dst.ptr = (unsigned long *) &_regs[VCPU_REGS_RAX];
+		switch ((dst.bytes = op_bytes)) {
+		case 2:
+			dst.val = *(u16 *) dst.ptr;
+			break;
+		case 4:
+			dst.val = *(u32 *) dst.ptr;
+			break;
+		case 8:
+			dst.val = *(u64 *) dst.ptr;
+			break;
+		}
+		goto cmp;
 	case 0x63:		/* movsxd */
 		if (mode != X86EMUL_MODE_PROT64)
 			goto cannot_emulate;

Attachment: signature.asc
Description: This is a digitally signed message part

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel

Reply via email to