diff options
author | Will Deacon <will.deacon@arm.com> | 2011-09-30 06:43:29 -0400 |
---|---|---|
committer | Will Deacon <will.deacon@arm.com> | 2011-12-06 09:04:14 -0500 |
commit | 8903826d0cd99aed9267e792d38284cf3092042b (patch) | |
tree | ec75fed09f62c215e2057d8c5e82c343e627c8fe /arch/arm/kernel/vmlinux.lds.S | |
parent | ba8bb18a03f8c7508565c385576a5431a4ad804a (diff) |
ARM: idmap: populate identity map pgd at init time using .init.text
When disabling and re-enabling the MMU, it is necessary to take out an
identity mapping for the code that manipulates the SCTLR in order to
avoid it disappearing from under our feet. This is useful when soft
rebooting and returning from CPU suspend.
This patch allocates a set of page tables during boot and populates them
with an identity mapping for the .idmap.text section. This means that
users of the identity map do not need to manage their own pgd and can
instead annotate their functions with __idmap or, in the case of assembly
code, place them in the correct section.
Acked-by: Dave Martin <dave.martin@linaro.org>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Tested-by: Lorenzo Pieralisi <Lorenzo.Pieralisi@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Diffstat (limited to 'arch/arm/kernel/vmlinux.lds.S')
-rw-r--r-- | arch/arm/kernel/vmlinux.lds.S | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/arch/arm/kernel/vmlinux.lds.S b/arch/arm/kernel/vmlinux.lds.S index 20b3041e0860..f76e75548670 100644 --- a/arch/arm/kernel/vmlinux.lds.S +++ b/arch/arm/kernel/vmlinux.lds.S | |||
@@ -13,6 +13,12 @@ | |||
13 | *(.proc.info.init) \ | 13 | *(.proc.info.init) \ |
14 | VMLINUX_SYMBOL(__proc_info_end) = .; | 14 | VMLINUX_SYMBOL(__proc_info_end) = .; |
15 | 15 | ||
16 | #define IDMAP_TEXT \ | ||
17 | ALIGN_FUNCTION(); \ | ||
18 | VMLINUX_SYMBOL(__idmap_text_start) = .; \ | ||
19 | *(.idmap.text) \ | ||
20 | VMLINUX_SYMBOL(__idmap_text_end) = .; | ||
21 | |||
16 | #ifdef CONFIG_HOTPLUG_CPU | 22 | #ifdef CONFIG_HOTPLUG_CPU |
17 | #define ARM_CPU_DISCARD(x) | 23 | #define ARM_CPU_DISCARD(x) |
18 | #define ARM_CPU_KEEP(x) x | 24 | #define ARM_CPU_KEEP(x) x |
@@ -92,6 +98,7 @@ SECTIONS | |||
92 | SCHED_TEXT | 98 | SCHED_TEXT |
93 | LOCK_TEXT | 99 | LOCK_TEXT |
94 | KPROBES_TEXT | 100 | KPROBES_TEXT |
101 | IDMAP_TEXT | ||
95 | #ifdef CONFIG_MMU | 102 | #ifdef CONFIG_MMU |
96 | *(.fixup) | 103 | *(.fixup) |
97 | #endif | 104 | #endif |