From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IiGNW-0006a1-Ha for qemu-devel@nongnu.org; Wed, 17 Oct 2007 17:24:34 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IiGNV-0006YX-Rt for qemu-devel@nongnu.org; Wed, 17 Oct 2007 17:24:33 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IiGNV-0006YH-Au for qemu-devel@nongnu.org; Wed, 17 Oct 2007 17:24:33 -0400 Received: from bangui.magic.fr ([195.154.194.245]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1IiGNU-0007pb-Om for qemu-devel@nongnu.org; Wed, 17 Oct 2007 17:24:33 -0400 Subject: Re: [Qemu-devel] Mips target '-kernel' option bug From: "J. Mayer" In-Reply-To: References: <1192568594.9976.523.camel@rapid> <20071017135148.GZ3379@networkno.de> <1192647054.32421.41.camel@jma4.dev.netgem.com> Content-Type: text/plain Date: Wed, 17 Oct 2007 23:24:26 +0200 Message-Id: <1192656266.9976.537.camel@rapid> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Blue Swirl , ths@networkno.de Cc: qemu-devel@nongnu.org On Wed, 2007-10-17 at 22:06 +0300, Blue Swirl wrote: > On 10/17/07, Jocelyn Mayer 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 ! -- J. Mayer Never organized