]> xenbits.xensource.com Git - qemu-upstream-4.5-testing.git/commitdiff
xen-mapcache: don't unmap locked entry during mapcache invalidation
authorJulien Grall <julien.grall@citrix.com>
Fri, 13 Apr 2012 17:33:02 +0000 (17:33 +0000)
committerStefano Stabellini <stefano.stabellini@eu.citrix.com>
Tue, 17 Apr 2012 10:12:53 +0000 (10:12 +0000)
When an IOREQ_TYPE_INVALIDATE is sent to QEMU, it invalidates all entry
of the map cache even if it's locked.

QEMU is not able to know that entry was invalidated, so when an IO
access is requested a segfault occured.

Signed-off-by: Julien Grall <julien.grall@citrix.com>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
xen-mapcache.c

index eade81632dcba6ef147a066448ab8c03c83318cc..16b7a869c6e012c8ec608c1c76dcfa8f043950fc 100644 (file)
@@ -385,6 +385,9 @@ void xen_invalidate_map_cache(void)
         if (entry->vaddr_base == NULL) {
             continue;
         }
+        if (entry->lock > 0) {
+            continue;
+        }
 
         if (munmap(entry->vaddr_base, entry->size) != 0) {
             perror("unmap fails");