[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] ioemu, passthrough: fix corrupting register value in pt_pci_write_config().



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1217580853 -3600
# Node ID 6692c3646914ee73c5d3e1792f4040c22b039a6e
# Parent  f5bb024f913572a460b2d350a30c224bb61d118e
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@xxxxxxxxxxxxxxx>
---
 tools/ioemu/hw/pass-through.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletion(-)

diff -r f5bb024f9135 -r 6692c3646914 tools/ioemu/hw/pass-through.c
--- a/tools/ioemu/hw/pass-through.c     Fri Aug 01 09:53:05 2008 +0100
+++ b/tools/ioemu/hw/pass-through.c     Fri Aug 01 09:54:13 2008 +0100
@@ -1101,7 +1101,8 @@ static void pt_pci_write_config(PCIDevic
     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-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.