From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:46889) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S8DOI-0003m4-FE for qemu-devel@nongnu.org; Thu, 15 Mar 2012 12:19:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S8DOB-0002oW-VM for qemu-devel@nongnu.org; Thu, 15 Mar 2012 12:19:02 -0400 Received: from smtp.citrix.com ([66.165.176.89]:62500) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S8DOB-0002m7-QL for qemu-devel@nongnu.org; Thu, 15 Mar 2012 12:18:55 -0400 Message-ID: <4F621649.4030702@citrix.com> Date: Thu, 15 Mar 2012 16:18:17 +0000 From: Julien Grall MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [PATCH] xen-mapcache: don't unmap locked entry during mapcache invalidation List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "qemu-devel@nongnu.org" Cc: "xen-devel@lists.xensource.com" , Stefano Stabellini 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 --- xen-mapcache.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/xen-mapcache.c b/xen-mapcache.c index 585b559..6e7e5ab 100644 --- a/xen-mapcache.c +++ b/xen-mapcache.c @@ -370,6 +370,9 @@ void xen_invalidate_map_cache(void) continue; } + if (entry->lock > 0) + continue; + if (munmap(entry->vaddr_base, entry->size) != 0) { perror("unmap fails"); exit(-1); -- Julien Grall From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: [PATCH] xen-mapcache: don't unmap locked entry during mapcache invalidation Date: Thu, 15 Mar 2012 16:18:17 +0000 Message-ID: <4F621649.4030702@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit Return-path: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+gceq-qemu-devel=gmane.org@nongnu.org Sender: qemu-devel-bounces+gceq-qemu-devel=gmane.org@nongnu.org To: "qemu-devel@nongnu.org" Cc: "xen-devel@lists.xensource.com" , Stefano Stabellini List-Id: xen-devel@lists.xenproject.org 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 --- xen-mapcache.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/xen-mapcache.c b/xen-mapcache.c index 585b559..6e7e5ab 100644 --- a/xen-mapcache.c +++ b/xen-mapcache.c @@ -370,6 +370,9 @@ void xen_invalidate_map_cache(void) continue; } + if (entry->lock > 0) + continue; + if (munmap(entry->vaddr_base, entry->size) != 0) { perror("unmap fails"); exit(-1); -- Julien Grall