Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LR3ZR-0001R5-3g for qemu-devel@nongnu.org; Sun, 25 Jan 2009 06:54:33 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LR3ZP-0001Qs-8E for qemu-devel@nongnu.org; Sun, 25 Jan 2009 06:54:32 -0500 Received: from [199.232.76.173] (port=50760 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LR3ZP-0001Qp-3F for qemu-devel@nongnu.org; Sun, 25 Jan 2009 06:54:31 -0500 Received: from mx2.suse.de ([195.135.220.15]:38494) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LR3ZO-0006ya-JL for qemu-devel@nongnu.org; Sun, 25 Jan 2009 06:54:30 -0500 From: Alexander Graf Date: Sun, 25 Jan 2009 12:54:27 +0100 Message-Id: <1232884467-6136-1-git-send-email-agraf@suse.de> Subject: [Qemu-devel] [PATCH] Always load PowerPC kernel to KERNEL_LOAD_ADDR Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: aurelien@aurel32.net Linux changed its physical address location in the elf header from 0xc0000000 to 0 on 2.6.25, causing later kernels to fail booting with the -kernel option. This patch assures that the lowest segment in the elf binary is loaded to KERNEL_LOAD_ADDR, which is where the firmware expects it. With this patch applied, I was able to successfully boot a 2.6.18 and a 2.6.27 Linux kernel using the -kernel option. Signed-off-by: Alexander Graf --- hw/ppc_oldworld.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/hw/ppc_oldworld.c b/hw/ppc_oldworld.c index 042a40f..f64884b 100644 --- a/hw/ppc_oldworld.c +++ b/hw/ppc_oldworld.c @@ -207,9 +207,11 @@ static void ppc_heathrow_init (ram_addr_t ram_size, int vga_ram_size, } if (linux_boot) { + uint64_t lowaddr = 0; kernel_base = KERNEL_LOAD_ADDR; /* now we can load the kernel */ - kernel_size = load_elf(kernel_filename, kernel_base - 0xc0000000ULL, + load_elf(kernel_filename, 0, NULL, &lowaddr, NULL); + kernel_size = load_elf(kernel_filename, kernel_base - lowaddr, NULL, NULL, NULL); if (kernel_size < 0) kernel_size = load_aout(kernel_filename, kernel_base, -- 1.6.0.2