* [PATCH] x86 emulator: Add pop es instruction (opcode 0x07)
@ 2009-02-25 21:39 Mohammed Gamal
2009-02-26 7:13 ` Avi Kivity
0 siblings, 1 reply; 2+ messages in thread
From: Mohammed Gamal @ 2009-02-25 21:39 UTC (permalink / raw)
To: kvm; +Cc: avi
Add pop es instruction
Signed-off-by: Mohammed Gamal <m.gamal005@gmail.com>
---
arch/x86/kvm/x86_emulate.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/arch/x86/kvm/x86_emulate.c b/arch/x86/kvm/x86_emulate.c
index ca91749..8c292b6 100644
--- a/arch/x86/kvm/x86_emulate.c
+++ b/arch/x86/kvm/x86_emulate.c
@@ -87,7 +87,7 @@ static u32 opcode_table[256] = {
/* 0x00 - 0x07 */
ByteOp | DstMem | SrcReg | ModRM, DstMem | SrcReg | ModRM,
ByteOp | DstReg | SrcMem | ModRM, DstReg | SrcMem | ModRM,
- ByteOp | DstAcc | SrcImm, DstAcc | SrcImm, 0, 0,
+ ByteOp | DstAcc | SrcImm, DstAcc | SrcImm, 0, DstReg | ModRM,
/* 0x08 - 0x0F */
ByteOp | DstMem | SrcReg | ModRM, DstMem | SrcReg | ModRM,
ByteOp | DstReg | SrcMem | ModRM, DstReg | SrcMem | ModRM,
@@ -1446,6 +1446,9 @@ special_insn:
add: /* add */
emulate_2op_SrcV("add", c->src, c->dst, ctxt->eflags);
break;
+ case 0x07: /* pop es */
+ emulate_pop(ctxt, ops, &c->regs[VCPU_SREG_ES], c->op_bytes);
+ break;
case 0x08 ... 0x0d:
or: /* or */
emulate_2op_SrcV("or", c->src, c->dst, ctxt->eflags);
--
1.5.4.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] x86 emulator: Add pop es instruction (opcode 0x07)
2009-02-25 21:39 [PATCH] x86 emulator: Add pop es instruction (opcode 0x07) Mohammed Gamal
@ 2009-02-26 7:13 ` Avi Kivity
0 siblings, 0 replies; 2+ messages in thread
From: Avi Kivity @ 2009-02-26 7:13 UTC (permalink / raw)
To: Mohammed Gamal; +Cc: kvm
Mohammed Gamal wrote:
> Add pop es instruction
>
>
Hi again...
> @@ -1446,6 +1446,9 @@ special_insn:
> add: /* add */
> emulate_2op_SrcV("add", c->src, c->dst, ctxt->eflags);
> break;
> + case 0x07: /* pop es */
> + emulate_pop(ctxt, ops, &c->regs[VCPU_SREG_ES], c->op_bytes);
> + break;
> case 0x08 ... 0x0d:
> or: /* or */
> emulate_2op_SrcV("or", c->src, c->dst, ctxt->eflags);
>
... but this is insufficient. You need to load the segment cache, see
kvm_load_segment_descriptor().
--
I have a truly marvellous patch that fixes the bug which this
signature is too narrow to contain.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-02-26 7:12 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-02-25 21:39 [PATCH] x86 emulator: Add pop es instruction (opcode 0x07) Mohammed Gamal
2009-02-26 7:13 ` Avi Kivity
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.