From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NqqxB-0004He-NA for qemu-devel@nongnu.org; Sun, 14 Mar 2010 12:46:13 -0400 Received: from [199.232.76.173] (port=44991 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NqqxB-0004HO-Bb for qemu-devel@nongnu.org; Sun, 14 Mar 2010 12:46:13 -0400 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1Nqqx9-0006VI-Jk for qemu-devel@nongnu.org; Sun, 14 Mar 2010 12:46:13 -0400 Received: from mx20.gnu.org ([199.232.41.8]:21468) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Nqqx0-0006OD-0D for qemu-devel@nongnu.org; Sun, 14 Mar 2010 12:46:11 -0400 Received: from hall.aurel32.net ([88.191.82.174]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Nqqvm-0003Jp-6Z for qemu-devel@nongnu.org; Sun, 14 Mar 2010 12:44:46 -0400 Date: Sun, 14 Mar 2010 17:44:33 +0100 From: Aurelien Jarno Subject: Re: [Qemu-devel] [PATCH] target-mips: Fix 32 bit mode (wrong size of physical addresses) Message-ID: <20100314164433.GC2381@hall.aurel32.net> References: <1268519780-6607-1-git-send-email-weil@mail.berlios.de> <201003141346.39575.paul@codesourcery.com> <4B9D0EC3.8050706@mail.berlios.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <4B9D0EC3.8050706@mail.berlios.de> Sender: Aurelien Jarno List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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