aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2008-08-01 09:54:13 +0100
committerKeir Fraser <keir.fraser@citrix.com>2008-08-01 09:54:13 +0100
commit8c715178a115fd4eab786653eb5fcc093a4a18fd (patch)
treee8928dd9bfa125c22f553d97a99e31f6a08e73ac /tools
parent37404be82b7448a4fb0d3136a65fc2421a33f8bc (diff)
downloadxen-8c715178a115fd4eab786653eb5fcc093a4a18fd.tar.gz
xen-8c715178a115fd4eab786653eb5fcc093a4a18fd.tar.bz2
xen-8c715178a115fd4eab786653eb5fcc093a4a18fd.zip
ioemu, passthrough: fix corrupting register value in pt_pci_write_config().
I forgot to shift value read from real device. If the emulated register offset is not aligned with 4 byte, the write emulation will not be handled well because of corrupting register value read from real device. The patch fixes this issue. Signed-off-by: Yuji Shimada <shimada-yxb@necst.nec.co.jp>
Diffstat (limited to 'tools')
-rw-r--r--tools/ioemu/hw/pass-through.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/ioemu/hw/pass-through.c b/tools/ioemu/hw/pass-through.c
index d1101addfd..428845f2c9 100644
--- a/tools/ioemu/hw/pass-through.c
+++ b/tools/ioemu/hw/pass-through.c
@@ -1101,7 +1101,8 @@ static void pt_pci_write_config(PCIDevice *d, uint32_t address, uint32_t val,
if (reg_grp_entry == NULL)
goto out;
- /* adjust the write value to appropriate CFC-CFF window */
+ /* adjust the read and write value to appropriate CFC-CFF window */
+ read_val <<= ((address & 3) << 3);
val <<= ((address & 3) << 3);
emul_len = len;