From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tim Deegan Subject: Re: [PATCH RFC 3/7] xen: arm: make sure we stay within the memory bank during mm setup Date: Thu, 19 Sep 2013 10:27:17 +0100 Message-ID: <20130919092717.GE52431@ocelot.phlegethon.org> References: <1379381846.11304.73.camel@hastur.hellion.org.uk> <1379382050-11821-3-git-send-email-ian.campbell@citrix.com> <523848E7.6010604@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <523848E7.6010604@linaro.org> 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@citrix.com, xen-devel@lists.xen.org, Ian Campbell , stefano.stabellini@eu.citrix.com List-Id: xen-devel@lists.xenproject.org At 13:19 +0100 on 17 Sep (1379423991), Julien Grall wrote: > On 09/17/2013 02:40 AM, Ian Campbell wrote: > >Otherwise if there is a module in another bank we can run off the end. > > > >Signed-off-by: Ian Campbell > >--- > > xen/arch/arm/setup.c | 7 ++++++- > > 1 file changed, 6 insertions(+), 1 deletion(-) > > > >diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c > >index e58dbc6..94b1362 100644 > >--- a/xen/arch/arm/setup.c > >+++ b/xen/arch/arm/setup.c > >@@ -223,8 +223,10 @@ static paddr_t __init next_module(paddr_t s, paddr_t > >*n) > > continue; > > if ( mod_s > lowest ) > > continue; > >+ if ( mod_s > *n ) > > > I needed to look at the call-site to know the meaning of "n". > Can you add a comment above the function to specify that n contains the > end of the bank/RAM? +1. Also to say that the end-of-module we return is clipped if it overruns. Maybe 'n' could be renamed 'end' too? Tim.