|
|
|
|
|
|
|
|
|
|
xen-devel
[Xen-devel] [PATCH] Linux-HVM, qemu, and xen-balloon.ko
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
|
|
|
|
|