xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] x86/HVM: 32-bit IN result must be zero-extended to 64 bits (part 2)
@ 2013-11-13 17:09 Jan Beulich
  2013-11-13 17:12 ` Andrew Cooper
  2013-11-13 18:09 ` Keir Fraser
  0 siblings, 2 replies; 3+ messages in thread
From: Jan Beulich @ 2013-11-13 17:09 UTC (permalink / raw)
  To: xen-devel; +Cc: Keir Fraser

[-- Attachment #1: Type: text/plain, Size: 785 bytes --]

Just spotted a counterpart of what commit 9d89100b (same title) dealt
with.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

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




[-- Attachment #2: x86-HVM-PIO-zero-extend-2.patch --]
[-- Type: text/plain, Size: 850 bytes --]

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 <jbeulich@suse.com>

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

[-- Attachment #3: Type: text/plain, Size: 126 bytes --]

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] x86/HVM: 32-bit IN result must be zero-extended to 64 bits (part 2)
  2013-11-13 17:09 [PATCH] x86/HVM: 32-bit IN result must be zero-extended to 64 bits (part 2) Jan Beulich
@ 2013-11-13 17:12 ` Andrew Cooper
  2013-11-13 18:09 ` Keir Fraser
  1 sibling, 0 replies; 3+ messages in thread
From: Andrew Cooper @ 2013-11-13 17:12 UTC (permalink / raw)
  To: Jan Beulich; +Cc: xen-devel, Keir Fraser


[-- Attachment #1.1: Type: text/plain, Size: 1037 bytes --]

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@suse.com>

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

>
> --- 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@lists.xen.org
> http://lists.xen.org/xen-devel


[-- Attachment #1.2: Type: text/html, Size: 1964 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] x86/HVM: 32-bit IN result must be zero-extended to 64 bits (part 2)
  2013-11-13 17:09 [PATCH] x86/HVM: 32-bit IN result must be zero-extended to 64 bits (part 2) Jan Beulich
  2013-11-13 17:12 ` Andrew Cooper
@ 2013-11-13 18:09 ` Keir Fraser
  1 sibling, 0 replies; 3+ messages in thread
From: Keir Fraser @ 2013-11-13 18:09 UTC (permalink / raw)
  To: Jan Beulich, xen-devel

On 13/11/2013 17:09, "Jan Beulich" <JBeulich@suse.com> wrote:

> Just spotted a counterpart of what commit 9d89100b (same title) dealt
> with.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Acked-by: Keir Fraser <keir@xen.org>

> --- 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@lists.xen.org
> http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-11-13 18:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-13 17:09 [PATCH] x86/HVM: 32-bit IN result must be zero-extended to 64 bits (part 2) Jan Beulich
2013-11-13 17:12 ` Andrew Cooper
2013-11-13 18:09 ` Keir Fraser

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).