From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCH V2] xen: Check if the range is valid in init_domheap_pages Date: Wed, 13 Nov 2013 14:33:42 +0000 Message-ID: <52838DC6.7060500@linaro.org> References: <1384348525-3230-1-git-send-email-julien.grall@linaro.org> <52838BFC0200007800102DBE@nat28.tlf.novell.com> <52837FD0.2030303@linaro.org> <528396C60200007800102E5B@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" 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 1VgbVr-0007oE-Go for xen-devel@lists.xenproject.org; Wed, 13 Nov 2013 14:33:47 +0000 Received: by mail-bk0-f50.google.com with SMTP id v16so382825bkz.37 for ; Wed, 13 Nov 2013 06:33:45 -0800 (PST) In-Reply-To: <528396C60200007800102E5B@nat28.tlf.novell.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: Jan Beulich Cc: Keir Fraser , ian.campbell@citrix.com, patches@linaro.org, stefano.stabellini@eu.citrix.com, tim@xen.org, xen-devel@lists.xenproject.org List-Id: xen-devel@lists.xenproject.org On 11/13/2013 02:12 PM, Jan Beulich wrote: >>>> On 13.11.13 at 14:34, Julien Grall wrote: > > I'm not following: If ps == pe and they're page aligned, then > > smfn = round_pgup(ps) >> PAGE_SHIFT; > emfn = round_pgdown(pe) >> PAGE_SHIFT; > > produces smfn == emfn. So as said earlier - emfn = smfn - 1 requires > the input to either be not page aligned, or pe < ps, both of which look > invalid to me. Right, my fault I didn't pay attention that ps and pe is non-aligned, with the same value. That will result to my previous assertion. In any case, init_domheap_pages seems to be able to handle non-aligned address. Otherwise round_pg{up,down} is not necessary. -- Julien Grall