From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tim Deegan Subject: Re: [V10 PATCH 3/4] pvh dom0: Add and remove foreign pages Date: Thu, 8 May 2014 14:16:50 +0200 Message-ID: <20140508121650.GE17960@deinos.phlegethon.org> References: <1398820008-9005-1-git-send-email-mukesh.rathor@oracle.com> <1398820008-9005-4-git-send-email-mukesh.rathor@oracle.com> <20140501161908.GI86038@deinos.phlegethon.org> <20140501184518.2ebccdb8@mantra.us.oracle.com> <20140502085555.GA64491@deinos.phlegethon.org> <20140502163556.32baa414@mantra.us.oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WiNFy-0007bR-Uj for xen-devel@lists.xenproject.org; Thu, 08 May 2014 12:16:59 +0000 Content-Disposition: inline In-Reply-To: <20140502163556.32baa414@mantra.us.oracle.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Mukesh Rathor Cc: JBeulich@suse.com, George.Dunlap@eu.citrix.com, eddie.dong@intel.com, keir.xen@gmail.com, jun.nakajima@intel.com, xen-devel@lists.xenproject.org List-Id: xen-devel@lists.xenproject.org At 16:35 -0700 on 02 May (1399044956), Mukesh Rathor wrote: > > Oh yes -- sorry, I got confused between this and the case where you do > > use get_pg_owner(). But actually on this subject ISTR objecting to > > exporting get_pg_owner() from mm.c before. Oh yes, here it is: > > > > http://lists.xenproject.org/archives/html/xen-devel/2014-01/msg02612.html > > > > So can you use rcu_lock_live_remote_domain_by_id() here instead? > > > In p2m_add_foreign() we already get the rcu lock, still do it here? I don't know what you mean by that. p2m_add_foreign() currently implicitly takes the rcu lock by calling get_pg_owner(); I was suggecting that you use rcu_lock_live_remote_domain_by_id() instead. > And, btw, that function, p2m_add_foreign(), went from > > + if ( (fdid == DOMID_XEN && (fdom = rcu_lock_domain(dom_xen)) == NULL) || > + (fdid != DOMID_XEN && (fdom = rcu_lock_domain_by_id(fdid)) == NULL) ) > + goto out; > > to > > + fdom = get_pg_owner(foreigndom); > > (causing get_pg_owner to be exported) at Jan's comment/suggestion in v8. Unless Jan particularly wants to defend that, please don't export get_pg_owner(). As I said in the link above it doesn't do what you want anyway (e.g around DOMID_IO). Tim.