From mboxrd@z Thu Jan 1 00:00:00 1970 From: Xiao Guangrong Subject: Re: [PATCH] cleanup for __start_xen() Date: Tue, 01 Dec 2009 09:00:26 +0800 Message-ID: <4B146AAA.40508@cn.fujitsu.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Keir Fraser Cc: "xen-devel@lists.xensource.com" , Ian Jackson List-Id: xen-devel@lists.xenproject.org Keir Fraser wrote: > On 30/11/2009 17:42, "Ian Jackson" wrote: > >> I wrote: >>> Xiao Guangrong writes ("[Xen-devel] [PATCH] cleanup for __start_xen()"): >>>> - if ( !initial_images_start && (s < e) && >>>> + if ( !initial_images_start && >>> This is wrong. s and e are uint64_t so if !(s < e), (e-s) will be >>> large and positive. >> I see this has already been applied (20523). It should be reverted, I >> think. > > None of the if() blocks in the loop will make e the block had allocated itself a chunk of memory that starts below s. So it > is actually safe to remove the checks, as we know e>=s. But now I look at it > I think I broke the module-relocation block some time ago -- it ends up with > 'e' being too large by modules_headroom. :-( Will look into that more > tomorrow... > I thinks remove this judgment is very safe, because we have judge it at the begin of this loop: for ( i = boot_e820.nr_map-1; i >= 0; i-- ) { uint64_t s, e, mask = (1UL << L2_PAGETABLE_SHIFT) - 1; if ( (boot_e820.map[i].type != E820_RAM) || (s >= e) ) /* NOTICE HERE*/ continue; /* it must s < e while run below code, not need check it again ... */ ...... } Thanks, Xiao