Commit 9f1ef3f8 authored by Avi Kivity's avatar Avi Kivity

KVM: Simplify decode_register_operand() calling convention

Now that rex_prefix is part of the decode cache, there is no need to pass
it along.
Signed-off-by: default avatarAvi Kivity <avi@qumranet.com>
parent 33615aa9
...@@ -518,10 +518,10 @@ static int test_cc(unsigned int condition, unsigned int flags) ...@@ -518,10 +518,10 @@ static int test_cc(unsigned int condition, unsigned int flags)
static void decode_register_operand(struct operand *op, static void decode_register_operand(struct operand *op,
struct decode_cache *c, struct decode_cache *c,
int highbyte_regs,
int inhibit_bytereg) int inhibit_bytereg)
{ {
unsigned reg = c->modrm_reg; unsigned reg = c->modrm_reg;
int highbyte_regs = c->rex_prefix == 0;
if (!(c->d & ModRM)) if (!(c->d & ModRM))
reg = (c->b & 7) | ((c->rex_prefix & 1) << 3); reg = (c->b & 7) | ((c->rex_prefix & 1) << 3);
...@@ -837,7 +837,7 @@ x86_decode_insn(struct x86_emulate_ctxt *ctxt, struct x86_emulate_ops *ops) ...@@ -837,7 +837,7 @@ x86_decode_insn(struct x86_emulate_ctxt *ctxt, struct x86_emulate_ops *ops)
case SrcNone: case SrcNone:
break; break;
case SrcReg: case SrcReg:
decode_register_operand(&c->src, c, c->rex_prefix == 0, 0); decode_register_operand(&c->src, c, 0);
break; break;
case SrcMem16: case SrcMem16:
c->src.bytes = 2; c->src.bytes = 2;
...@@ -895,7 +895,7 @@ x86_decode_insn(struct x86_emulate_ctxt *ctxt, struct x86_emulate_ops *ops) ...@@ -895,7 +895,7 @@ x86_decode_insn(struct x86_emulate_ctxt *ctxt, struct x86_emulate_ops *ops)
/* Special instructions do their own operand decoding. */ /* Special instructions do their own operand decoding. */
return 0; return 0;
case DstReg: case DstReg:
decode_register_operand(&c->dst, c, c->rex_prefix == 0, decode_register_operand(&c->dst, c,
c->twobyte && (c->b == 0xb6 || c->b == 0xb7)); c->twobyte && (c->b == 0xb6 || c->b == 0xb7));
break; break;
case DstMem: case DstMem:
......
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