Hi Avi,
   Please find a patch implementing the "ret" instruction in the
x86_emulation.
        
Thanks & Regards,
Nitin 
Open Source Technology Center, Intel Corporation.
-------------------------------------------------------------------------
The mind is like a parachute; it works much better when it's open. 
    
commit 32271188f940f8f30f9be0c4860077381d6b524c
Author: Nitin A Kamble <[EMAIL PROTECTED]>
Date:   Thu Jun 7 18:32:45 2007 -0700

    Implement "ret" instruction, opcode 0xc3

diff --git a/drivers/kvm/x86_emulate.c b/drivers/kvm/x86_emulate.c
index 46d4124..c7e6e53 100644
--- a/drivers/kvm/x86_emulate.c
+++ b/drivers/kvm/x86_emulate.c
@@ -129,7 +129,7 @@ static u8 opcode_table[256] = {
 	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 	/* 0xC0 - 0xC7 */
 	ByteOp | DstMem | SrcImm | ModRM, DstMem | SrcImmByte | ModRM, 0, 0,
-	0, 0, ByteOp | DstMem | SrcImm | ModRM | Mov,
+	ImplicitOps, 0, ByteOp | DstMem | SrcImm | ModRM | Mov,
 	    DstMem | SrcImm | ModRM | Mov,
 	/* 0xC8 - 0xCF */
 	0, 0, 0, 0, 0, 0, 0, 0,
@@ -1113,10 +1113,15 @@ special_insn:
 		_eip = ctxt->vcpu->rip;
 	}
 	switch (b) {
+    case 0xc3: /* ret */
+		dst.ptr = & _eip;
+        goto pop_instruction;
 	case 0x58 ... 0x5f:	/* pop reg */
+   		dst.ptr = (unsigned long *)&_regs[b & 0x7];
+
+        pop_instruction:
 		dst.type = OP_REG;
 		dst.bytes = op_bytes;
-		dst.ptr = (unsigned long *)&_regs[b & 0x7];
         
 		if ((rc = ops->read_std(register_address(ctxt->ss_base,
 							 _regs[VCPU_REGS_RSP]),

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

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel

Reply via email to