aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2012-01-18 10:32:49 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2012-01-23 05:24:11 -0500
commit94e5a85b3be0ce109d26aa6812b2a02c518a0e4b (patch)
treefb809876ee6b193489bbca6767c04df346466f1c /arch
parent45cd5290bfd358e9885c0bf47a8c46671a92f716 (diff)
ARM: earlier initialization of vectors page
Initialize the contents of the vectors page immediately after we allocate the page, but before we map it. This avoids any possible aliases with other mappings which may need to be flushed after the page has been mapped irrespective of the cache type. We follow this later with a flush_cache_all() after all static memory mappings have been initialized, which ensures that this is safe from any cache effects. Tested-by: Catalin Marinas <catalin.marinas@arm.com> Reviewed-by: Catalin Marinas <catalin.marinas@arm.com> Acked-by: Nicolas Pitre <nico@linaro.org> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/include/asm/traps.h2
-rw-r--r--arch/arm/kernel/setup.c1
-rw-r--r--arch/arm/kernel/traps.c10
-rw-r--r--arch/arm/mm/mmu.c7
4 files changed, 10 insertions, 10 deletions
diff --git a/arch/arm/include/asm/traps.h b/arch/arm/include/asm/traps.h
index 5b29a667362..f555bb3664d 100644
--- a/arch/arm/include/asm/traps.h
+++ b/arch/arm/include/asm/traps.h
@@ -46,7 +46,7 @@ static inline int in_exception_text(unsigned long ptr)
46 return in ? : __in_irqentry_text(ptr); 46 return in ? : __in_irqentry_text(ptr);
47} 47}
48 48
49extern void __init early_trap_init(void); 49extern void __init early_trap_init(void *);
50extern void dump_backtrace_entry(unsigned long where, unsigned long from, unsigned long frame); 50extern void dump_backtrace_entry(unsigned long where, unsigned long from, unsigned long frame);
51extern void ptrace_break(struct task_struct *tsk, struct pt_regs *regs); 51extern void ptrace_break(struct task_struct *tsk, struct pt_regs *regs);
52 52
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index 129fbd55bde..9b65cb4589e 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -961,7 +961,6 @@ void __init setup_arch(char **cmdline_p)
961 conswitchp = &dummy_con; 961 conswitchp = &dummy_con;
962#endif 962#endif
963#endif 963#endif
964 early_trap_init();
965 964
966 if (mdesc->init_early) 965 if (mdesc->init_early)
967 mdesc->init_early(); 966 mdesc->init_early();
diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c
index 99a57270250..be15dafaa88 100644
--- a/arch/arm/kernel/traps.c
+++ b/arch/arm/kernel/traps.c
@@ -781,18 +781,16 @@ static void __init kuser_get_tls_init(unsigned long vectors)
781 memcpy((void *)vectors + 0xfe0, (void *)vectors + 0xfe8, 4); 781 memcpy((void *)vectors + 0xfe0, (void *)vectors + 0xfe8, 4);
782} 782}
783 783
784void __init early_trap_init(void) 784void __init early_trap_init(void *vectors_base)
785{ 785{
786#if defined(CONFIG_CPU_USE_DOMAINS) 786 unsigned long vectors = (unsigned long)vectors_base;
787 unsigned long vectors = CONFIG_VECTORS_BASE;
788#else
789 unsigned long vectors = (unsigned long)vectors_page;
790#endif
791 extern char __stubs_start[], __stubs_end[]; 787 extern char __stubs_start[], __stubs_end[];
792 extern char __vectors_start[], __vectors_end[]; 788 extern char __vectors_start[], __vectors_end[];
793 extern char __kuser_helper_start[], __kuser_helper_end[]; 789 extern char __kuser_helper_start[], __kuser_helper_end[];
794 int kuser_sz = __kuser_helper_end - __kuser_helper_start; 790 int kuser_sz = __kuser_helper_end - __kuser_helper_start;
795 791
792 vectors_page = vectors_base;
793
796 /* 794 /*
797 * Copy the vectors, stubs and kuser helpers (in entry-armv.S) 795 * Copy the vectors, stubs and kuser helpers (in entry-armv.S)
798 * into the vector page, mapped at 0xffff0000, and ensure these 796 * into the vector page, mapped at 0xffff0000, and ensure these
diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c
index 94c5a0c94f5..c1263adc2a2 100644
--- a/arch/arm/mm/mmu.c
+++ b/arch/arm/mm/mmu.c
@@ -997,11 +997,14 @@ static void __init devicemaps_init(struct machine_desc *mdesc)
997{ 997{
998 struct map_desc map; 998 struct map_desc map;
999 unsigned long addr; 999 unsigned long addr;
1000 void *vectors;
1000 1001
1001 /* 1002 /*
1002 * Allocate the vector page early. 1003 * Allocate the vector page early.
1003 */ 1004 */
1004 vectors_page = early_alloc(PAGE_SIZE); 1005 vectors = early_alloc(PAGE_SIZE);
1006
1007 early_trap_init(vectors);
1005 1008
1006 for (addr = VMALLOC_START; addr; addr += PMD_SIZE) 1009 for (addr = VMALLOC_START; addr; addr += PMD_SIZE)
1007 pmd_clear(pmd_off_k(addr)); 1010 pmd_clear(pmd_off_k(addr));
@@ -1041,7 +1044,7 @@ static void __init devicemaps_init(struct machine_desc *mdesc)
1041 * location (0xffff0000). If we aren't using high-vectors, also 1044 * location (0xffff0000). If we aren't using high-vectors, also
1042 * create a mapping at the low-vectors virtual address. 1045 * create a mapping at the low-vectors virtual address.
1043 */ 1046 */
1044 map.pfn = __phys_to_pfn(virt_to_phys(vectors_page)); 1047 map.pfn = __phys_to_pfn(virt_to_phys(vectors));
1045 map.virtual = 0xffff0000; 1048 map.virtual = 0xffff0000;
1046 map.length = PAGE_SIZE; 1049 map.length = PAGE_SIZE;
1047 map.type = MT_HIGH_VECTORS; 1050 map.type = MT_HIGH_VECTORS;