瀏覽代碼

KVM: x86 emulator: qualify OpReg inhibit_byte_regs hack

OpReg decoding has a hack that inhibits byte registers for movsx and movzx
instructions.  It should be replaced by something better, but meanwhile,
qualify that the hack is only active for the destination operand.

Note these instructions only use OpReg for the destination, but better to
be explicit about it.

Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Avi Kivity 14 年之前
父節點
當前提交
5217973ef8
共有 1 個文件被更改,包括 1 次插入0 次删除
  1. 1 0
      arch/x86/kvm/emulate.c

+ 1 - 0
arch/x86/kvm/emulate.c

@@ -3346,6 +3346,7 @@ static int decode_operand(struct x86_emulate_ctxt *ctxt, struct operand *op,
 	switch (d) {
 	switch (d) {
 	case OpReg:
 	case OpReg:
 		decode_register_operand(ctxt, op,
 		decode_register_operand(ctxt, op,
+			 op == &ctxt->dst &&
 			 ctxt->twobyte && (ctxt->b == 0xb6 || ctxt->b == 0xb7));
 			 ctxt->twobyte && (ctxt->b == 0xb6 || ctxt->b == 0xb7));
 		break;
 		break;
 	case OpImmUByte:
 	case OpImmUByte: