From: Keir Fraser Date: Fri, 1 Aug 2008 08:54:13 +0000 (+0100) Subject: ioemu, passthrough: fix corrupting register value in pt_pci_write_config(). X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~14165^2~46 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=8c715178a115fd4eab786653eb5fcc093a4a18fd;p=xen.git 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 --- 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;