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

[Xen-changelog] [xen-unstable] x86/PCI: fix guest_io_read() when pci_cfg_ok() denies access


  • To: xen-changelog@xxxxxxxxxxxxxxxxxxx
  • From: Xen patchbot-unstable <patchbot@xxxxxxx>
  • Date: Sat, 23 Jun 2012 05:22:18 +0000
  • Delivery-date: Sat, 23 Jun 2012 05:22:23 +0000
  • List-id: "Change log for Mercurial \(receive only\)" <xen-changelog.lists.xen.org>

# HG changeset patch
# User Jan Beulich <jbeulich@xxxxxxxx>
# Date 1340352270 -7200
# Node ID cc46bd403bc45eaedb3c615db962d59d4893a689
# Parent  513d5e196e23bcb37f2b897be31fa911ebe19aae
x86/PCI: fix guest_io_read() when pci_cfg_ok() denies access

For a multi-byte aligned read, this so far resulted in 0x00ff to be
put in the guest's register rather than 0xffff or 0xffffffff, which in
turn could confuse bus scanning functions (which, when reading vendor
and/or device IDs, expect to get back all zeroes or all ones).

As the value gets masked to the read width when merging back into the
full result, setting the initial value to all ones should not harm any
or the other cases.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
Acked-by: Keir Fraser <keir@xxxxxxx>
---


diff -r 513d5e196e23 -r cc46bd403bc4 xen/arch/x86/traps.c
--- a/xen/arch/x86/traps.c      Thu Jun 21 13:43:18 2012 +0100
+++ b/xen/arch/x86/traps.c      Fri Jun 22 10:04:30 2012 +0200
@@ -1717,7 +1717,7 @@ static uint32_t guest_io_read(
     while ( bytes != 0 )
     {
         unsigned int size = 1;
-        uint32_t sub_data = 0xff;
+        uint32_t sub_data = ~0;
 
         if ( (port == 0x42) || (port == 0x43) || (port == 0x61) )
         {

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
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®.