summary refs log tree commit diff stats
path: root/xen-mapcache.c
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2012-08-22 13:31:39 -0500
committerAnthony Liguori <aliguori@us.ibm.com>2012-08-22 13:31:39 -0500
commitb100fcfe4966aa41d4d6908d0c4c510bcf8f82dd (patch)
tree1111a1d2b34e6fb17f47f11c8c3e19c7d651d943 /xen-mapcache.c
parenta9b670b139ed381bd07df08bdfdcb515dff3ca8c (diff)
parent14d40183725361e6350166099556c7661063921b (diff)
downloadfocaccia-qemu-b100fcfe4966aa41d4d6908d0c4c510bcf8f82dd.tar.gz
focaccia-qemu-b100fcfe4966aa41d4d6908d0c4c510bcf8f82dd.zip
Merge remote-tracking branch 'sstabellini/xen-fixes-20120822' into staging
* sstabellini/xen-fixes-20120822:
  xen-all.c: fix multiply issue for int and uint types
  Fix invalidate if memory requested was not bucket aligned
Diffstat (limited to 'xen-mapcache.c')
-rw-r--r--xen-mapcache.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/xen-mapcache.c b/xen-mapcache.c
index 59ba085b62..9cd6db3d7b 100644
--- a/xen-mapcache.c
+++ b/xen-mapcache.c
@@ -320,10 +320,6 @@ void xen_invalidate_map_cache_entry(uint8_t *buffer)
     target_phys_addr_t size;
     int found = 0;
 
-    if (mapcache->last_address_vaddr == buffer) {
-        mapcache->last_address_index = -1;
-    }
-
     QTAILQ_FOREACH(reventry, &mapcache->locked_entries, next) {
         if (reventry->vaddr_req == buffer) {
             paddr_index = reventry->paddr_index;
@@ -342,6 +338,11 @@ void xen_invalidate_map_cache_entry(uint8_t *buffer)
     QTAILQ_REMOVE(&mapcache->locked_entries, reventry, next);
     g_free(reventry);
 
+    if (mapcache->last_address_index == paddr_index) {
+        mapcache->last_address_index = -1;
+        mapcache->last_address_vaddr = NULL;
+    }
+
     entry = &mapcache->entry[paddr_index % mapcache->nr_buckets];
     while (entry && (entry->paddr_index != paddr_index || entry->size != size)) {
         pentry = entry;