[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH] x86/HVM: 32-bit IN result must be zero-extended to 64 bits (part 2)



On 13/11/13 17:09, Jan Beulich wrote:
Just spotted a counterpart of what commit 9d89100b (same title) dealt
with.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>

Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>


--- 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;





_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.