public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [Patch] (big) real mode emulation - and ax imm
@ 2007-08-16 23:44 Nitin A Kamble
       [not found] ` <1187307885.10269.6.camel-mpPvwfgnXtFHIUuj5cj4Omt3HXsI98Cx0E9HWUfgJXw@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Nitin A Kamble @ 2007-08-16 23:44 UTC (permalink / raw)
  To: Avi Kivity; +Cc: Yu, Wilfred, kvm-devel


[-- Attachment #1.1.1: Type: text/plain, Size: 353 bytes --]

Hi Avi,
 Attached is the patch to implement "and al imm8", "and ax imm16" & "
and eax imm32" instructions.
  Please apply or comment.
-- 
Thanks & Regards,
Nitin
Open Source Technology Center, Intel Corporation
-----------------------------------------------------------------
The mind is like a parachute; it works much better when it's open

[-- Attachment #1.1.2: and_al_ax_eax_imm.patch --]
[-- Type: text/x-patch, Size: 1594 bytes --]

commit 16312d9a828af54d3d4ad7dc0a9a1f038de72bf6
Author: Nitin A Kamble <nitin.a.kamble@intel.com>
Date:   Thu Aug 16 19:19:44 2007 -0700

    Implement emulation of instruction
    	and al imm8 (opcode 0x24)
    	and ax/eax imm16/imm32 (opcode 0x25)
    
    Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>

diff --git a/drivers/kvm/x86_emulate.c b/drivers/kvm/x86_emulate.c
index a2d520b..cfdbaa5 100644
--- a/drivers/kvm/x86_emulate.c
+++ b/drivers/kvm/x86_emulate.c
@@ -83,7 +83,7 @@ static u8 opcode_table[256] = {
 	/* 0x20 - 0x27 */
 	ByteOp | DstMem | SrcReg | ModRM, DstMem | SrcReg | ModRM,
 	ByteOp | DstReg | SrcMem | ModRM, DstReg | SrcMem | ModRM,
-	0, 0, 0, 0,
+	SrcImmByte, SrcImm, 0, 0,
 	/* 0x28 - 0x2F */
 	ByteOp | DstMem | SrcReg | ModRM, DstMem | SrcReg | ModRM,
 	ByteOp | DstReg | SrcMem | ModRM, DstReg | SrcMem | ModRM,
@@ -890,7 +890,23 @@ done_prefixes:
 	      sbb:		/* sbb */
 		emulate_2op_SrcV("sbb", src, dst, _eflags);
 		break;
-	case 0x20 ... 0x25:
+	case 0x24:              /* and 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 and;
+	case 0x25:              /* and ax imm16, or eax imm32 */
+		dst.type = OP_REG;
+		dst.bytes = op_bytes;
+		dst.ptr = &_regs[VCPU_REGS_RAX];
+		if (op_bytes == 2)
+			dst.val = *(u16 *)dst.ptr;
+		else
+			dst.val = *(u32 *)dst.ptr;
+		dst.orig_val = dst.val;
+	case 0x20 ... 0x23:
 	      and:		/* and */
 		emulate_2op_SrcV("and", src, dst, _eflags);
 		break;

[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

[-- Attachment #2: Type: text/plain, Size: 315 bytes --]

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/

[-- Attachment #3: Type: text/plain, Size: 186 bytes --]

_______________________________________________
kvm-devel mailing list
kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/kvm-devel

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-08-19  7:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-16 23:44 [Patch] (big) real mode emulation - and ax imm Nitin A Kamble
     [not found] ` <1187307885.10269.6.camel-mpPvwfgnXtFHIUuj5cj4Omt3HXsI98Cx0E9HWUfgJXw@public.gmane.org>
2007-08-17 12:18   ` Avi Kivity
     [not found]     ` <46C59201.5070901-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-08-17 22:12       ` [Patch] (big) real mode emulation - sorted opcodes Nitin A Kamble
     [not found]         ` <1187388776.9011.9.camel-mpPvwfgnXtFHIUuj5cj4Omt3HXsI98Cx0E9HWUfgJXw@public.gmane.org>
2007-08-19  7:56           ` Avi Kivity

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox