]> xenbits.xensource.com Git - qemu-xen-3.3-testing.git/commitdiff
passthrough: fix corrupting register value in pt_pci_write_config().
authorKeir Fraser <kfraser@endor.localdomain>
Fri, 1 Aug 2008 09:05:36 +0000 (10:05 +0100)
committerKeir Fraser <kfraser@endor.localdomain>
Fri, 1 Aug 2008 09:05:36 +0000 (10:05 +0100)
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>
hw/pass-through.c

index 3a1c8c47d6a5000c194951abd756c5351cf01fb6..1ac1c4c189ac23aeb05aa49a2e920a046cd98252 100644 (file)
@@ -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;