public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86 emulator: Add test acc, imm instruction (opcodes 0xA8 - 0xA9)
@ 2010-05-11 19:22 Mohammed Gamal
  2010-05-12  9:39 ` Avi Kivity
  2010-05-13  1:57 ` Marcelo Tosatti
  0 siblings, 2 replies; 3+ messages in thread
From: Mohammed Gamal @ 2010-05-11 19:22 UTC (permalink / raw)
  To: avi; +Cc: mtosatti, kvm, Mohammed Gamal

This adds test acc, imm instruction to the x86 emulator

Signed-off-by: Mohammed Gamal <m.gamal005@gmail.com>
---
 arch/x86/kvm/emulate.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index b43ac98..be5e78d 100644
--- a/arch/x86/kvm/emulate.c
+++ b/arch/x86/kvm/emulate.c
@@ -181,7 +181,7 @@ static u32 opcode_table[256] = {
 	ByteOp | SrcSI | DstDI | Mov | String, SrcSI | DstDI | Mov | String,
 	ByteOp | SrcSI | DstDI | String, SrcSI | DstDI | String,
 	/* 0xA8 - 0xAF */
-	0, 0, ByteOp | DstDI | Mov | String, DstDI | Mov | String,
+	DstAcc | SrcImmByte | ByteOp, DstAcc | SrcImm, ByteOp | DstDI | Mov | String, DstDI | Mov | String,
 	ByteOp | SrcSI | DstAcc | Mov | String, SrcSI | DstAcc | Mov | String,
 	ByteOp | DstDI | String, DstDI | String,
 	/* 0xB0 - 0xB7 */
@@ -2754,6 +2754,7 @@ special_insn:
 		}
 		break;
 	case 0x84 ... 0x85:
+	test:
 		emulate_2op_SrcV("test", c->src, c->dst, ctxt->eflags);
 		break;
 	case 0x86 ... 0x87:	/* xchg */
@@ -2852,6 +2853,8 @@ special_insn:
 		c->dst.type = OP_NONE; /* Disable writeback. */
 		DPRINTF("cmps: mem1=0x%p mem2=0x%p\n", c->src.ptr, c->dst.ptr);
 		goto cmp;
+	case 0xa8 ... 0xa9:	/* test ax, imm */
+		goto test;	
 	case 0xaa ... 0xab:	/* stos */
 		c->dst.val = c->regs[VCPU_REGS_RAX];
 		break;
-- 
1.7.0.4


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

* Re: [PATCH] x86 emulator: Add test acc, imm instruction (opcodes 0xA8 - 0xA9)
  2010-05-11 19:22 [PATCH] x86 emulator: Add test acc, imm instruction (opcodes 0xA8 - 0xA9) Mohammed Gamal
@ 2010-05-12  9:39 ` Avi Kivity
  2010-05-13  1:57 ` Marcelo Tosatti
  1 sibling, 0 replies; 3+ messages in thread
From: Avi Kivity @ 2010-05-12  9:39 UTC (permalink / raw)
  To: Mohammed Gamal; +Cc: mtosatti, kvm

On 05/11/2010 10:22 PM, Mohammed Gamal wrote:
> This adds test acc, imm instruction to the x86 emulator
>
>    


Looks good.  Testcases please.

-- 
Do not meddle in the internals of kernels, for they are subtle and quick to panic.


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

* Re: [PATCH] x86 emulator: Add test acc, imm instruction (opcodes 0xA8 - 0xA9)
  2010-05-11 19:22 [PATCH] x86 emulator: Add test acc, imm instruction (opcodes 0xA8 - 0xA9) Mohammed Gamal
  2010-05-12  9:39 ` Avi Kivity
@ 2010-05-13  1:57 ` Marcelo Tosatti
  1 sibling, 0 replies; 3+ messages in thread
From: Marcelo Tosatti @ 2010-05-13  1:57 UTC (permalink / raw)
  To: Mohammed Gamal; +Cc: avi, kvm

On Tue, May 11, 2010 at 10:22:40PM +0300, Mohammed Gamal wrote:
> This adds test acc, imm instruction to the x86 emulator
> 
> Signed-off-by: Mohammed Gamal <m.gamal005@gmail.com>
> ---
>  arch/x86/kvm/emulate.c |    5 ++++-
>  1 files changed, 4 insertions(+), 1 deletions(-)

Applied, thanks.


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

end of thread, other threads:[~2010-05-13  2:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-11 19:22 [PATCH] x86 emulator: Add test acc, imm instruction (opcodes 0xA8 - 0xA9) Mohammed Gamal
2010-05-12  9:39 ` Avi Kivity
2010-05-13  1:57 ` Marcelo Tosatti

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