qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paul Brook <paul@codesourcery.com>
To: qemu-devel@nongnu.org
Cc: Aurelien Jarno <aurelien@aurel32.net>
Subject: Re: [Qemu-devel] [PATCH][RFC] elf loader: use the virtual address
Date: Fri, 9 Jan 2009 15:38:58 -0800	[thread overview]
Message-ID: <200901091638.59346.paul@codesourcery.com> (raw)
In-Reply-To: <49677A28.5030602@aurel32.net>

> 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	other threads:[~2009-01-09 23:39 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-09 15:47 [Qemu-devel] [PATCH][RFC] elf loader: use the virtual address Aurelien Jarno
2009-01-09 15:57 ` Laurent Desnogues
2009-01-09 16:24   ` Aurelien Jarno
2009-01-09 23:38     ` Paul Brook [this message]
2009-01-10  3:45       ` Edgar E. Iglesias
2009-01-10 18:35       ` Aurelien Jarno

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=200901091638.59346.paul@codesourcery.com \
    --to=paul@codesourcery.com \
    --cc=aurelien@aurel32.net \
    --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).