@@ -748,16 +748,16 @@ int hvf_vcpu_exec(CPUState *cpu)
} else if (size == 2) {
AX(env) = val;
} else if (size == 4) {
- RAX(env) = (uint32_t)val;
+ RRX(env) = (uint32_t)val;
} else {
- VM_PANIC("size");
+ RRX(env) = (uint64_t)val;
}
RIP(env) += ins_len;
store_regs(cpu);
break;
} else if (!string && !in) {
- RAX(env) = rreg(cpu->hvf_fd, HV_X86_RAX);
- hvf_handle_io(env, port, &RAX(env), 1, size, 1);
+ RRX(env) = rreg(cpu->hvf_fd, HV_X86_RAX);
+ hvf_handle_io(env, port, &RRX(env), 1, size, 1);
macvm_set_rip(cpu, rip + ins_len);
break;
}
Reading a 32-bit port should clear the upper 32-bits of the register. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> --- target/i386/hvf/hvf.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)