x86/HVM: 32-bit IN result must be zero-extended to 64 bits (part 2) Just spotted a counterpart of what commit 9d89100b (same title) dealt with. Signed-off-by: Jan Beulich --- 2013-10-16.orig/xen/arch/x86/hvm/io.c 2013-11-13 17:45:16.000000000 +0100 +++ 2013-10-16/xen/arch/x86/hvm/io.c 2013-11-13 17:47:47.000000000 +0100 @@ -290,8 +290,10 @@ void hvm_io_assist(void) (void)handle_mmio(); break; case HVMIO_handle_pio_awaiting_completion: - memcpy(&guest_cpu_user_regs()->eax, - &p->data, vio->io_size); + if ( vio->io_size == 4 ) /* Needs zero extension. */ + guest_cpu_user_regs()->rax = (uint32_t)p->data; + else + memcpy(&guest_cpu_user_regs()->rax, &p->data, vio->io_size); break; default: break;