qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] target-mips: Fix 32 bit mode (wrong size of physical addresses)
@ 2010-03-13 22:36 Stefan Weil
  2010-03-14 13:46 ` Paul Brook
  0 siblings, 1 reply; 4+ messages in thread
From: Stefan Weil @ 2010-03-13 22:36 UTC (permalink / raw)
  To: QEMU Developers; +Cc: aurelien

Commit 30724e758a21ba9f807efafe268626bd479db9de breaks
malta (and other) mips 32 bit emulation.

Fixing the physical address size for 32 bit machines
makes it work again.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
---
 target-mips/mips-defs.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/target-mips/mips-defs.h b/target-mips/mips-defs.h
index c57de02..dc1ac80 100644
--- a/target-mips/mips-defs.h
+++ b/target-mips/mips-defs.h
@@ -14,7 +14,7 @@
 #define TARGET_VIRT_ADDR_SPACE_BITS 42
 #else
 #define TARGET_LONG_BITS 32
-#define TARGET_PHYS_ADDR_SPACE_BITS 36
+#define TARGET_PHYS_ADDR_SPACE_BITS 32
 #define TARGET_VIRT_ADDR_SPACE_BITS 32
 #endif
 
-- 
1.7.0

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] target-mips: Fix 32 bit mode (wrong size of physical addresses)
  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
  0 siblings, 1 reply; 4+ messages in thread
From: Paul Brook @ 2010-03-14 13:46 UTC (permalink / raw)
  To: qemu-devel; +Cc: "Developers <qemu-devel", aurelien, QEMU

> 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] target-mips: Fix 32 bit mode (wrong size of physical addresses)
  2010-03-14 13:46 ` Paul Brook
@ 2010-03-14 16:28   ` Stefan Weil
  2010-03-14 16:44     ` Aurelien Jarno
  0 siblings, 1 reply; 4+ messages in thread
From: Stefan Weil @ 2010-03-14 16:28 UTC (permalink / raw)
  To: Paul Brook; +Cc: QEMU Developers, aurelien

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).

Regards,
Stefan

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] target-mips: Fix 32 bit mode (wrong size of physical addresses)
  2010-03-14 16:28   ` Stefan Weil
@ 2010-03-14 16:44     ` Aurelien Jarno
  0 siblings, 0 replies; 4+ messages in thread
From: Aurelien Jarno @ 2010-03-14 16:44 UTC (permalink / raw)
  To: Stefan Weil; +Cc: Paul Brook, QEMU Developers

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-03-14 16:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 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).