From: "Edgar E. Iglesias" <edgar.iglesias@axis.com>
To: Alexander Graf <agraf@suse.de>
Cc: "Edgar E. Iglesias" <edgar@axis.com>,
qemu-devel@nongnu.org, aurelien@aurel32.net
Subject: Re: [Qemu-devel] [PATCH] Always load PowerPC kernel to KERNEL_LOAD_ADDR
Date: Sun, 25 Jan 2009 15:36:00 +0100 [thread overview]
Message-ID: <20090125143600.GC12918@edgar.se.axis.com> (raw)
In-Reply-To: <7D365503-8C3E-40DB-ACB3-F32E8CF2A9CC@suse.de>
On Sun, Jan 25, 2009 at 03:22:25PM +0100, Alexander Graf wrote:
>
> On 25.01.2009, at 15:19, Edgar E. Iglesias wrote:
>
>> On Sun, Jan 25, 2009 at 12:54:27PM +0100, Alexander Graf wrote:
>>> 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 <agraf@suse.de>
>>> ---
>>> 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);
>>
>> Hello,
>>
>> Can't you speculatively load at kernel_base assuming it's a new kernel,
>> then only if lowaddr indicates it was an old kernel you do the second
>> load to fix things up?
>
> Hm - so we only call load_elf once for new kernels? Sounds like a good idea
> :-).
Yes, if it works :)
Cheers
next prev parent reply other threads:[~2009-01-25 14:36 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-25 11:54 [Qemu-devel] [PATCH] Always load PowerPC kernel to KERNEL_LOAD_ADDR Alexander Graf
2009-01-25 14:19 ` Edgar E. Iglesias
2009-01-25 14:22 ` Alexander Graf
2009-01-25 14:36 ` Edgar E. Iglesias [this message]
2009-01-26 10:22 ` Aurelien Jarno
2009-01-26 10:28 ` Alexander Graf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090125143600.GC12918@edgar.se.axis.com \
--to=edgar.iglesias@axis.com \
--cc=agraf@suse.de \
--cc=aurelien@aurel32.net \
--cc=edgar@axis.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).