public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86 emulator: Add call near absolute instruction (group5: opcode 0xff mod r/m 2)
@ 2008-09-08 18:47 Mohammed Gamal
  2008-09-09  7:16 ` Guillaume Thouvenin
  2008-09-10 15:31 ` Avi Kivity
  0 siblings, 2 replies; 10+ messages in thread
From: Mohammed Gamal @ 2008-09-08 18:47 UTC (permalink / raw)
  To: kvm; +Cc: avi, guillaume.thouvenin

Add call near absolute instruction

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

diff --git a/arch/x86/kvm/x86_emulate.c b/arch/x86/kvm/x86_emulate.c
index 3ac2f14..0630d21 100644
--- a/arch/x86/kvm/x86_emulate.c
+++ b/arch/x86/kvm/x86_emulate.c
@@ -286,7 +286,8 @@ static u16 group_table[] = {
 	ByteOp | DstMem | SrcNone | ModRM, ByteOp | DstMem | SrcNone | ModRM,
 	0, 0, 0, 0, 0, 0,
 	[Group5*8] =
-	DstMem | SrcNone | ModRM, DstMem | SrcNone | ModRM, 0, 0,
+	DstMem | SrcNone | ModRM, DstMem | SrcNone | ModRM,
+	SrcMem | ModRM | Stack, 0,
 	SrcMem | ModRM, 0, SrcMem | ModRM | Stack, 0,
 	[Group7*8] =
 	0, 0, ModRM | SrcMem, ModRM | SrcMem,
@@ -1162,6 +1163,14 @@ static inline int emulate_grp45(struct x86_emulate_ctxt *ctxt,
 	case 1:	/* dec */
 		emulate_1op("dec", c->dst, ctxt->eflags);
 		break;
+	case 2: /* call near abs */ {
+		long int old_eip;
+		old_eip = c->eip;
+		c->eip = c->src.val;
+		c->src.val = old_eip;
+		emulate_push(ctxt);
+		break;
+	}
 	case 4: /* jmp abs */
 		c->eip = c->src.val;
 		break;
-- 
1.5.4.3



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

end of thread, other threads:[~2008-09-12 10:42 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-08 18:47 [PATCH] x86 emulator: Add call near absolute instruction (group5: opcode 0xff mod r/m 2) Mohammed Gamal
2008-09-09  7:16 ` Guillaume Thouvenin
2008-09-09 12:49   ` Mohammed Gamal
2008-09-10  9:31     ` Guillaume Thouvenin
2008-09-09 14:51   ` Avi Kivity
2008-09-09 17:05     ` Mohammed Gamal
2008-09-10  7:29       ` Avi Kivity
2008-09-12  7:40     ` Guillaume Thouvenin
2008-09-12 10:42       ` Mohammed Gamal
2008-09-10 15:31 ` Avi Kivity

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