浏览代码

KVM: x86 emulator: fix ret emulation

'ret' did not set the operand type or size for the destination, so
writeback ignored it.

Signed-off-by: Avi Kivity <avi@redhat.com>
Avi Kivity 16 年之前
父节点
当前提交
cf5de4f886
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      arch/x86/kvm/x86_emulate.c

+ 2 - 0
arch/x86/kvm/x86_emulate.c

@@ -1650,7 +1650,9 @@ special_insn:
 		emulate_grp2(ctxt);
 		emulate_grp2(ctxt);
 		break;
 		break;
 	case 0xc3: /* ret */
 	case 0xc3: /* ret */
+		c->dst.type = OP_REG;
 		c->dst.ptr = &c->eip;
 		c->dst.ptr = &c->eip;
+		c->dst.bytes = c->op_bytes;
 		goto pop_instruction;
 		goto pop_instruction;
 	case 0xc6 ... 0xc7:	/* mov (sole member of Grp11) */
 	case 0xc6 ... 0xc7:	/* mov (sole member of Grp11) */
 	mov:
 	mov: