From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Jan Beulich" Subject: Re: [V6 PATCH 6.2/7] pvh dom0: Add and remove foreign pages Date: Wed, 11 Dec 2013 09:23:09 +0000 Message-ID: <52A83D0D020000780010C35C@nat28.tlf.novell.com> 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> <52A7C14C.2020504@linaro.org> <20131210174755.05e5550f@mantra.us.oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20131210174755.05e5550f@mantra.us.oracle.com> Content-Disposition: inline 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, Julien Grall , tim@xen.org, keir.xen@gmail.com List-Id: xen-devel@lists.xenproject.org >>> On 11.12.13 at 02:47, Mukesh Rathor wrote: > On Wed, 11 Dec 2013 01:35:08 +0000 > Julien Grall wrote: > >> > 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; >... > @@ -83,7 +83,8 @@ static inline struct page_info *get_page_from_gfn( > struct page_info *page; > unsigned long mfn = gmfn_to_mfn(d, gfn); > > - ASSERT(t == NULL); > + if ( t ) > + ASSERT(*t == INT_MAX); If you already don't follow Julien's suggestion, then please ASSERT(!t || *t == INT_MAX); Jan