From: Mukesh Rathor Subject: Re: [V7 PATCH 5/7] pvh: change xsm_add_to_physmap Date: Thu, 20 Feb 2014 17:22:34 -0800 Message-ID: <20140220172234.7b6847ad@mantra.us.oracle.com> References: <1387247911-28846-1-git-send-email-mukesh.rathor@oracle.com> <1387247911-28846-6-git-send-email-mukesh.rathor@oracle.com> <52FBA5BA.4020301@linaro.org> <20140219182227.6a37a33c@mantra.us.oracle.com> <53060806.7040903@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <53060806.7040903@linaro.org> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Julien Grall Cc: Xen-devel@lists.xensource.com, Ian Campbell , george.dunlap@eu.citrix.com, tim@xen.org, keir.xen@gmail.com, Jan Beulich , dgdegra@tycho.nsa.gov List-Id: xen-devel@lists.xenproject.org On Thu, 20 Feb 2014 13:49:58 +0000 Julien Grall wrote: > On 02/20/2014 02:22 AM, Mukesh Rathor wrote: > > On Wed, 12 Feb 2014 16:47:54 +0000 > > Julien Grall wrote: > > > >> Hi Mukesh, > >> > >> On 12/17/2013 02:38 AM, Mukesh Rathor wrote: > >>> In preparation for the next patch, we update xsm_add_to_physmap to > >>> allow for checking of foreign domain. Thus, the current domain > >>> must have the right to update the mappings of target domain with > >>> pages from foreign domain. > >>> > >>> Signed-off-by: Mukesh Rathor > >> > >> While I was playing with XSM on ARM, I have noticed that Daniel De > >> Graff has added xsm_map_gfmn_foreign few months ago (see commit > >> 0b201e6). > >> > >> Would it be suitable to use this XSM instead of extending > >> xsm_add_to_physmap? > >> > >> Regards, > >> > > > > Not the same thing. add to physmap could be adding to a domain's > > physmap pages from a foreign domain. > > Let assume you don't modify xsm_add_to_physmap, in this case: > - xsm_add_to_physmap checks if the current domain is allowed to > modify the p2m of a given domain > - xsm_map_gfmn_foreign checks if the given domain is allowed to > have foreign mapping from the foreign domain > > Both XSM are distinct and should be used together. You don't care that I see, i thought you meant replace one with another. I am not a security expert, so just followed the suggestions. But looking at the code looks like above is the way to go, and I can just drop my xsm_add_to_physmap change patch (which btw doesn't check whether target has access to foreign mappings, so is prob not correct). Thanks for noticing. Mukesh