From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JQUG1-0007uw-Cu for qemu-devel@nongnu.org; Sat, 16 Feb 2008 16:07:37 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JQUG0-0007uk-Sw for qemu-devel@nongnu.org; Sat, 16 Feb 2008 16:07:37 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JQUG0-0007uh-O8 for qemu-devel@nongnu.org; Sat, 16 Feb 2008 16:07:36 -0500 Received: from miranda.se.axis.com ([193.13.178.8]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JQUG0-0002H9-70 for qemu-devel@nongnu.org; Sat, 16 Feb 2008 16:07:36 -0500 Received: from axis.com (edgar.se.axis.com [10.93.151.1]) by miranda.se.axis.com (8.13.4/8.13.4/Debian-3sarge3) with ESMTP id m1GL7FFq020591 for ; Sat, 16 Feb 2008 22:07:15 +0100 Date: Sat, 16 Feb 2008 22:07:15 +0100 From: "Edgar E. Iglesias" Subject: Re: [Qemu-devel] [PATCH] possible mmap regression Message-ID: <20080216210715.GD7603@edgar.se.axis.com> References: <94a0d4530802121142xd7987d7k31cd74b488882d19@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <94a0d4530802121142xd7987d7k31cd74b488882d19@mail.gmail.com> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Felipe Contreras Cc: qemu-devel@nongnu.org On Tue, Feb 12, 2008 at 09:42:15PM +0200, Felipe Contreras wrote: > Hi, > > I don't know what I'm doing but this seems to fix the weird issue I was having. > http://article.gmane.org/gmane.comp.emulators.qemu/23314 > > I've found out that this happens on linux 2.6.23, but not 2.6.24. > > Cheers. > > -- > Felipe Contreras > diff --git a/linux-user/mmap.c b/linux-user/mmap.c > index 6292826..3050ad9 100644 > --- a/linux-user/mmap.c > +++ b/linux-user/mmap.c > @@ -251,7 +251,7 @@ abi_long target_mmap(abi_ulong start, abi_ulong len, int prot, > especially important if qemu_host_page_size > > qemu_real_host_page_size */ > p = mmap(g2h(mmap_start), > - host_len, prot, flags | MAP_FIXED, fd, host_offset); > + host_len, prot, flags, fd, host_offset); > if (p == MAP_FAILED) > return -1; > /* update start so that it points to the file position at 'offset' */ Hello, Sorry, but I beleive your patch will break simulations where the targets pagesize is larger than the hosts. Would you mind trying the attach patched and let us know if it helps for you? If not, it would be great if you could provide a small test case that trigs the bug you are seeing so we can debug the problem. Best regards -- Edgar E. Iglesias Axis Communications AB diff --git a/linux-user/mmap.c b/linux-user/mmap.c index 6292826..78a8162 100644 --- a/linux-user/mmap.c +++ b/linux-user/mmap.c @@ -385,6 +385,9 @@ int target_munmap(abi_ulong start, abi_ulong len) real_end -= qemu_host_page_size; } + if (start < mmap_next_start) + mmap_next_start = start; + /* unmap what we can */ if (real_start < real_end) { ret = munmap(g2h(real_start), real_end - real_start);