From: "Jan Beulich" Subject: [PATCH] x86-64/hvm: pio result storing Date: Mon, 14 May 2007 17:21:26 +0200 Message-ID: <46489A96.76E4.0078.0@novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Return-path: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org Don't clear upper 32 bits on 8- and 16-bit PIO reads. Signed-off-by: Jan Beulich Index: 2007-04-27/xen/arch/x86/hvm/io.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- 2007-04-27.orig/xen/arch/x86/hvm/io.c 2007-04-16 09:26:34.0000000= 00 +0200 +++ 2007-04-27/xen/arch/x86/hvm/io.c 2007-05-09 18:00:08.000000000 = +0200 @@ -418,11 +418,10 @@ static inline void set_eflags_PF(int siz static void hvm_pio_assist(struct cpu_user_regs *regs, ioreq_t *p, struct hvm_io_op *pio_opp) { - unsigned long old_eax; - int sign =3D p->df ? -1 : 1; - if ( p->data_is_ptr || (pio_opp->flags & OVERLAP) ) { + int sign =3D p->df ? -1 : 1; + if ( pio_opp->flags & REPZ ) regs->ecx -=3D p->count; =20 @@ -459,14 +458,15 @@ static void hvm_pio_assist(struct cpu_us } else if ( p->dir =3D=3D IOREQ_READ ) { - old_eax =3D regs->eax; + unsigned long old_eax =3D regs->eax; + switch ( p->size ) { case 1: - regs->eax =3D (old_eax & 0xffffff00) | (p->data & 0xff); + regs->eax =3D (old_eax & ~0xff) | (p->data & 0xff); break; case 2: - regs->eax =3D (old_eax & 0xffff0000) | (p->data & 0xffff); + regs->eax =3D (old_eax & ~0xffff) | (p->data & 0xffff); break; case 4: regs->eax =3D (p->data & 0xffffffff);