From owner-svn-src-head@FreeBSD.ORG Sat Oct 18 12:28:52 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 984091C5; Sat, 18 Oct 2014 12:28:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8451099C; Sat, 18 Oct 2014 12:28:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s9ICSqwI013713; Sat, 18 Oct 2014 12:28:52 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9ICSpak013706; Sat, 18 Oct 2014 12:28:51 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201410181228.s9ICSpak013706@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sat, 18 Oct 2014 12:28:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273250 - in head: sys/sys sys/vm usr.bin/truss X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Oct 2014 12:28:52 -0000 Author: jhb Date: Sat Oct 18 12:28:51 2014 New Revision: 273250 URL: https://svnweb.freebsd.org/changeset/base/273250 Log: Retire the unimplemented MAP_RENAME and MAP_NORESERVE flags to mmap(2). Older binaries are still permitted to use these flags. PR: 193961 (exp-run in ports) Differential Revision: https://reviews.freebsd.org/D848 Reviewed by: kib Modified: head/sys/sys/mman.h head/sys/sys/param.h head/sys/vm/vm_mmap.c head/usr.bin/truss/syscalls.c Modified: head/sys/sys/mman.h ============================================================================== --- head/sys/sys/mman.h Sat Oct 18 08:07:17 2014 (r273249) +++ head/sys/sys/mman.h Sat Oct 18 12:28:51 2014 (r273250) @@ -69,8 +69,8 @@ #define MAP_FIXED 0x0010 /* map addr must be exactly as requested */ #if __BSD_VISIBLE -#define MAP_RENAME 0x0020 /* Sun: rename private pages to file */ -#define MAP_NORESERVE 0x0040 /* Sun: don't reserve needed swap area */ +#define MAP_RESERVED0020 0x0020 /* previously unimplemented MAP_RENAME */ +#define MAP_RESERVED0040 0x0040 /* previously unimplemented MAP_NORESERVE */ #define MAP_RESERVED0080 0x0080 /* previously misimplemented MAP_INHERIT */ #define MAP_RESERVED0100 0x0100 /* previously unimplemented MAP_NOEXTEND */ #define MAP_HASSEMAPHORE 0x0200 /* region may contain semaphores */ Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Sat Oct 18 08:07:17 2014 (r273249) +++ head/sys/sys/param.h Sat Oct 18 12:28:51 2014 (r273250) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1100038 /* Master, propagated to newvers */ +#define __FreeBSD_version 1100039 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, @@ -81,6 +81,7 @@ #define P_OSREL_SIGSEGV 700004 #define P_OSREL_MAP_ANON 800104 #define P_OSREL_MAP_FSTRICT 1100036 +#define P_OSREL_MAP_RENAME 1100039 #define P_OSREL_MAJOR(x) ((x) / 100000) #endif Modified: head/sys/vm/vm_mmap.c ============================================================================== --- head/sys/vm/vm_mmap.c Sat Oct 18 08:07:17 2014 (r273249) +++ head/sys/vm/vm_mmap.c Sat Oct 18 12:28:51 2014 (r273250) @@ -220,6 +220,12 @@ sys_mmap(td, uap) fp = NULL; /* + * Ignore old flags that used to be defined but did not do anything. + */ + if (td->td_proc->p_osrel < P_OSREL_MAP_RENAME) + flags &= ~(MAP_RESERVED0020 | MAP_RESERVED0040); + + /* * Enforce the constraints. * Mapping of length 0 is only allowed for old binaries. * Anonymous mapping shall specify -1 as filedescriptor and @@ -244,9 +250,9 @@ sys_mmap(td, uap) flags |= MAP_ANON; pos = 0; } - if ((flags & ~(MAP_SHARED | MAP_PRIVATE | MAP_FIXED | MAP_RENAME | - MAP_NORESERVE | MAP_HASSEMAPHORE | MAP_STACK | MAP_NOSYNC | - MAP_ANON | MAP_EXCL | MAP_NOCORE | MAP_PREFAULT_READ | + if ((flags & ~(MAP_SHARED | MAP_PRIVATE | MAP_FIXED | MAP_HASSEMAPHORE | + MAP_STACK | MAP_NOSYNC | MAP_ANON | MAP_EXCL | MAP_NOCORE | + MAP_PREFAULT_READ | #ifdef MAP_32BIT MAP_32BIT | #endif Modified: head/usr.bin/truss/syscalls.c ============================================================================== --- head/usr.bin/truss/syscalls.c Sat Oct 18 08:07:17 2014 (r273249) +++ head/usr.bin/truss/syscalls.c Sat Oct 18 12:28:51 2014 (r273250) @@ -312,8 +312,8 @@ static struct xlat poll_flags[] = { }; static struct xlat mmap_flags[] = { - X(MAP_SHARED) X(MAP_PRIVATE) X(MAP_FIXED) X(MAP_RENAME) - X(MAP_NORESERVE) X(MAP_RESERVED0080) X(MAP_RESERVED0100) + X(MAP_SHARED) X(MAP_PRIVATE) X(MAP_FIXED) X(MAP_RESERVED0020) + X(MAP_RESERVED0040) X(MAP_RESERVED0080) X(MAP_RESERVED0100) X(MAP_HASSEMAPHORE) X(MAP_STACK) X(MAP_NOSYNC) X(MAP_ANON) X(MAP_NOCORE) X(MAP_PREFAULT_READ) #ifdef MAP_32BIT