ia64/xen-unstable

changeset 15103:eb027b704dc5

x86-64/hvm: pio result storing

Don't clear upper 32 bits on 8- and 16-bit PIO reads.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
author kfraser@localhost.localdomain
date Tue May 15 10:13:11 2007 +0100 (2007-05-15)
parents 807f374e720d
children f4390e34ad12
files xen/arch/x86/hvm/io.c
line diff
     1.1 --- a/xen/arch/x86/hvm/io.c	Tue May 15 10:12:02 2007 +0100
     1.2 +++ b/xen/arch/x86/hvm/io.c	Tue May 15 10:13:11 2007 +0100
     1.3 @@ -418,11 +418,10 @@ static inline void set_eflags_PF(int siz
     1.4  static void hvm_pio_assist(struct cpu_user_regs *regs, ioreq_t *p,
     1.5                             struct hvm_io_op *pio_opp)
     1.6  {
     1.7 -    unsigned long old_eax;
     1.8 -    int sign = p->df ? -1 : 1;
     1.9 -
    1.10      if ( p->data_is_ptr || (pio_opp->flags & OVERLAP) )
    1.11      {
    1.12 +        int sign = p->df ? -1 : 1;
    1.13 +
    1.14          if ( pio_opp->flags & REPZ )
    1.15              regs->ecx -= p->count;
    1.16  
    1.17 @@ -459,14 +458,15 @@ static void hvm_pio_assist(struct cpu_us
    1.18      }
    1.19      else if ( p->dir == IOREQ_READ )
    1.20      {
    1.21 -        old_eax = regs->eax;
    1.22 +        unsigned long old_eax = regs->eax;
    1.23 +
    1.24          switch ( p->size )
    1.25          {
    1.26          case 1:
    1.27 -            regs->eax = (old_eax & 0xffffff00) | (p->data & 0xff);
    1.28 +            regs->eax = (old_eax & ~0xff) | (p->data & 0xff);
    1.29              break;
    1.30          case 2:
    1.31 -            regs->eax = (old_eax & 0xffff0000) | (p->data & 0xffff);
    1.32 +            regs->eax = (old_eax & ~0xffff) | (p->data & 0xffff);
    1.33              break;
    1.34          case 4:
    1.35              regs->eax = (p->data & 0xffffffff);