From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JFh3j-0007d0-85 for qemu-devel@nongnu.org; Thu, 17 Jan 2008 21:34:19 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JFh3h-0007aP-Dd for qemu-devel@nongnu.org; Thu, 17 Jan 2008 21:34:18 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JFh3h-0007aC-5A for qemu-devel@nongnu.org; Thu, 17 Jan 2008 21:34:17 -0500 Received: from nz-out-0506.google.com ([64.233.162.227]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JFh3h-0003A0-0q for qemu-devel@nongnu.org; Thu, 17 Jan 2008 21:34:17 -0500 Received: by nz-out-0506.google.com with SMTP id f1so3457856nzc.37 for ; Thu, 17 Jan 2008 18:34:16 -0800 (PST) Message-ID: Date: Fri, 18 Jan 2008 09:34:14 +0700 From: "Mulyadi Santosa" Subject: Re: [Qemu-devel] [patch] fix mmap 0.9.1 mmap regression in linux-user In-Reply-To: <20080117133009.P82491-100000@bell.csl.cornell.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20080117133009.P82491-100000@bell.csl.cornell.edu> 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 Hello.. On Jan 18, 2008 1:35 AM, Vince Weaver wrote: > Hello > > The 0.9.1 release segfaults on certain benchmarks under linux-user > emulation (x86 on x86). > > Specifically "facerec" from the SPEC2000 benchmarks, and over half of the > SPEC2006 benchmarks. > > I tracked this down to a problem in the mmap() code in linux-user. > > I've attached a patch that reverts behavior back to that from 0.9.0, which > makes the benchmarks all run for me. > > The problem is that after a large number of mmap() calls, the > mmap_find_vma() fuction sometimes completely destroys the memory map > table. I can produce debug info on this if needed. What the patch does > is make the code ignore the results of mmap_find_vma(). > > I'm not familiar enough with the qemu mmap() code to fix this properly... > > Thanks > > Vince > > --- ./qemu-0.9.1-stock/linux-user/mmap.c 2008-01-06 14:38:42.000000000 -0500 > +++ ./qemu-0.9.1/linux-user/mmap.c 2008-01-17 13:27:11.000000000 -0500 > @@ -250,8 +250,8 @@ > /* Note: we prefer to control the mapping address. It is > 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); > + p = mmap(real_start ? g2h(real_start) : NULL, > + host_len, prot, flags, fd, host_offset); urmmm, sure we need to throw out MAP_FIXED flag? sounds like from the upper "Notes", it's need to control the start address of mapped VMA..in the case of must-on-real_start. CMIIW too..just dumb static code analysis. regards, Mulyadi.