WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] ioemu: pass-through: pt_bar_mapping fix

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] ioemu: pass-through: pt_bar_mapping fix
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 09 Jul 2008 09:30:11 -0700
Delivery-date: Wed, 09 Jul 2008 09:30:16 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1215596353 -3600
# Node ID 92992f188053bf52bb62297ad15b83f339403b87
# Parent  823caffa7ddf750d6f83dba3733c4f89f0510d84
ioemu: pass-through: pt_bar_mapping fix

In pt_bar_mapping function, r->addr should not be changed by invalid
value(-1). This value(-1) causes failure of mapping BAR when I/O Space
or Memory Space enable bit is updated repeatedly by native windows
driver.

This situation occurs in Windows Vista guest.

Signed-off-by: Naoki Nishiguchi <nisiguti@xxxxxxxxxxxxxx>
---
 tools/ioemu/hw/pass-through.c |   19 +++++++++++--------
 1 files changed, 11 insertions(+), 8 deletions(-)

diff -r 823caffa7ddf -r 92992f188053 tools/ioemu/hw/pass-through.c
--- a/tools/ioemu/hw/pass-through.c     Wed Jul 09 10:38:20 2008 +0100
+++ b/tools/ioemu/hw/pass-through.c     Wed Jul 09 10:39:13 2008 +0100
@@ -1519,7 +1519,7 @@ static void pt_bar_mapping(struct pt_dev
     PCIDevice *dev = (PCIDevice *)&ptdev->dev;
     PCIIORegion *r;
     struct pt_region *base = NULL;
-    uint32_t r_size = 0;
+    uint32_t r_size = 0, r_addr = -1;
     int ret = 0;
     int i;
 
@@ -1537,30 +1537,33 @@ static void pt_bar_mapping(struct pt_dev
            (base->bar_flag == PT_BAR_FLAG_UPPER))
                continue;
 
+        /* copy region address to temporary */
+        r_addr = r->addr;
+
         /* clear region address in case I/O Space or Memory Space disable */
         if (((base->bar_flag == PT_BAR_FLAG_IO) && !io_enable ) ||
             ((base->bar_flag == PT_BAR_FLAG_MEM) && !mem_enable ))
-            r->addr = -1;
+            r_addr = -1;
 
         /* prevent guest software mapping memory resource to 00000000h */
-        if ((base->bar_flag == PT_BAR_FLAG_MEM) && (r->addr == 0))
-            r->addr = -1;
+        if ((base->bar_flag == PT_BAR_FLAG_MEM) && (r_addr == 0))
+            r_addr = -1;
 
         /* align resource size (memory type only) */
         r_size = r->size;
         PT_GET_EMUL_SIZE(base->bar_flag, r_size);
 
         /* check overlapped address */
-        ret = pt_chk_bar_overlap(dev->bus, dev->devfn, r->addr, r_size);
+        ret = pt_chk_bar_overlap(dev->bus, dev->devfn, r_addr, r_size);
         if (ret > 0)
             PT_LOG("Base Address[%d] is overlapped. "
-                "[Address:%08xh][Size:%04xh]\n", i, r->addr, r_size);
+                "[Address:%08xh][Size:%04xh]\n", i, r_addr, r_size);
 
         /* check whether we need to update the mapping or not */
-        if (r->addr != ptdev->bases[i].e_physbase)
+        if (r_addr != ptdev->bases[i].e_physbase)
         {
             /* mapping BAR */
-            r->map_func((PCIDevice *)ptdev, i, r->addr, 
+            r->map_func((PCIDevice *)ptdev, i, r_addr, 
                          r_size, r->type);
         }
     }

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] ioemu: pass-through: pt_bar_mapping fix, Xen patchbot-unstable <=