a6c19dfe39
The core mm code will provide a default gate area based on FIXADDR_USER_START and FIXADDR_USER_END if !defined(__HAVE_ARCH_GATE_AREA) && defined(AT_SYSINFO_EHDR). This default is only useful for ia64. arm64, ppc, s390, sh, tile, 64-bit UML, and x86_32 have their own code just to disable it. arm, 32-bit UML, and x86_64 have gate areas, but they have their own implementations. This gets rid of the default and moves the code into ia64. This should save some code on architectures without a gate area: it's now possible to inline the gate_area functions in the default case. Signed-off-by: Andy Lutomirski <luto@amacapital.net> Acked-by: Nathan Lynch <nathan_lynch@mentor.com> Acked-by: H. Peter Anvin <hpa@linux.intel.com> Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> [in principle] Acked-by: Richard Weinberger <richard@nod.at> [for um] Acked-by: Will Deacon <will.deacon@arm.com> [for arm64] Cc: Catalin Marinas <catalin.marinas@arm.com> Cc: Will Deacon <will.deacon@arm.com> Cc: Tony Luck <tony.luck@intel.com> Cc: Fenghua Yu <fenghua.yu@intel.com> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Martin Schwidefsky <schwidefsky@de.ibm.com> Cc: Heiko Carstens <heiko.carstens@de.ibm.com> Cc: Chris Metcalf <cmetcalf@tilera.com> Cc: Jeff Dike <jdike@addtoit.com> Cc: Richard Weinberger <richard@nod.at> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Ingo Molnar <mingo@redhat.com> Cc: "H. Peter Anvin" <hpa@zytor.com> Cc: Nathan Lynch <Nathan_Lynch@mentor.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
76 lines
2.3 KiB
C
76 lines
2.3 KiB
C
/*
|
|
* Based on arch/arm/include/asm/page.h
|
|
*
|
|
* Copyright (C) 1995-2003 Russell King
|
|
* Copyright (C) 2012 ARM Ltd.
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License version 2 as
|
|
* published by the Free Software Foundation.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
*/
|
|
#ifndef __ASM_PAGE_H
|
|
#define __ASM_PAGE_H
|
|
|
|
/* PAGE_SHIFT determines the page size */
|
|
#ifdef CONFIG_ARM64_64K_PAGES
|
|
#define PAGE_SHIFT 16
|
|
#else
|
|
#define PAGE_SHIFT 12
|
|
#endif
|
|
#define PAGE_SIZE (_AC(1,UL) << PAGE_SHIFT)
|
|
#define PAGE_MASK (~(PAGE_SIZE-1))
|
|
|
|
/*
|
|
* The idmap and swapper page tables need some space reserved in the kernel
|
|
* image. Both require pgd, pud (4 levels only) and pmd tables to (section)
|
|
* map the kernel. With the 64K page configuration, swapper and idmap need to
|
|
* map to pte level. The swapper also maps the FDT (see __create_page_tables
|
|
* for more information).
|
|
*/
|
|
#ifdef CONFIG_ARM64_64K_PAGES
|
|
#define SWAPPER_PGTABLE_LEVELS (CONFIG_ARM64_PGTABLE_LEVELS)
|
|
#else
|
|
#define SWAPPER_PGTABLE_LEVELS (CONFIG_ARM64_PGTABLE_LEVELS - 1)
|
|
#endif
|
|
|
|
#define SWAPPER_DIR_SIZE (SWAPPER_PGTABLE_LEVELS * PAGE_SIZE)
|
|
#define IDMAP_DIR_SIZE (SWAPPER_DIR_SIZE)
|
|
|
|
#ifndef __ASSEMBLY__
|
|
|
|
#include <asm/pgtable-types.h>
|
|
|
|
extern void __cpu_clear_user_page(void *p, unsigned long user);
|
|
extern void __cpu_copy_user_page(void *to, const void *from,
|
|
unsigned long user);
|
|
extern void copy_page(void *to, const void *from);
|
|
extern void clear_page(void *to);
|
|
|
|
#define clear_user_page(addr,vaddr,pg) __cpu_clear_user_page(addr, vaddr)
|
|
#define copy_user_page(to,from,vaddr,pg) __cpu_copy_user_page(to, from, vaddr)
|
|
|
|
typedef struct page *pgtable_t;
|
|
|
|
#ifdef CONFIG_HAVE_ARCH_PFN_VALID
|
|
extern int pfn_valid(unsigned long);
|
|
#endif
|
|
|
|
#include <asm/memory.h>
|
|
|
|
#endif /* !__ASSEMBLY__ */
|
|
|
|
#define VM_DATA_DEFAULT_FLAGS \
|
|
(((current->personality & READ_IMPLIES_EXEC) ? VM_EXEC : 0) | \
|
|
VM_READ | VM_WRITE | VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
|
|
|
|
#include <asm-generic/getorder.h>
|
|
|
|
#endif
|