0xb0-0xb7)

This patch adds mov r,imm instructions (opcodes 0xb0-0xb7) to the x86
emulator.

Signed-off-by: Mohammed Gamal <[EMAIL PROTECTED]>

---
 arch/x86/kvm/x86_emulate.c |   16 ++++++++++++++--
 1 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kvm/x86_emulate.c b/arch/x86/kvm/x86_emulate.c
index a73e702..742e782 100644
--- a/arch/x86/kvm/x86_emulate.c
+++ b/arch/x86/kvm/x86_emulate.c
@@ -154,8 +154,12 @@ static u16 opcode_table[256] = {
        0, 0, ByteOp | ImplicitOps | Mov | String, ImplicitOps | Mov | String,
        ByteOp | ImplicitOps | Mov | String, ImplicitOps | Mov | String,
        ByteOp | ImplicitOps | String, ImplicitOps | String,
-       /* 0xB0 - 0xBF */
-       0, 0, 0, 0, 0, 0, 0, 0,
+       /* 0xB0 - 0xB7 */
+       ByteOp | DstReg | SrcImm | Mov, ByteOp | DstReg | SrcImm | Mov, 
+       ByteOp | DstReg | SrcImm | Mov, ByteOp | DstReg | SrcImm | Mov, 
+       ByteOp | DstReg | SrcImm | Mov, ByteOp | DstReg | SrcImm | Mov, 
+       ByteOp | DstReg | SrcImm | Mov, ByteOp | DstReg | SrcImm | Mov,
+       /* 0xB8 - 0xBF */
        DstReg | SrcImm | Mov, DstReg | SrcImm | Mov, DstReg | SrcImm | Mov, 
        DstReg | SrcImm | Mov, DstReg | SrcImm | Mov, DstReg | SrcImm | Mov, 
        DstReg | SrcImm | Mov, DstReg | SrcImm | Mov,
@@ -1666,6 +1670,14 @@ special_insn:
        case 0xae ... 0xaf:     /* scas */
                DPRINTF("Urk! I don't handle SCAS.\n");
                goto cannot_emulate;
+       case 0xb0 ... 0xb3: /* movb r, imm (low byte) */
+               c->dst.val &= ~0xff; /* Clear the low byte */
+               c->dst.val |= c->src.val;
+               break;
+       case 0xb4 ... 0xb7: /* movb r, imm (high byte) */
+               c->dst.val &= ~0xff00; /* Clear the high byte */
+               c->dst.val |= (c->src.val << 8);
+               break;
        case 0xb8 ... 0xbf: /* mov r, imm */
                goto mov;
        case 0xc0 ... 0xc1:
-- 
1.5.4.3


--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to