From: kurt Date: Fri, 22 Aug 2008 10:41:37 +0000 (+0000) Subject: Set PIE address range to avoid or minimize mmap pressure due to limited X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=31af9a2463853add7cc1334102c1240706ce23e5;p=openbsd Set PIE address range to avoid or minimize mmap pressure due to limited address space. The space between PAGE_SIZE and the non-pie fixed link address creates no mmap pressure so use that space for PIE. However on hppa the non-pie fixed link address is PAGE_SIZE so just use a small range for PIE to minimize mmap pressure. okay miod@ --- diff --git a/sys/arch/hppa/include/vmparam.h b/sys/arch/hppa/include/vmparam.h index 6e3657028f8..6519c8601aa 100644 --- a/sys/arch/hppa/include/vmparam.h +++ b/sys/arch/hppa/include/vmparam.h @@ -1,4 +1,4 @@ -/* $OpenBSD: vmparam.h,v 1.33 2006/06/04 17:21:24 miod Exp $ */ +/* $OpenBSD: vmparam.h,v 1.34 2008/08/22 10:41:37 kurt Exp $ */ /* * Copyright (c) 1988-1994, The University of Utah and @@ -77,6 +77,10 @@ #define VM_MIN_KERNEL_ADDRESS ((vaddr_t)0xc0001000) #define VM_MAX_KERNEL_ADDRESS ((vaddr_t)0xef000000) +/* use a small range for PIE to minimize mmap pressure */ +#define VM_PIE_MIN_ADDR PAGE_SIZE +#define VM_PIE_MAX_ADDR 0x40000UL + /* virtual sizes (bytes) for various kernel submaps */ #define VM_PHYS_SIZE (USRIOSIZE*PAGE_SIZE) diff --git a/sys/arch/mips64/include/vmparam.h b/sys/arch/mips64/include/vmparam.h index 354421b5b16..17f75734fc8 100644 --- a/sys/arch/mips64/include/vmparam.h +++ b/sys/arch/mips64/include/vmparam.h @@ -1,4 +1,4 @@ -/* $OpenBSD: vmparam.h,v 1.15 2008/07/25 21:25:25 miod Exp $ */ +/* $OpenBSD: vmparam.h,v 1.16 2008/08/22 10:41:37 kurt Exp $ */ /* $NetBSD: vmparam.h,v 1.5 1994/10/26 21:10:10 cgd Exp $ */ /* @@ -101,6 +101,10 @@ #define VM_MIN_KERNEL_ADDRESS ((vaddr_t)0xffffffffc0000000L) #define VM_MAX_KERNEL_ADDRESS ((vaddr_t)0xfffffffffffff000L) +/* map PIE below 256MB (non-pie link address) to avoid mmap pressure */ +#define VM_PIE_MIN_ADDR PAGE_SIZE +#define VM_PIE_MAX_ADDR 0x10000000UL + #ifndef VM_NFREELIST #define VM_NFREELIST 1 #endif diff --git a/sys/arch/sh/include/vmparam.h b/sys/arch/sh/include/vmparam.h index 5934b9edac3..bdc7fa5990c 100644 --- a/sys/arch/sh/include/vmparam.h +++ b/sys/arch/sh/include/vmparam.h @@ -1,4 +1,4 @@ -/* $OpenBSD: vmparam.h,v 1.6 2008/06/26 05:42:13 ray Exp $ */ +/* $OpenBSD: vmparam.h,v 1.7 2008/08/22 10:41:37 kurt Exp $ */ /* $NetBSD: vmparam.h,v 1.17 2006/03/04 01:55:03 uwe Exp $ */ /*- @@ -41,6 +41,10 @@ #define VM_MIN_KERNEL_ADDRESS ((vaddr_t)0xc0000000) #define VM_MAX_KERNEL_ADDRESS ((vaddr_t)0xe0000000) +/* map PIE below 4MB (non-pie link address) to avoid mmap pressure */ +#define VM_PIE_MIN_ADDR PAGE_SIZE +#define VM_PIE_MAX_ADDR 0x400000UL + /* top of stack */ #define USRSTACK VM_MAXUSER_ADDRESS