aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2008-08-01 09:53:05 +0100
committerKeir Fraser <keir.fraser@citrix.com>2008-08-01 09:53:05 +0100
commit37404be82b7448a4fb0d3136a65fc2421a33f8bc (patch)
tree3bb45e4a5b6245216b2b381f08049d2eec662acc /tools
parent02c55540b888f82b2f14497c107eefa2a116942e (diff)
downloadxen-37404be82b7448a4fb0d3136a65fc2421a33f8bc.tar.gz
xen-37404be82b7448a4fb0d3136a65fc2421a33f8bc.tar.bz2
xen-37404be82b7448a4fb0d3136a65fc2421a33f8bc.zip
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>
Diffstat (limited to 'tools')
-rw-r--r--tools/ioemu/hw/pass-through.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/tools/ioemu/hw/pass-through.c b/tools/ioemu/hw/pass-through.c
index 803885a4e8..d1101addfd 100644
--- a/tools/ioemu/hw/pass-through.c
+++ b/tools/ioemu/hw/pass-through.c
@@ -1087,15 +1087,14 @@ static void pt_pci_write_config(PCIDevice *d, uint32_t address, uint32_t val,
break;
}
- /* check libpci error */
+ /* check libpci result */
valid_mask = (0xFFFFFFFF >> ((4 - len) << 3));
if ((read_val & valid_mask) == valid_mask)
{
- PT_LOG("libpci read error. No emulation. "
+ PT_LOG("Warning: Return ALL F from libpci read. "
"[%02x:%02x.%x][Offset:%02xh][Length:%d]\n",
pci_bus_num(d->bus), ((d->devfn >> 3) & 0x1F), (d->devfn & 0x7),
address, len);
- goto exit;
}
/* pass directly to libpci for passthrough type register group */
@@ -1264,15 +1263,14 @@ static uint32_t pt_pci_read_config(PCIDevice *d, uint32_t address, int len)
break;
}
- /* check libpci error */
+ /* check libpci result */
valid_mask = (0xFFFFFFFF >> ((4 - len) << 3));
if ((val & valid_mask) == valid_mask)
{
- PT_LOG("libpci read error. No emulation. "
+ PT_LOG("Warning: Return ALL F from libpci read. "
"[%02x:%02x.%x][Offset:%02xh][Length:%d]\n",
pci_bus_num(d->bus), ((d->devfn >> 3) & 0x1F), (d->devfn & 0x7),
address, len);
- goto exit;
}
/* just return the I/O device register value for