WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] x86/mm: disallow mmu hypercalls for a dying domain

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] x86/mm: disallow mmu hypercalls for a dying domain
From: Kouya Shimura <kouya@xxxxxxxxxxxxxx>
Date: Fri, 27 Nov 2009 15:22:17 +0900
Delivery-date: Thu, 26 Nov 2009 22:23:06 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
The race condition should be avoided for efficiency.

Signed-off-by: Kouya Shimura <kouya@xxxxxxxxxxxxxx>

diff -r ba68bb0d229c xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c Thu Nov 26 15:27:00 2009 +0000
+++ b/xen/arch/x86/mm.c Fri Nov 27 15:08:41 2009 +0900
@@ -2537,6 +2537,13 @@ static struct domain *get_pg_owner(domid
             MEM_LOG("Unknown domain '%u'", domid);
             break;
         }
+        if ( unlikely(pg_owner->is_dying) )
+        {
+            MEM_LOG("Domain is dying");
+            rcu_unlock_domain(pg_owner);
+            pg_owner = NULL;
+            break;
+        }
         if ( !IS_PRIV_FOR(curr, pg_owner) )
         {
             MEM_LOG("Cannot set foreign dom");
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>