From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.30) id 1BHoEB-0007VU-RA for qemu-devel@nongnu.org; Sun, 25 Apr 2004 14:19:43 -0400 Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.30) id 1BHoAy-0006g9-3p for qemu-devel@nongnu.org; Sun, 25 Apr 2004 14:16:56 -0400 Received: from [62.210.158.46] (helo=teheran.magic.fr) by monty-python.gnu.org with esmtp (Exim 4.30) id 1BHoAO-00068r-Iu for qemu-devel@nongnu.org; Sun, 25 Apr 2004 14:15:48 -0400 Received: from [10.0.0.2] (ppp-181.net-555.magic.fr [62.210.255.181]) by teheran.magic.fr (8.11.6/8.11.2) with ESMTP id i3PIF6P28657 for ; Sun, 25 Apr 2004 20:15:06 +0200 (CEST) Subject: Re: [Qemu-devel] amd64 compile From: "J. Mayer" In-Reply-To: References: Content-Type: multipart/mixed; boundary="=-Y7+aXo78gSnGq2ugjLvf" Message-Id: <1082917248.14652.7.camel@rapid> Mime-Version: 1.0 Date: Sun, 25 Apr 2004 20:20:48 +0200 Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org --=-Y7+aXo78gSnGq2ugjLvf Content-Type: text/plain Content-Transfer-Encoding: 7bit On Sun, 2004-04-25 at 18:23, Martin Garton wrote: > On Sun, 25 Apr 2004, J. Mayer wrote: > > > Your patch is incorrect: > > - don't remove the -Wall: the warnings you can see are mostly bugs due > > to the fact that qemu assumes that unsigned long is 32 bits long. > > Sorry - That was for my testing. I didn't mean to include that in the > patch. Don't have to be sorry, IMHO, all tries can bring good ideas :-) > I wasn't attempting to fix those warnings/bugs yet. > > Do you think a solution to the problem on hosts where sizeof(void *) != > sizeof(int) could be best solved by macros such as pointer_to_int() and > int_to_pointer() which did whatever is appropriate for that host? > > Of course it depends how its being used, I don't know enough about the > code to tell whether its storing int values in pointers (which would be > fine and could be handled by a macro) or vice versa (which obviously > wouldnt) Fabrice pointed out that it's quite more complicated. This approach would solve the case where host_ulong is 64 bits and target_ulong is 32 bits. But we still could not be able to emulate a 64 bits machine on a 32 bits host. > > - to compile qemu usermode emulation, you need to edit the amd64.ld > > file, which is duplicated. Remove half of the file, and the link won't > > fail. Here's another patch that makes me able to launch PPC programs on my amd64 and may be able to fix usermode emulation for all 64 bits hosts. The bug was that the host mmap start address always remained the same when requested address is NULL, which makes mmap to be remapped elsewhere, above 4GB, on my machine. And another patch is there to fix use of debug flags with usermode emulation. -- J. Mayer Never organized --=-Y7+aXo78gSnGq2ugjLvf Content-Disposition: attachment; filename=mmap.c.diff Content-Type: text/x-patch; name=mmap.c.diff; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Index: linux-user/mmap.c =================================================================== RCS file: /cvsroot/qemu/qemu/linux-user/mmap.c,v retrieving revision 1.5 diff -u -d -w -B -b -d -p -r1.5 mmap.c --- linux-user/mmap.c 17 Mar 2004 23:46:04 -0000 1.5 +++ linux-user/mmap.c 25 Apr 2004 17:16:26 -0000 @@ -152,6 +152,9 @@ long target_mmap(unsigned long start, un int flags, int fd, unsigned long offset) { unsigned long ret, end, host_start, host_end, retaddr, host_offset, host_len; +#if defined(__alpha__) || defined(__sparc__) || defined(__x86_64__) + static unsigned long last_start = 0x40000000; +#endif #ifdef DEBUG_MMAP { @@ -190,8 +193,10 @@ long target_mmap(unsigned long start, un if (!(flags & MAP_FIXED)) { #if defined(__alpha__) || defined(__sparc__) || defined(__x86_64__) /* tell the kenel to search at the same place as i386 */ - if (host_start == 0) - host_start = 0x40000000; + if (host_start == 0) { + host_start = last_start; + last_start += HOST_PAGE_ALIGN(len); + } #endif if (host_page_size != real_host_page_size) { /* NOTE: this code is only for debugging with '-p' option */ --=-Y7+aXo78gSnGq2ugjLvf Content-Disposition: attachment; filename=main.c.diff Content-Type: text/x-patch; name=main.c.diff; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Index: linux-user/main.c =================================================================== RCS file: /cvsroot/qemu/qemu/linux-user/main.c,v retrieving revision 1.47 diff -u -d -w -B -b -d -p -r1.47 main.c --- linux-user/main.c 12 Apr 2004 20:39:29 -0000 1.47 +++ linux-user/main.c 25 Apr 2004 17:30:32 -0000 @@ -850,8 +845,7 @@ int main(int argc, char **argv) } else if (!strcmp(r, "d")) { int mask; CPULogItem *item; - - mask = cpu_str_to_log_mask(optarg); + mask = cpu_str_to_log_mask(argv[optind++]); if (!mask) { printf("Log items (comma separated):\n"); for(item = cpu_log_items; item->mask != 0; item++) { --=-Y7+aXo78gSnGq2ugjLvf--