Hi Avi,
  Attached is the patch to implement instructions:
        inc reg
        opcode: 0x40 - 0x47
  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 c47e7ccd17a9fe79e0f5e8b3198d6cd84e7c85ed
Author: Nitin A Kamble <[EMAIL PROTECTED]>
Date:   Fri Sep 14 14:47:42 2007 -0700

    Implement emulation of instruction:
    	inc reg
    	opcode: 0x40 - 0x47
    
    Signed-off-by: Nitin A Kamble <[EMAIL PROTECTED]>

diff --git a/drivers/kvm/x86_emulate.c b/drivers/kvm/x86_emulate.c
index ab7db47..f5a4f4a 100644
--- a/drivers/kvm/x86_emulate.c
+++ b/drivers/kvm/x86_emulate.c
@@ -96,8 +96,11 @@ static u8 opcode_table[256] = {
 	ByteOp | DstMem | SrcReg | ModRM, DstMem | SrcReg | ModRM,
 	ByteOp | DstReg | SrcMem | ModRM, DstReg | SrcMem | ModRM,
 	0, 0, 0, 0,
-	/* 0x40 - 0x4F */
-	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+	/* 0x40 - 0x47 */
+	ImplicitOps, ImplicitOps, ImplicitOps, ImplicitOps,
+	ImplicitOps, ImplicitOps, ImplicitOps, ImplicitOps,
+	/* 0x48 - 0x4F */
+	0, 0, 0, 0, 0, 0, 0, 0,
 	/* 0x50 - 0x57 */
 	ImplicitOps, ImplicitOps, ImplicitOps, ImplicitOps,
 	ImplicitOps, ImplicitOps, ImplicitOps, ImplicitOps,
@@ -1390,6 +1393,22 @@ pop_instruction:
 		_eip = ctxt->vcpu->rip;
 	}
 	switch (b) {
+	case 0x40 ... 0x47:	/* inc reg */
+		dst.ptr = (unsigned long *)&_regs[b & 0x7];
+		dst.val = *dst.ptr;
+			switch (op_bytes) {
+			case 2:
+				*(u16 *)dst.ptr = (u16)dst.val + 1;
+				break;
+			case 4:
+				*dst.ptr = (u32)dst.val + 1;
+				break;	/* 64b: zero-ext */
+			case 8:
+				*dst.ptr = dst.val + 1;
+				break;
+			}
+		no_wb = 1; /* Disable writeback. */
+		break;
 	case 0xa4 ... 0xa5:	/* movs */
 		dst.type = OP_MEM;
 		dst.bytes = (d & ByteOp) ? 1 : op_bytes;

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