Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LQqMu-0008Cz-EM for qemu-devel@nongnu.org; Sat, 24 Jan 2009 16:48:44 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LQqMs-0008Cn-S9 for qemu-devel@nongnu.org; Sat, 24 Jan 2009 16:48:44 -0500 Received: from [199.232.76.173] (port=33680 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LQqMs-0008Ck-Nk for qemu-devel@nongnu.org; Sat, 24 Jan 2009 16:48:42 -0500 Received: from hall.aurel32.net ([88.191.82.174]:54325) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LQqMs-0005Wx-9T for qemu-devel@nongnu.org; Sat, 24 Jan 2009 16:48:42 -0500 Date: Sat, 24 Jan 2009 22:48:40 +0100 From: Aurelien Jarno Subject: Re: [Qemu-devel] [PATCH] Fix -kernel on target-ppc Message-ID: <20090124214840.GG19498@hall.aurel32.net> References: <1232830715-20476-1-git-send-email-agraf@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <1232830715-20476-1-git-send-email-agraf@suse.de> Sender: Aurelien Jarno Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexander Graf Cc: qemu-devel@nongnu.org On Sat, Jan 24, 2009 at 09:58:35PM +0100, Alexander Graf wrote: > OpenBIOS searches for the preloaded kernel at 0x1000000, so let's > put it there instead of an invalid location. Your patch is actually wrong, the second argument of load_elf() is an offset to the physical address (as found in the elf header), and not a load address. By chance the physical address of a >= 2.6.25 kernel is 0x00000000, so your patch works. But it will break supports for < 2.6.25 kernel as their physical address is 0xc0000000. Not that they are only the default values, they can be changed in the .config file. I have already proposed a patch to use the virtual address of the elf header as done by yaboot or quik, but I have been told it is actually wrong. We have to find another way to load the elf file at a fixed address. > Using this patch I was able to use -kernel for a current openSUSE > 11.1 kernel. > > Signed-off-by: Alexander Graf > --- > hw/ppc_oldworld.c | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/hw/ppc_oldworld.c b/hw/ppc_oldworld.c > index 042a40f..0af2436 100644 > --- a/hw/ppc_oldworld.c > +++ b/hw/ppc_oldworld.c > @@ -209,7 +209,7 @@ static void ppc_heathrow_init (ram_addr_t ram_size, int vga_ram_size, > if (linux_boot) { > kernel_base = KERNEL_LOAD_ADDR; > /* now we can load the kernel */ > - kernel_size = load_elf(kernel_filename, kernel_base - 0xc0000000ULL, > + kernel_size = load_elf(kernel_filename, KERNEL_LOAD_ADDR, > NULL, NULL, NULL); > if (kernel_size < 0) > kernel_size = load_aout(kernel_filename, kernel_base, > -- > 1.6.0.2 > > > > -- Aurelien Jarno GPG: 1024D/F1BCDB73 aurelien@aurel32.net http://www.aurel32.net