From owner-freebsd-arch@FreeBSD.ORG Fri Jun 18 00:42:16 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4BA0516A4CE for ; Fri, 18 Jun 2004 00:42:16 +0000 (GMT) Received: from freebsd3.cimlogic.com.au (adsl-20-121.swiftdsl.com.au [218.214.20.121]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7F8D943D1D for ; Fri, 18 Jun 2004 00:42:15 +0000 (GMT) (envelope-from jb@cimlogic.com.au) Received: by freebsd3.cimlogic.com.au (Postfix, from userid 102) id 451166AA57; Fri, 18 Jun 2004 10:41:59 +1000 (EST) Date: Fri, 18 Jun 2004 10:41:59 +1000 From: John Birrell To: arch@freebsd.org Message-ID: <20040618004158.GN15577@freebsd3.cimlogic.com.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.1i Subject: mmap address allocation X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jun 2004 00:42:16 -0000 The current Wine code won't run on either FreeBSD4 or -current now that they've added code that tries to snaffle (mmap) all memory in user space from 0x80000000 up. They do this because Windows 9x uses that area as a shared heap. The snaffle takes place as early as they can, before they start loading libraries like ntdll and kernel32. The FreeBSD mmap address allocation in the case where no address hint is provided, always tries to allocate memory above all existing allocations. Obviously this fails when dlopen() tries to load another shared library. There is a comment in sys/vm/vm_mmap.c:mmap that mentions "There should really be a pmap call to determine a reasonable location". What are people's thoughts about implementing such a thing (and having it do a better job of choosing an address)? -- John Birrell