All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thiemo Seufer <ths@networkno.de>
To: "J. Mayer" <l_indien@magic.fr>
Cc: Blue Swirl <blauwirbel@gmail.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] Mips target '-kernel' option bug
Date: Thu, 18 Oct 2007 00:07:53 +0100	[thread overview]
Message-ID: <20071017230753.GA27289@networkno.de> (raw)
In-Reply-To: <1192656266.9976.537.camel@rapid>

J. Mayer wrote:
> On Wed, 2007-10-17 at 22:06 +0300, Blue Swirl wrote:
> > On 10/17/07, Jocelyn Mayer <l_indien@magic.fr> wrote:
> > > On Wed, 2007-10-17 at 14:51 +0100, Thiemo Seufer wrote:
> > > > J. Mayer wrote:
> > > > > I failed to run Mips target test image on my amd64 machine and I now
> > > > > found the reason of the bug:
> > > > > the kernel loader code used in hw/mips_r4k.c and hw/mips_malta.c
> > > > > implicitelly assumes that the ram_addr_t is 32 bits long.
> > > > > Unfortunatelly, on 64 bits hosts, this won't be the case and the kernel
> > > > > load address then is over 4 GB. Then, when computing the initrd_offset,
> > > > > the code always concludes that there's not enough RAM available to load
> > > > > it at the top of the kernel.
> > > > > I found 2 ways of fixing the bug, but I don't know which one is correct
> > > > > in Mips execution environment.
> > > > > The first patch is to make the VIRT_TO_PHYS_ADDEND negative, thus
> > > > > translating the kernel virtual address from 0x8000nnnn to the physical
> > > > > one 0x0000nnnn (instead of 0x10000nnnn, when running on 64 bits hosts).
> > > > > The second solution would be to explicitelly always cast the kernel_high
> > > > > value to 32 bits.
> > > > > As I do not really know if some Mips target specific constraints would
> > > > > make one of the other solution prefered, I'd better let the specialist
> > > > > choose !
> > > > >
> > > > > The good news is that, once this issue is fixed, the Mips test images
> > > > > run with the reverse-endian softmmu patch applied.
> > > >
> > > > I think this patch is the correct fix. Please test and comment.
> > >
> > > Thanks, I'll test it at home tonight.
> > > To satisfy my curiosity, is there a specific reason to have a positive
> > > VIRT_TO_PHYS_ADDEND ?
> > 
> > On Sparc, OpenBIOS image is loaded to a physical address that is
> > higher in the address space than the virtual address:
> > #define PROM_PADDR           0xff0000000ULL
> > #define PROM_VADDR           0xffd00000
> > and
> > #define PROM_ADDR            0x1fff0000000ULL
> > #define PROM_VADDR           0x000ffd00000ULL
> 
> OK, thanks.
> And the patch seems OK for me, it may be a good idea to commit it !

Committed.


Thiemo

      reply	other threads:[~2007-10-17 23:08 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-16 21:03 [Qemu-devel] Mips target '-kernel' option bug J. Mayer
2007-10-17 13:51 ` Thiemo Seufer
2007-10-17 18:50   ` Jocelyn Mayer
2007-10-17 19:04     ` Thiemo Seufer
2007-10-17 19:06     ` Blue Swirl
2007-10-17 21:24       ` J. Mayer
2007-10-17 23:07         ` Thiemo Seufer [this message]

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=20071017230753.GA27289@networkno.de \
    --to=ths@networkno.de \
    --cc=blauwirbel@gmail.com \
    --cc=l_indien@magic.fr \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.