From: Keir Fraser Date: Fri, 1 Aug 2008 09:05:36 +0000 (+0100) Subject: passthrough: fix corrupting register value in pt_pci_write_config(). X-Git-Tag: xen-3.3.0-rc3~7 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=96c64e9274638b5cd969d658b8791e926c82cceb;p=qemu-xen-3.3-testing.git 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 --- diff --git a/hw/pass-through.c b/hw/pass-through.c index 3a1c8c47..1ac1c4c1 100644 --- a/hw/pass-through.c +++ b/hw/pass-through.c @@ -1099,7 +1099,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;