From owner-freebsd-emulation@FreeBSD.ORG Sat Sep 16 17:10:32 2006 Return-Path: X-Original-To: emulation@freebsd.org Delivered-To: freebsd-emulation@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B944816A407; Sat, 16 Sep 2006 17:10:32 +0000 (UTC) (envelope-from saper@SYSTEM.PL) Received: from mail01.ish.de (pip250.ish.de [80.69.98.250]) by mx1.FreeBSD.org (Postfix) with ESMTP id 993F143D55; Sat, 16 Sep 2006 17:10:31 +0000 (GMT) (envelope-from saper@SYSTEM.PL) Received: from [81.210.201.87] (account saper@iesy.net HELO saperski.saper.info) by mail-fe-02.mail01.ish.de (CommuniGate Pro SMTP 5.0.6) with ESMTPSA id 67091435; Sat, 16 Sep 2006 19:10:30 +0200 Received: from [127.0.0.1] (saperski.saper.info [127.0.0.1]) by saperski.saper.info (8.13.8/8.13.8) with ESMTP id k8GHAJb3007986 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Sat, 16 Sep 2006 19:10:21 +0200 (CEST) (envelope-from saper@SYSTEM.PL) Message-ID: <450C2FFB.3050209@SYSTEM.PL> Date: Sat, 16 Sep 2006 19:10:19 +0200 From: Marcin Cieslak User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.8.0.6) Gecko/20060912 SeaMonkey/1.0.4 MIME-Version: 1.0 To: Maxim Sobolev , Marcel Moolenaar References: <450C0C0E.8060402@SYSTEM.PL> <20060916171840.5dd744b7@Magellan.Leidinger.net> <450C2A46.9010609@FreeBSD.org> In-Reply-To: <450C2A46.9010609@FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-2; format=flowed Content-Transfer-Encoding: 7bit Cc: emulation@FreeBSD.org, Alexander Leidinger , Tim Robins Subject: Re: fixing linux mmap() X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Sep 2006 17:10:32 -0000 Maxim Sobolev wrote: > Actually it's confusion on your part. This code was there since version > 1.1 and long before 1.31 (my change that touched this line): Yes, the code is very old. However things has changed in the FreeBSD mmap() in the meantime, but Linux emulator code was left as it was. I just wondered if we need this PROT_READ thing at all. amd64 code illustrates this confusion even better: /sys/amd64/linux32/linux32_machdep.c 1.1 (tjr 16-Aug-04): /* 1.1 (tjr 16-Aug-04): * XXX i386 Linux always emulator forces PROT_READ on (why?) 1.1 (tjr 16-Aug-04): * so we do the same. We add PROT_EXEC to work around buggy 1.1 (tjr 16-Aug-04): * applications (e.g. Java) that take advantage of the fact 1.1 (tjr 16-Aug-04): * that execute permissions are not enforced by x86 CPUs. 1.1 (tjr 16-Aug-04): */ 1.1 (tjr 16-Aug-04): bsd_args.prot = linux_args->prot | PROT_EXEC | PROT_READ; I *guess* adding PROT_READ is no longer necessary (at least since 1.333 version of /sys/vm/vm_map.c). PROT_EXEC also wonders me, but I lack amd64 hardware and mmap() clue to check this... -- << Marcin Cieslak // saper@system.pl >>