Commit 28867cee authored by Avi Kivity's avatar Avi Kivity

KVM: x86 emulator: add 8-bit memory operands

Useful for MOVSX/MOVZX.
Signed-off-by: default avatarAvi Kivity <avi@redhat.com>
Signed-off-by: default avatarMarcelo Tosatti <mtosatti@redhat.com>
parent 54f65795
...@@ -57,6 +57,7 @@ ...@@ -57,6 +57,7 @@
#define OpDS 23ull /* DS */ #define OpDS 23ull /* DS */
#define OpFS 24ull /* FS */ #define OpFS 24ull /* FS */
#define OpGS 25ull /* GS */ #define OpGS 25ull /* GS */
#define OpMem8 26ull /* 8-bit zero extended memory operand */
#define OpBits 5 /* Width of operand field */ #define OpBits 5 /* Width of operand field */
#define OpMask ((1ull << OpBits) - 1) #define OpMask ((1ull << OpBits) - 1)
...@@ -101,6 +102,7 @@ ...@@ -101,6 +102,7 @@
#define SrcAcc (OpAcc << SrcShift) #define SrcAcc (OpAcc << SrcShift)
#define SrcImmU16 (OpImmU16 << SrcShift) #define SrcImmU16 (OpImmU16 << SrcShift)
#define SrcDX (OpDX << SrcShift) #define SrcDX (OpDX << SrcShift)
#define SrcMem8 (OpMem8 << SrcShift)
#define SrcMask (OpMask << SrcShift) #define SrcMask (OpMask << SrcShift)
#define BitOp (1<<11) #define BitOp (1<<11)
#define MemAbs (1<<12) /* Memory operand is absolute displacement */ #define MemAbs (1<<12) /* Memory operand is absolute displacement */
...@@ -3656,6 +3658,9 @@ static int decode_operand(struct x86_emulate_ctxt *ctxt, struct operand *op, ...@@ -3656,6 +3658,9 @@ static int decode_operand(struct x86_emulate_ctxt *ctxt, struct operand *op,
case OpImm: case OpImm:
rc = decode_imm(ctxt, op, imm_size(ctxt), true); rc = decode_imm(ctxt, op, imm_size(ctxt), true);
break; break;
case OpMem8:
ctxt->memop.bytes = 1;
goto mem_common;
case OpMem16: case OpMem16:
ctxt->memop.bytes = 2; ctxt->memop.bytes = 2;
goto mem_common; goto mem_common;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment