From: Julien Grall Date: Fri, 13 Apr 2012 17:33:02 +0000 (+0000) Subject: xen-mapcache: don't unmap locked entry during mapcache invalidation X-Git-Tag: qemu-xen-4.2.0~24 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=a74b7770924e3825e2d64b85fbf2f927419e513f;p=qemu-upstream-4.2-testing.git xen-mapcache: don't unmap locked entry during mapcache invalidation 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 Signed-off-by: Stefano Stabellini --- diff --git a/xen-mapcache.c b/xen-mapcache.c index eade81632..16b7a869c 100644 --- a/xen-mapcache.c +++ b/xen-mapcache.c @@ -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");