Hi Avi,
  Attached patch implement emulation of instructions:
        sub al imm8  (opcode 0x2c)
        sub ax imm16, sub eax imm32 (opcode 0x2d)

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 6c2690c56af49dd810b504d7c5b8983e4bf25604
Author: Nitin A Kamble <[EMAIL PROTECTED]>
Date:   Thu Sep 13 19:39:56 2007 -0700

    Implement emulation of instructions:
    	sub al imm8  			(opcode 0x2c)
    	sub ax imm16, sub eax imm32  	(opcode 0x2d)
    
    Signed-off-by: Nitin A Kamble <[EMAIL PROTECTED]>

diff --git a/drivers/kvm/x86_emulate.c b/drivers/kvm/x86_emulate.c
index 2ffe7f8..5ca4626 100644
--- a/drivers/kvm/x86_emulate.c
+++ b/drivers/kvm/x86_emulate.c
@@ -87,7 +87,7 @@ static u8 opcode_table[256] = {
 	/* 0x28 - 0x2F */
 	ByteOp | DstMem | SrcReg | ModRM, DstMem | SrcReg | ModRM,
 	ByteOp | DstReg | SrcMem | ModRM, DstReg | SrcMem | ModRM,
-	0, 0, 0, 0,
+	SrcImmByte, SrcImm, 0, 0,
 	/* 0x30 - 0x37 */
 	ByteOp | DstMem | SrcReg | ModRM, DstMem | SrcReg | ModRM,
 	ByteOp | DstReg | SrcMem | ModRM, DstReg | SrcMem | ModRM,
@@ -963,10 +963,24 @@ done_prefixes:
 			dst.val = *(u32 *)dst.ptr;
 		dst.orig_val = dst.val;
 		goto and;
-	case 0x28 ... 0x2d:
+	case 0x28 ... 0x2b:
 	      sub:		/* sub */
 		emulate_2op_SrcV("sub", src, dst, _eflags);
 		break;
+	case 0x2c: 		/* sub al imm8 */
+		dst.type = OP_REG;
+		dst.ptr = &_regs[VCPU_REGS_RAX];
+		dst.val = *(u8 *)dst.ptr;
+		dst.bytes = 1;
+		dst.orig_val = dst.val;
+		goto sub;
+	case 0x2d:		/* sub ax imm16, sub eax imm32 */
+		dst.type = OP_REG;
+		dst.bytes = 2;
+		dst.ptr = &_regs[VCPU_REGS_RAX];
+		dst.val = *(u16 *)dst.ptr;
+		dst.orig_val = dst.val;
+		goto sub;
 	case 0x30 ... 0x35:
 	      xor:		/* xor */
 		emulate_2op_SrcV("xor", src, dst, _eflags);

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