qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Aurelien Jarno <aurelien@aurel32.net>
To: Stefan Weil <weil@mail.berlios.de>
Cc: Paul Brook <paul@codesourcery.com>,
	QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH] target-mips: Fix 32 bit mode (wrong size of physical addresses)
Date: Sun, 14 Mar 2010 17:44:33 +0100	[thread overview]
Message-ID: <20100314164433.GC2381@hall.aurel32.net> (raw)
In-Reply-To: <4B9D0EC3.8050706@mail.berlios.de>

On Sun, Mar 14, 2010 at 05:28:51PM +0100, Stefan Weil wrote:
> Paul Brook schrieb:
> >> Commit 30724e758a21ba9f807efafe268626bd479db9de breaks
> >> malta (and other) mips 32 bit emulation.
> >>
> >> Fixing the physical address size for 32 bit machines
> >> makes it work again.
> >
> >> -#define TARGET_PHYS_ADDR_SPACE_BITS 36
> >> +#define TARGET_PHYS_ADDR_SPACE_BITS 32
> >
> > This is almost certainly the wrong change.
> >
> > Paul
> 
> Yes, Aurelien already said this, too, and I agree that my patch
> fixes the problem but is the wrong solution.
> 
> The wrong part seems to be loading or starting of the elf kernel image:
> the "boot loader" jumps to a memory location which is filled with
> nops (0). Either the load address of the kernel code is wrong, or
> the boot loader jumps to the wrong address.
> 
> The problem is also malta specific - mips ar7 emulation works fine.
> I did not test the other mips machines, so I cannot say whether they
> have this problem, too (maybe yes because of code copy + paste).
> 

Yes, the problem is that load_elf() only support mangling the addresses
through an addend. This is not working on MIPS as the addend would be
different depending on the type of ELF kernel (32 or 64-bit). The
correct operation for MIPS is too mangle the upper bits to do a kseg0 ->
physical translation.

I am working on a patch, will post it later today.

-- 
Aurelien Jarno	                        GPG: 1024D/F1BCDB73
aurelien@aurel32.net                 http://www.aurel32.net

      reply	other threads:[~2010-03-14 16:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-13 22:36 [Qemu-devel] [PATCH] target-mips: Fix 32 bit mode (wrong size of physical addresses) Stefan Weil
2010-03-14 13:46 ` Paul Brook
2010-03-14 16:28   ` Stefan Weil
2010-03-14 16:44     ` Aurelien Jarno [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=20100314164433.GC2381@hall.aurel32.net \
    --to=aurelien@aurel32.net \
    --cc=paul@codesourcery.com \
    --cc=qemu-devel@nongnu.org \
    --cc=weil@mail.berlios.de \
    /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).