From: Keir Fraser Subject: Re: [PATCH] e820: fix clip_to_limit() Date: Tue, 10 Nov 2009 08:39:39 +0000 Message-ID: References: <4AF92217.7060207@cn.fujitsu.com> Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <4AF92217.7060207@cn.fujitsu.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Xiao Guangrong Cc: xen-devel , Xiao Guangrong List-Id: xen-devel@lists.xenproject.org On 10/11/2009 08:19, "Xiao Guangrong" wrote: >> Firstly, your 'break' was not inside that if-else block; it was right at the >> end of the for loop. Secondly, just because we found one RAM region entirely >> beyond the end of the clip boundary, does not mean there isn't another. We >> can't just bail -- we have to iterate all the way to the end of the e820 >> map. >> > > I think that sanitize_e820_map() can sort e820 items from low address > to high address, so, if we meet one e820 item beyond the end of the clip > boundary, subsequent items also beyond it. > > Maybe I misunderstand sanitize_e820_map()? I'll reread it :-) No, you understand it. And if we meet one e820 item beyond the end of the clip boundary, all subsequent items are also beyond it. But that doesn't mean we shouldn't handle them -- in fact we must handle them, as one of them could be E820_RAM. Right? -- Keir