From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mukesh Rathor Subject: Re: [PATCH 14/18 V2]: PVH xen: add xenmem_add_foreign_to_pmap() Date: Mon, 8 Apr 2013 18:58:15 -0700 Message-ID: <20130408185815.02f1a18c@mantra.us.oracle.com> References: <20130315175831.2d2c39ba@mantra.us.oracle.com> <20130321174146.GQ12338@ocelot.phlegethon.org> <20130408171758.006e8761@mantra.us.oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20130408171758.006e8761@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: Tim Deegan Cc: "Xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org On Mon, 8 Apr 2013 17:17:58 -0700 Mukesh Rathor wrote: > On Thu, 21 Mar 2013 17:41:46 +0000 > Tim Deegan wrote: > > > > diff --git a/xen/common/memory.c b/xen/common/memory.c > > > index 68501d1..91a56b6 100644 > > > > Actually, looking at this again, I can't find reason why I can't just > change get_page_from_gfn_p2m() to return page for foreign also: > > if ( likely(!p2m_locked_by_me(p2m)) ) > { > /* Fast path: look up and get out */ > p2m_read_lock(p2m); > mfn = __get_gfn_type_access(p2m, gfn, t, a, 0, NULL, 0); > if ( (p2m_is_ram(*t) || p2m_is_grant(*t) || > p2m_is_foreign(*t)) <==== && mfn_valid(mfn) > && !((q & P2M_UNSHARE) && p2m_is_shared(*t)) ) > { > page = mfn_to_page(mfn); > if ( !get_page(page, d) > /* Page could be shared */ > && !get_page(page, dom_cow) ) > page = NULL; > } > ...... Nah, get_page() barfs on me because the mfn owner is foreign domain. Sigh... any suggestion? May be for now, I can just leave get_page_from_gfn_p2m() as is, and put my change back in XENMEM_remove_from_physmap where it checks for p2m_is_foreign. thanks, Mukesh