qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH][RFC] elf loader: use the virtual address


From: Paul Brook
Subject: Re: [Qemu-devel] [PATCH][RFC] elf loader: use the virtual address
Date: Fri, 9 Jan 2009 15:38:58 -0800
User-agent: KMail/1.9.9

> For PowerPC, the kernel needs to be started with address translation
> enabled (that's even true for the firmware), and thus the kernel loaded
> at the virtual address.

This sounds wrong.

Surely we should be loading it at the paddr with translation disabled, hat's 
the whole point of having both paddr and vaddr in the ELF headers. If the ppc 
kernel isn't setting p_paddr to the load address then what is it setting it 
to?

>              /* address_offset is hack for kernel images that are
>                 linked at the wrong physical address.  */
> -            addr = ph->p_paddr + address_offset;
> +            addr = ph->p_vaddr + address_offset;

> As all the other kernels/bios I have looked have the same virtual and
> physical address, I don't think it will break other targets.

This will definitely break things. In particular bare metal applications built 
for the Luminary Micro boards (and probably any other system that uses XIP 
from flash).  I also have several non-linux OS and bootloaders that rely on 
the current elf loader behavior.
It's standard practice to use the paddr when loading an image. This si 
consistent with gdb and several boot loaders.

See also http://lists.gnu.org/archive/html/qemu-devel/2008-10/msg00864.html

Paul




reply via email to

[Prev in Thread] Current Thread [Next in Thread]