Skip to contentSkip to conversation

ioemu-remote&ioemu: fix corrupting register value in pt_pci_write_config().

PATCH New Yuji Shimada 1 participant 1 message Aug 1, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ioemu-remote&ioemu: fix corrupting register value in pt_pci_write_config().

This patch fixes corrupting register value in pt_pci_write_config(). It can be applied to both ioemu-remote and ioemu.

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.

--
Yuji Shimada

hw/pass-through.c +2 -1
index 3a1c8c4..1ac1c4c 100644
@@ -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;
 

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel