From mboxrd@z Thu Jan 1 00:00:00 1970 From: Keir Fraser Subject: Re: [PATCH] x86/HVM: 32-bit IN result must be zero-extended to 64 bits (part 2) Date: Wed, 13 Nov 2013 18:09:14 +0000 Message-ID: References: <5283C05E0200007800102F78@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1VgesT-0004ED-Cf for xen-devel@lists.xenproject.org; Wed, 13 Nov 2013 18:09:21 +0000 Received: by mail-bk0-f54.google.com with SMTP id 6so529348bkj.41 for ; Wed, 13 Nov 2013 10:09:19 -0800 (PST) In-Reply-To: <5283C05E0200007800102F78@nat28.tlf.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich , xen-devel List-Id: xen-devel@lists.xenproject.org On 13/11/2013 17:09, "Jan Beulich" wrote: > Just spotted a counterpart of what commit 9d89100b (same title) dealt > with. > > Signed-off-by: Jan Beulich Acked-by: Keir Fraser > --- 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