From: Kouya Shimura Subject: [PATCH] x86/mm: disallow mmu hypercalls for a dying domain Date: Fri, 27 Nov 2009 15:22:17 +0900 Message-ID: <7kocmoxz9p.fsf@pingu.sky.yk.fujitsu.co.jp> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Q94oxY4UQL" Content-Transfer-Encoding: 7bit Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org --Q94oxY4UQL Content-Type: text/plain; charset=us-ascii Content-Description: message body text Content-Transfer-Encoding: 7bit The race condition should be avoided for efficiency. Signed-off-by: Kouya Shimura --Q94oxY4UQL Content-Type: text/x-patch Content-Disposition: inline; filename="hypercalls_for_dying_dom.patch" Content-Transfer-Encoding: 7bit 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"); --Q94oxY4UQL Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --Q94oxY4UQL--