ia64/xen-unstable

changeset 18234:f5bb024f9135

ioemu: fix libpci error handling.

libpci returns ALL F when error occurs. Currently, if libpci returns
ALL F, emulation stops. But it is possible that the field of real register
which is read by guest software is ALL F.

After applying this patch, if libpci returns ALL F, ioemu will log
warning message and continue the emulation.

Signed-off-by: Yuji Shimada <shimada-yxb@necst.nec.co.jp>
author Keir Fraser <keir.fraser@citrix.com>
date Fri Aug 01 09:53:05 2008 +0100 (2008-08-01)
parents 8d1c146fd842
children 6692c3646914
files tools/ioemu/hw/pass-through.c
line diff
     1.1 --- a/tools/ioemu/hw/pass-through.c	Fri Aug 01 09:52:22 2008 +0100
     1.2 +++ b/tools/ioemu/hw/pass-through.c	Fri Aug 01 09:53:05 2008 +0100
     1.3 @@ -1087,15 +1087,14 @@ static void pt_pci_write_config(PCIDevic
     1.4          break;
     1.5      }
     1.6  
     1.7 -    /* check libpci error */
     1.8 +    /* check libpci result */
     1.9      valid_mask = (0xFFFFFFFF >> ((4 - len) << 3));
    1.10      if ((read_val & valid_mask) == valid_mask)
    1.11      {
    1.12 -        PT_LOG("libpci read error. No emulation. "
    1.13 +        PT_LOG("Warning: Return ALL F from libpci read. "
    1.14              "[%02x:%02x.%x][Offset:%02xh][Length:%d]\n",
    1.15              pci_bus_num(d->bus), ((d->devfn >> 3) & 0x1F), (d->devfn & 0x7),
    1.16              address, len);
    1.17 -        goto exit;
    1.18      }
    1.19      
    1.20      /* pass directly to libpci for passthrough type register group */
    1.21 @@ -1264,15 +1263,14 @@ static uint32_t pt_pci_read_config(PCIDe
    1.22          break;
    1.23      }
    1.24  
    1.25 -    /* check libpci error */
    1.26 +    /* check libpci result */
    1.27      valid_mask = (0xFFFFFFFF >> ((4 - len) << 3));
    1.28      if ((val & valid_mask) == valid_mask)
    1.29      {
    1.30 -        PT_LOG("libpci read error. No emulation. "
    1.31 +        PT_LOG("Warning: Return ALL F from libpci read. "
    1.32              "[%02x:%02x.%x][Offset:%02xh][Length:%d]\n",
    1.33              pci_bus_num(d->bus), ((d->devfn >> 3) & 0x1F), (d->devfn & 0x7),
    1.34              address, len);
    1.35 -        goto exit;
    1.36      }
    1.37  
    1.38      /* just return the I/O device register value for