diff options
author | Catalin Marinas <catalin.marinas@arm.com> | 2013-04-23 06:21:44 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2013-04-25 08:15:38 -0400 |
commit | 6aaa189f8712471a250bfdf8fc8d08277258b8ab (patch) | |
tree | a9f763a91ad2186bcaa42eb0faa4df3945cb5f9d /arch/arm | |
parent | a0a9434dd50aac5971d63207ff1e25e69c9abdb3 (diff) |
ARM: 7702/1: Set the page table freeing ceiling to TASK_SIZE
ARM processors with LPAE enabled use 3 levels of page tables, with an
entry in the top level (pgd) covering 1GB of virtual space. Because of
the branch relocation limitations on ARM, the loadable modules are
mapped 16MB below PAGE_OFFSET, making the corresponding 1GB pgd shared
between kernel modules and user space.
If free_pgtables() is called with the default ceiling 0,
free_pgd_range() (and subsequently called functions) also frees the page
table shared between user space and kernel modules (which is normally
handled by the ARM-specific pgd_free() function). This patch changes
defines the ARM USER_PGTABLES_CEILING to TASK_SIZE when CONFIG_ARM_LPAE
is enabled.
Note that the pgd_free() function already checks the presence of the
shared pmd page allocated by pgd_alloc() and frees it, though with
ceiling 0 this wasn't necessary.
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: <stable@vger.kernel.org> # 3.3+
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/include/asm/pgtable.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/arch/arm/include/asm/pgtable.h b/arch/arm/include/asm/pgtable.h index 80d6fc4dbe4a..9bcd262a9008 100644 --- a/arch/arm/include/asm/pgtable.h +++ b/arch/arm/include/asm/pgtable.h | |||
@@ -61,6 +61,15 @@ extern void __pgd_error(const char *file, int line, pgd_t); | |||
61 | #define FIRST_USER_ADDRESS PAGE_SIZE | 61 | #define FIRST_USER_ADDRESS PAGE_SIZE |
62 | 62 | ||
63 | /* | 63 | /* |
64 | * Use TASK_SIZE as the ceiling argument for free_pgtables() and | ||
65 | * free_pgd_range() to avoid freeing the modules pmd when LPAE is enabled (pmd | ||
66 | * page shared between user and kernel). | ||
67 | */ | ||
68 | #ifdef CONFIG_ARM_LPAE | ||
69 | #define USER_PGTABLES_CEILING TASK_SIZE | ||
70 | #endif | ||
71 | |||
72 | /* | ||
64 | * The pgprot_* and protection_map entries will be fixed up in runtime | 73 | * The pgprot_* and protection_map entries will be fixed up in runtime |
65 | * to include the cachable and bufferable bits based on memory policy, | 74 | * to include the cachable and bufferable bits based on memory policy, |
66 | * as well as any architecture dependent bits like global/ASID and SMP | 75 | * as well as any architecture dependent bits like global/ASID and SMP |