From: Ian Campbell Subject: Re: [PATCH v2 1/2] xen/arm: Rework the way to compute dom0 DTB base address Date: Fri, 31 May 2013 15:14:26 +0100 Message-ID: <1370009666.5199.172.camel@zakaz.uk.xensource.com> References: <1369922720-10015-1-git-send-email-julien.grall@linaro.org> <1369922720-10015-2-git-send-email-julien.grall@linaro.org> <1370000724.5199.112.camel@zakaz.uk.xensource.com> <51A8A58E.9090501@linaro.org> <51A8A975.2000800@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <51A8A975.2000800@citrix.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: Julien Grall Cc: Julien Grall , xen-devel@lists.xen.org, patches@linaro.org, Stefano.Stabellini@eu.citrix.com List-Id: xen-devel@lists.xenproject.org On Fri, 2013-05-31 at 14:45 +0100, Julien Grall wrote: > On 05/31/2013 02:28 PM, Julien Grall wrote: > > >>> + if ( !(MAX(zimage_start, dtb_end) < MIN(zimage_end, dtb_start)) ) > >>> + return 0; > >> > >> I had to draw quite a few pictures to convince myself this was right, > >> and I'm still not entirely sure ;-) > > > > > > In fact it's totally wrong :/. What about this check? > > > > > Another mistake on the first check: > > if ( (dtb_start > zimage_end) || (dtb_end < zimage_start) ) This one looks right (third time's the charm...) Ian.