From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [V6 PATCH 6.2/7] pvh dom0: Add and remove foreign pages Date: Wed, 11 Dec 2013 01:35:08 +0000 Message-ID: <52A7C14C.2020504@linaro.org> References: <1386297524-15483-1-git-send-email-mukesh.rathor@oracle.com> <1386297524-15483-7-git-send-email-mukesh.rathor@oracle.com> <20131210162753.2e402081@mantra.us.oracle.com> <20131210164442.3879f6c0@mantra.us.oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20131210164442.3879f6c0@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: Xen-devel@lists.xensource.com, Ian Campbell , george.dunlap@eu.citrix.com, tim@xen.org, keir.xen@gmail.com, JBeulich@suse.com List-Id: xen-devel@lists.xenproject.org On 12/11/2013 12:44 AM, Mukesh Rathor wrote: > Grrrr... sent too soon before compiling on arm... here's version > with arm compile fixed. thanks. > > ------------- > > In this patch, a new function, p2m_add_foreign(), is added > to map pages from foreign guest into current dom0 for domU creation. > Such pages are typed p2m_map_foreign. Another function > p2m_remove_foreign() is added to remove such pages. Note, in > the remove path, we must release the refcount that was taken during > the map phase. This is done in p2m_remove_page, which also addresses > releasing of refcnt when the domain is destroyed. > > Signed-off-by: Mukesh Rathor > --- [..] > > diff --git a/xen/include/asm-arm/p2m.h b/xen/include/asm-arm/p2m.h > index c660820..03d34e9 100644 > --- a/xen/include/asm-arm/p2m.h > +++ b/xen/include/asm-arm/p2m.h > @@ -83,7 +83,7 @@ static inline struct page_info *get_page_from_gfn( > struct page_info *page; > unsigned long mfn = gmfn_to_mfn(d, gfn); > > - ASSERT(t == NULL); > + ASSERT(*t == INT_MAX); There is various place where get_page_from_gfn where t == NULL. With this solution it will segfault every time. I would do something like that: if (*t) t = INT_MAX; -- Julien Grall