From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Tue, 14 Oct 2008 12:57:53 +1100 From: David Gibson To: Sebastian Andrzej Siewior Subject: Re: [PATCH] powerpc/boot: compare _start against ei.loadsize instead ei.memsize Message-ID: <20081014015753.GD20620@yookeroo.seuss> References: <20080923203857.GB10935@www.tglx.de> <200809240146.m8O1kIpZ077447@sullivan.realtime.net> <20080925214357.GA2929@www.tglx.de> <1223611088.8157.144.camel@pasglop> <20081013091526.GA9925@www.tglx.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: <20081013091526.GA9925@www.tglx.de> Cc: Milton Miller , linuxppc-dev@ozlabs.org List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Mon, Oct 13, 2008 at 11:15:26AM +0200, Sebastian Andrzej Siewior wrote: > If the vmlinux binary in memory is larger than 4 MiB than it collides > with the initial boot code which is linked at 4 MiB in case of cuBoot. > If the the uncompressed image size (on disk size) is less than 4 MiB > then it would fit. The difference between those two sizes is the bss > section. In cuBoot we have the dtb embedded right after the data > section so it is very likely that the reset of the bss section (in > kernel's start up code) will overwrite the dtb blob. Therefore we > reallocate the dtb. Something similar is allready done to the initrd. > > Signed-off-by: Sebastian Andrzej Siewior This patch looks sound to me. It does strike me as only a stopgap until we come up with some better way of managing the early memory, preferably avoiding the magical fixed 4MiB (or whatever) offset. Still, it looks safe - since it does check that the wrapper's malloc() region can't collide with the kernel's BSS. So, if this little slice of extra BSS room is useful for the time being, I see no reason not to apply the patch. Acked-by: David Gibson -- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson