From owner-freebsd-current@FreeBSD.ORG Mon Sep 6 05:47:41 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2276716A4CE; Mon, 6 Sep 2004 05:47:41 +0000 (GMT) Received: from crumpet.united-ware.com (ddsl-66-42-172-210.fuse.net [66.42.172.210]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4071843D5C; Mon, 6 Sep 2004 05:47:40 +0000 (GMT) (envelope-from mistry.7@osu.edu) Received: from [192.168.1.102] (ddsl-66-42-172-210.fuse.net [66.42.172.210]) (authenticated bits=0)i865Y5jr023638 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO); Mon, 6 Sep 2004 01:34:06 -0400 (EDT) (envelope-from mistry.7@osu.edu) From: Anish Mistry To: Gerald Pfeifer Date: Mon, 6 Sep 2004 01:49:35 -0400 User-Agent: KMail/1.6.2 References: <47158390.20040827112834@ulstu.ru> In-Reply-To: MIME-Version: 1.0 Content-Disposition: inline Content-Type: Multipart/Mixed; boundary="Boundary-00=_vp/OBGSiJ8HFpAB" Message-Id: <200409060149.35764.mistry.7@osu.edu> X-Spam-Status: No, hits=3.0 required=5.0 tests=IN_REP_TO,RCVD_IN_ORBS,RCVD_IN_OSIRUSOFT_COM,REFERENCES, USER_AGENT_KMAIL,X_OSIRU_OPEN_RELAY version=2.55 X-Spam-Level: *** X-Spam-Checker-Version: SpamAssassin 2.55 (1.174.2.19-2003-05-19-exp) cc: Alan Cox cc: anvir@ulstu.ru cc: freebsd-current@freebsd.org Subject: Re: Wine and mmap X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Sep 2004 05:47:41 -0000 --Boundary-00=_vp/OBGSiJ8HFpAB Content-Type: multipart/signed; charset="iso-8859-1"; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="Boundary-02=_vp/OB01aRadKGPG"; name=" " Content-Transfer-Encoding: 7bit --Boundary-02=_vp/OB01aRadKGPG Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Sunday 05 September 2004 05:15 pm, Gerald Pfeifer wrote: > [ John, sorry for the duplicate message; this is the correct one. ] > > On Fri, 27 Aug 2004, John Birrell wrote: > > Anish Mistry has developed a patch to choose an > > appropriate mmap address. He posted it to -current. I haven't had time = to > > test it. > > Thanks for the note. Will you have time to test/commit this before 5.3? > > Anish, do you have any news on this patch? (Wine has been broken for a > couple of months now, and it would be great to have at least 5.3 fixed.) > Well I guess this is my lucky day. Apply the attached patch for vm_mmap to= =20 your kernel and patch the August wine sources with the wine-mmap.patch and= =20 compile and install wine (be sure to use gmake). This is working on my dev= =20 system with 6-CURRENT as of Saturday night. The wine mmap patch just doesn't reserve the DOS area so DOS programs may n= ot=20 work. This seems to just work around a side effect of the kernel mmap patc= h. I still think that the kernel mmap patch has issues so I'm hoping Alan can= =20 give us some feedback. Anyway this worked for me, YMMV. =2D-=20 Anish Mistry --Boundary-02=_vp/OB01aRadKGPG Content-Type: application/pgp-signature Content-Description: signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (FreeBSD) iD8DBQBBO/pvxqA5ziudZT0RAuEcAJ9KVTwau13wE0OiP+DoFV4t8a5p1gCghmKR OgmAA0fzj7wd6iqtezUw1gI= =VTFN -----END PGP SIGNATURE----- --Boundary-02=_vp/OB01aRadKGPG-- --Boundary-00=_vp/OBGSiJ8HFpAB Content-Type: text/x-diff; charset="iso-8859-1"; name="vm_mmap-wine-6-current.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="vm_mmap-wine-6-current.patch" --- vm_mmap.c.orig Thu Aug 5 03:04:33 2004 +++ vm_mmap.c Wed Aug 18 21:31:13 2004 @@ -208,6 +208,8 @@ vm_offset_t addr; vm_size_t size, pageoff; vm_prot_t prot, maxprot; + vm_map_t map; + void *handle; int flags, error; off_t pos; @@ -276,9 +278,26 @@ if (addr == 0 || (addr >= round_page((vm_offset_t)vms->vm_taddr) && addr < round_page((vm_offset_t)vms->vm_daddr + - lim_max(td->td_proc, RLIMIT_DATA)))) + lim_max(td->td_proc, RLIMIT_DATA)))) { + /* + * XXX So much dirtyness someone who knows what they are doing + * will want to fix this monstrosity. + */ + map = &td->td_proc->p_vmspace->vm_map; + vm_map_lock(map); addr = round_page((vm_offset_t)vms->vm_daddr + - lim_max(td->td_proc, RLIMIT_DATA)); + lim_max(td->td_proc, RLIMIT_DATA)); + if(vm_map_findspace(map, addr, size, &addr) != 0) { + /* + * since we can't grab the upper process address space bruteforce it. + */ + for(addr = 0;addr <= round_page((vm_offset_t)vms->vm_taddr) && + vm_map_findspace(map, addr, size, &addr) != 0 + ;addr += PAGE_SIZE,addr = round_page(addr)); + } + vm_map_unlock(map); + } + PROC_UNLOCK(td->td_proc); } if (flags & MAP_ANON) { --Boundary-00=_vp/OBGSiJ8HFpAB Content-Type: text/x-diff; charset="iso-8859-1"; name="wine-mmap.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="wine-mmap.patch" --- libs/wine/mmap.c.orig Mon Sep 6 01:23:40 2004 +++ libs/wine/mmap.c Mon Sep 6 01:23:46 2004 @@ -294,7 +294,7 @@ area = LIST_ENTRY( ptr, struct reserved_area, entry ); if (!area->base) return; } - reserve_dos_area(); + /*reserve_dos_area();*/ } #else /* HAVE_MMAP */ --Boundary-00=_vp/OBGSiJ8HFpAB--