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-devel

[Xen-devel] [PATCH] Linux-HVM, qemu, and xen-balloon.ko

To: George Dunlap <George.Dunlap@xxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] Linux-HVM, qemu, and xen-balloon.ko
From: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
Date: Mon, 15 Dec 2008 11:51:01 +0000
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Mon, 15 Dec 2008 03:51:37 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <de76405a0812120924w2203e854tdda5ceee6216367b@xxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <de76405a0812120924w2203e854tdda5ceee6216367b@xxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 2.0.0.14 (X11/20080505)
George Dunlap wrote:

> There seems to be some sort of a bug when qemu interacts with the
> balloon driver.  Stefano is trying to repro it, but I thought I'd
> share it for people to look at.



There is a bug in qemu_map_cache: if address_index == last_address_index
we don't check that there is a valid_mapping for address_offset in the
bucket.
The following patch fixes it.

Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>

---

diff -r 0ea6bd53cfb6 hw/xen_machine_fv.c
--- a/hw/xen_machine_fv.c       Thu Oct 23 10:26:02 2008 +0100
+++ b/hw/xen_machine_fv.c       Mon Dec 15 11:43:52 2008 +0000
@@ -135,10 +135,11 @@
     unsigned long address_index  = phys_addr >> MCACHE_BUCKET_SHIFT;
     unsigned long address_offset = phys_addr & (MCACHE_BUCKET_SIZE-1);
 
-    if (address_index == last_address_index)
+    entry = &mapcache_entry[address_index % nr_buckets];
+
+    if (address_index == last_address_index &&
+        test_bit(address_offset>>XC_PAGE_SHIFT, entry->valid_mapping))
         return last_address_vaddr + address_offset;
-
-    entry = &mapcache_entry[address_index % nr_buckets];
 
     if (entry->vaddr_base == NULL || entry->paddr_index != address_index ||
         !test_bit(address_offset>>XC_PAGE_SHIFT, entry->valid_mapping))


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

<Prev in Thread] Current Thread [Next in Thread>