aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/kernel')
-rw-r--r--arch/arm/kernel/asm-offsets.c2
-rw-r--r--arch/arm/kernel/calls.S2
-rw-r--r--arch/arm/kernel/entry-armv.S13
-rw-r--r--arch/arm/kernel/head.S26
-rw-r--r--arch/arm/kernel/hw_breakpoint.c2
-rw-r--r--arch/arm/kernel/perf_event.c4
-rw-r--r--arch/arm/kernel/perf_event_v7.c2
-rw-r--r--arch/arm/kernel/process.c13
-rw-r--r--arch/arm/kernel/smp.c3
-rw-r--r--arch/arm/kernel/smp_tlb.c12
-rw-r--r--arch/arm/kernel/smp_twd.c17
-rw-r--r--arch/arm/kernel/suspend.c1
12 files changed, 62 insertions, 35 deletions
diff --git a/arch/arm/kernel/asm-offsets.c b/arch/arm/kernel/asm-offsets.c
index 5ce738b43508..923eec7105cf 100644
--- a/arch/arm/kernel/asm-offsets.c
+++ b/arch/arm/kernel/asm-offsets.c
@@ -110,7 +110,7 @@ int main(void)
110 BLANK(); 110 BLANK();
111#endif 111#endif
112#ifdef CONFIG_CPU_HAS_ASID 112#ifdef CONFIG_CPU_HAS_ASID
113 DEFINE(MM_CONTEXT_ID, offsetof(struct mm_struct, context.id)); 113 DEFINE(MM_CONTEXT_ID, offsetof(struct mm_struct, context.id.counter));
114 BLANK(); 114 BLANK();
115#endif 115#endif
116 DEFINE(VMA_VM_MM, offsetof(struct vm_area_struct, vm_mm)); 116 DEFINE(VMA_VM_MM, offsetof(struct vm_area_struct, vm_mm));
diff --git a/arch/arm/kernel/calls.S b/arch/arm/kernel/calls.S
index 0cc57611fc4f..c6ca7e376773 100644
--- a/arch/arm/kernel/calls.S
+++ b/arch/arm/kernel/calls.S
@@ -387,7 +387,7 @@
387/* 375 */ CALL(sys_setns) 387/* 375 */ CALL(sys_setns)
388 CALL(sys_process_vm_readv) 388 CALL(sys_process_vm_readv)
389 CALL(sys_process_vm_writev) 389 CALL(sys_process_vm_writev)
390 CALL(sys_ni_syscall) /* reserved for sys_kcmp */ 390 CALL(sys_kcmp)
391 CALL(sys_finit_module) 391 CALL(sys_finit_module)
392#ifndef syscalls_counted 392#ifndef syscalls_counted
393.equ syscalls_padding, ((NR_syscalls + 3) & ~3) - NR_syscalls 393.equ syscalls_padding, ((NR_syscalls + 3) & ~3) - NR_syscalls
diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S
index 0f82098c9bfe..cd22d821bf74 100644
--- a/arch/arm/kernel/entry-armv.S
+++ b/arch/arm/kernel/entry-armv.S
@@ -562,21 +562,21 @@ ENDPROC(__und_usr)
562 @ Fall-through from Thumb-2 __und_usr 562 @ Fall-through from Thumb-2 __und_usr
563 @ 563 @
564#ifdef CONFIG_NEON 564#ifdef CONFIG_NEON
565 get_thread_info r10 @ get current thread
565 adr r6, .LCneon_thumb_opcodes 566 adr r6, .LCneon_thumb_opcodes
566 b 2f 567 b 2f
567#endif 568#endif
568call_fpe: 569call_fpe:
570 get_thread_info r10 @ get current thread
569#ifdef CONFIG_NEON 571#ifdef CONFIG_NEON
570 adr r6, .LCneon_arm_opcodes 572 adr r6, .LCneon_arm_opcodes
5712: 5732: ldr r5, [r6], #4 @ mask value
572 ldr r7, [r6], #4 @ mask value
573 cmp r7, #0 @ end mask?
574 beq 1f
575 and r8, r0, r7
576 ldr r7, [r6], #4 @ opcode bits matching in mask 574 ldr r7, [r6], #4 @ opcode bits matching in mask
575 cmp r5, #0 @ end mask?
576 beq 1f
577 and r8, r0, r5
577 cmp r8, r7 @ NEON instruction? 578 cmp r8, r7 @ NEON instruction?
578 bne 2b 579 bne 2b
579 get_thread_info r10
580 mov r7, #1 580 mov r7, #1
581 strb r7, [r10, #TI_USED_CP + 10] @ mark CP#10 as used 581 strb r7, [r10, #TI_USED_CP + 10] @ mark CP#10 as used
582 strb r7, [r10, #TI_USED_CP + 11] @ mark CP#11 as used 582 strb r7, [r10, #TI_USED_CP + 11] @ mark CP#11 as used
@@ -586,7 +586,6 @@ call_fpe:
586 tst r0, #0x08000000 @ only CDP/CPRT/LDC/STC have bit 27 586 tst r0, #0x08000000 @ only CDP/CPRT/LDC/STC have bit 27
587 tstne r0, #0x04000000 @ bit 26 set on both ARM and Thumb-2 587 tstne r0, #0x04000000 @ bit 26 set on both ARM and Thumb-2
588 moveq pc, lr 588 moveq pc, lr
589 get_thread_info r10 @ get current thread
590 and r8, r0, #0x00000f00 @ mask out CP number 589 and r8, r0, #0x00000f00 @ mask out CP number
591 THUMB( lsr r8, r8, #8 ) 590 THUMB( lsr r8, r8, #8 )
592 mov r7, #1 591 mov r7, #1
diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S
index 486a15ae9011..e0eb9a1cae77 100644
--- a/arch/arm/kernel/head.S
+++ b/arch/arm/kernel/head.S
@@ -184,13 +184,22 @@ __create_page_tables:
184 orr r3, r3, #3 @ PGD block type 184 orr r3, r3, #3 @ PGD block type
185 mov r6, #4 @ PTRS_PER_PGD 185 mov r6, #4 @ PTRS_PER_PGD
186 mov r7, #1 << (55 - 32) @ L_PGD_SWAPPER 186 mov r7, #1 << (55 - 32) @ L_PGD_SWAPPER
1871: str r3, [r0], #4 @ set bottom PGD entry bits 1871:
188#ifdef CONFIG_CPU_ENDIAN_BE8
188 str r7, [r0], #4 @ set top PGD entry bits 189 str r7, [r0], #4 @ set top PGD entry bits
190 str r3, [r0], #4 @ set bottom PGD entry bits
191#else
192 str r3, [r0], #4 @ set bottom PGD entry bits
193 str r7, [r0], #4 @ set top PGD entry bits
194#endif
189 add r3, r3, #0x1000 @ next PMD table 195 add r3, r3, #0x1000 @ next PMD table
190 subs r6, r6, #1 196 subs r6, r6, #1
191 bne 1b 197 bne 1b
192 198
193 add r4, r4, #0x1000 @ point to the PMD tables 199 add r4, r4, #0x1000 @ point to the PMD tables
200#ifdef CONFIG_CPU_ENDIAN_BE8
201 add r4, r4, #4 @ we only write the bottom word
202#endif
194#endif 203#endif
195 204
196 ldr r7, [r10, #PROCINFO_MM_MMUFLAGS] @ mm_mmuflags 205 ldr r7, [r10, #PROCINFO_MM_MMUFLAGS] @ mm_mmuflags
@@ -258,6 +267,11 @@ __create_page_tables:
258 addne r6, r6, #1 << SECTION_SHIFT 267 addne r6, r6, #1 << SECTION_SHIFT
259 strne r6, [r3] 268 strne r6, [r3]
260 269
270#if defined(CONFIG_LPAE) && defined(CONFIG_CPU_ENDIAN_BE8)
271 sub r4, r4, #4 @ Fixup page table pointer
272 @ for 64-bit descriptors
273#endif
274
261#ifdef CONFIG_DEBUG_LL 275#ifdef CONFIG_DEBUG_LL
262#if !defined(CONFIG_DEBUG_ICEDCC) && !defined(CONFIG_DEBUG_SEMIHOSTING) 276#if !defined(CONFIG_DEBUG_ICEDCC) && !defined(CONFIG_DEBUG_SEMIHOSTING)
263 /* 277 /*
@@ -276,13 +290,17 @@ __create_page_tables:
276 orr r3, r7, r3, lsl #SECTION_SHIFT 290 orr r3, r7, r3, lsl #SECTION_SHIFT
277#ifdef CONFIG_ARM_LPAE 291#ifdef CONFIG_ARM_LPAE
278 mov r7, #1 << (54 - 32) @ XN 292 mov r7, #1 << (54 - 32) @ XN
293#ifdef CONFIG_CPU_ENDIAN_BE8
294 str r7, [r0], #4
295 str r3, [r0], #4
279#else 296#else
280 orr r3, r3, #PMD_SECT_XN
281#endif
282 str r3, [r0], #4 297 str r3, [r0], #4
283#ifdef CONFIG_ARM_LPAE
284 str r7, [r0], #4 298 str r7, [r0], #4
285#endif 299#endif
300#else
301 orr r3, r3, #PMD_SECT_XN
302 str r3, [r0], #4
303#endif
286 304
287#else /* CONFIG_DEBUG_ICEDCC || CONFIG_DEBUG_SEMIHOSTING */ 305#else /* CONFIG_DEBUG_ICEDCC || CONFIG_DEBUG_SEMIHOSTING */
288 /* we don't need any serial debugging mappings */ 306 /* we don't need any serial debugging mappings */
diff --git a/arch/arm/kernel/hw_breakpoint.c b/arch/arm/kernel/hw_breakpoint.c
index 5eae53e7a2e1..96093b75ab90 100644
--- a/arch/arm/kernel/hw_breakpoint.c
+++ b/arch/arm/kernel/hw_breakpoint.c
@@ -1023,7 +1023,7 @@ out_mdbgen:
1023static int __cpuinit dbg_reset_notify(struct notifier_block *self, 1023static int __cpuinit dbg_reset_notify(struct notifier_block *self,
1024 unsigned long action, void *cpu) 1024 unsigned long action, void *cpu)
1025{ 1025{
1026 if (action == CPU_ONLINE) 1026 if ((action & ~CPU_TASKS_FROZEN) == CPU_ONLINE)
1027 smp_call_function_single((int)cpu, reset_ctrl_regs, NULL, 1); 1027 smp_call_function_single((int)cpu, reset_ctrl_regs, NULL, 1);
1028 1028
1029 return NOTIFY_OK; 1029 return NOTIFY_OK;
diff --git a/arch/arm/kernel/perf_event.c b/arch/arm/kernel/perf_event.c
index 31e0eb353cd8..146157dfe27c 100644
--- a/arch/arm/kernel/perf_event.c
+++ b/arch/arm/kernel/perf_event.c
@@ -400,7 +400,7 @@ __hw_perf_event_init(struct perf_event *event)
400 } 400 }
401 401
402 if (event->group_leader != event) { 402 if (event->group_leader != event) {
403 if (validate_group(event) != 0); 403 if (validate_group(event) != 0)
404 return -EINVAL; 404 return -EINVAL;
405 } 405 }
406 406
@@ -484,7 +484,7 @@ const struct dev_pm_ops armpmu_dev_pm_ops = {
484 SET_RUNTIME_PM_OPS(armpmu_runtime_suspend, armpmu_runtime_resume, NULL) 484 SET_RUNTIME_PM_OPS(armpmu_runtime_suspend, armpmu_runtime_resume, NULL)
485}; 485};
486 486
487static void __init armpmu_init(struct arm_pmu *armpmu) 487static void armpmu_init(struct arm_pmu *armpmu)
488{ 488{
489 atomic_set(&armpmu->active_events, 0); 489 atomic_set(&armpmu->active_events, 0);
490 mutex_init(&armpmu->reserve_mutex); 490 mutex_init(&armpmu->reserve_mutex);
diff --git a/arch/arm/kernel/perf_event_v7.c b/arch/arm/kernel/perf_event_v7.c
index 8c79a9e70b83..039cffb053a7 100644
--- a/arch/arm/kernel/perf_event_v7.c
+++ b/arch/arm/kernel/perf_event_v7.c
@@ -774,7 +774,7 @@ static const unsigned armv7_a7_perf_cache_map[PERF_COUNT_HW_CACHE_MAX]
774/* 774/*
775 * PMXEVTYPER: Event selection reg 775 * PMXEVTYPER: Event selection reg
776 */ 776 */
777#define ARMV7_EVTYPE_MASK 0xc00000ff /* Mask for writable bits */ 777#define ARMV7_EVTYPE_MASK 0xc80000ff /* Mask for writable bits */
778#define ARMV7_EVTYPE_EVENT 0xff /* Mask for EVENT bits */ 778#define ARMV7_EVTYPE_EVENT 0xff /* Mask for EVENT bits */
779 779
780/* 780/*
diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c
index 047d3e40e470..cbd0f51937cc 100644
--- a/arch/arm/kernel/process.c
+++ b/arch/arm/kernel/process.c
@@ -459,15 +459,16 @@ unsigned long arch_randomize_brk(struct mm_struct *mm)
459 * atomic helpers and the signal restart code. Insert it into the 459 * atomic helpers and the signal restart code. Insert it into the
460 * gate_vma so that it is visible through ptrace and /proc/<pid>/mem. 460 * gate_vma so that it is visible through ptrace and /proc/<pid>/mem.
461 */ 461 */
462static struct vm_area_struct gate_vma; 462static struct vm_area_struct gate_vma = {
463 .vm_start = 0xffff0000,
464 .vm_end = 0xffff0000 + PAGE_SIZE,
465 .vm_flags = VM_READ | VM_EXEC | VM_MAYREAD | VM_MAYEXEC,
466 .vm_mm = &init_mm,
467};
463 468
464static int __init gate_vma_init(void) 469static int __init gate_vma_init(void)
465{ 470{
466 gate_vma.vm_start = 0xffff0000; 471 gate_vma.vm_page_prot = PAGE_READONLY_EXEC;
467 gate_vma.vm_end = 0xffff0000 + PAGE_SIZE;
468 gate_vma.vm_page_prot = PAGE_READONLY_EXEC;
469 gate_vma.vm_flags = VM_READ | VM_EXEC |
470 VM_MAYREAD | VM_MAYEXEC;
471 return 0; 472 return 0;
472} 473}
473arch_initcall(gate_vma_init); 474arch_initcall(gate_vma_init);
diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c
index 1bdfd87c8e41..79078edbb9bc 100644
--- a/arch/arm/kernel/smp.c
+++ b/arch/arm/kernel/smp.c
@@ -285,6 +285,7 @@ asmlinkage void __cpuinit secondary_start_kernel(void)
285 * switch away from it before attempting any exclusive accesses. 285 * switch away from it before attempting any exclusive accesses.
286 */ 286 */
287 cpu_switch_mm(mm->pgd, mm); 287 cpu_switch_mm(mm->pgd, mm);
288 local_flush_bp_all();
288 enter_lazy_tlb(mm, current); 289 enter_lazy_tlb(mm, current);
289 local_flush_tlb_all(); 290 local_flush_tlb_all();
290 291
@@ -479,7 +480,7 @@ static void __cpuinit broadcast_timer_setup(struct clock_event_device *evt)
479 evt->features = CLOCK_EVT_FEAT_ONESHOT | 480 evt->features = CLOCK_EVT_FEAT_ONESHOT |
480 CLOCK_EVT_FEAT_PERIODIC | 481 CLOCK_EVT_FEAT_PERIODIC |
481 CLOCK_EVT_FEAT_DUMMY; 482 CLOCK_EVT_FEAT_DUMMY;
482 evt->rating = 400; 483 evt->rating = 100;
483 evt->mult = 1; 484 evt->mult = 1;
484 evt->set_mode = broadcast_timer_set_mode; 485 evt->set_mode = broadcast_timer_set_mode;
485 486
diff --git a/arch/arm/kernel/smp_tlb.c b/arch/arm/kernel/smp_tlb.c
index 02c5d2ce23bf..bd0300531399 100644
--- a/arch/arm/kernel/smp_tlb.c
+++ b/arch/arm/kernel/smp_tlb.c
@@ -64,6 +64,11 @@ static inline void ipi_flush_tlb_kernel_range(void *arg)
64 local_flush_tlb_kernel_range(ta->ta_start, ta->ta_end); 64 local_flush_tlb_kernel_range(ta->ta_start, ta->ta_end);
65} 65}
66 66
67static inline void ipi_flush_bp_all(void *ignored)
68{
69 local_flush_bp_all();
70}
71
67void flush_tlb_all(void) 72void flush_tlb_all(void)
68{ 73{
69 if (tlb_ops_need_broadcast()) 74 if (tlb_ops_need_broadcast())
@@ -127,3 +132,10 @@ void flush_tlb_kernel_range(unsigned long start, unsigned long end)
127 local_flush_tlb_kernel_range(start, end); 132 local_flush_tlb_kernel_range(start, end);
128} 133}
129 134
135void flush_bp_all(void)
136{
137 if (tlb_ops_need_broadcast())
138 on_each_cpu(ipi_flush_bp_all, NULL, 1);
139 else
140 local_flush_bp_all();
141}
diff --git a/arch/arm/kernel/smp_twd.c b/arch/arm/kernel/smp_twd.c
index c092115d903a..90525d9d290b 100644
--- a/arch/arm/kernel/smp_twd.c
+++ b/arch/arm/kernel/smp_twd.c
@@ -22,6 +22,7 @@
22#include <linux/of_irq.h> 22#include <linux/of_irq.h>
23#include <linux/of_address.h> 23#include <linux/of_address.h>
24 24
25#include <asm/smp_plat.h>
25#include <asm/smp_twd.h> 26#include <asm/smp_twd.h>
26#include <asm/localtimer.h> 27#include <asm/localtimer.h>
27 28
@@ -361,20 +362,11 @@ int __init twd_local_timer_register(struct twd_local_timer *tlt)
361} 362}
362 363
363#ifdef CONFIG_OF 364#ifdef CONFIG_OF
364const static struct of_device_id twd_of_match[] __initconst = { 365static void __init twd_local_timer_of_register(struct device_node *np)
365 { .compatible = "arm,cortex-a9-twd-timer", },
366 { .compatible = "arm,cortex-a5-twd-timer", },
367 { .compatible = "arm,arm11mp-twd-timer", },
368 { },
369};
370
371void __init twd_local_timer_of_register(void)
372{ 366{
373 struct device_node *np;
374 int err; 367 int err;
375 368
376 np = of_find_matching_node(NULL, twd_of_match); 369 if (!is_smp() || !setup_max_cpus)
377 if (!np)
378 return; 370 return;
379 371
380 twd_ppi = irq_of_parse_and_map(np, 0); 372 twd_ppi = irq_of_parse_and_map(np, 0);
@@ -394,4 +386,7 @@ void __init twd_local_timer_of_register(void)
394out: 386out:
395 WARN(err, "twd_local_timer_of_register failed (%d)\n", err); 387 WARN(err, "twd_local_timer_of_register failed (%d)\n", err);
396} 388}
389CLOCKSOURCE_OF_DECLARE(arm_twd_a9, "arm,cortex-a9-twd-timer", twd_local_timer_of_register);
390CLOCKSOURCE_OF_DECLARE(arm_twd_a5, "arm,cortex-a5-twd-timer", twd_local_timer_of_register);
391CLOCKSOURCE_OF_DECLARE(arm_twd_11mp, "arm,arm11mp-twd-timer", twd_local_timer_of_register);
397#endif 392#endif
diff --git a/arch/arm/kernel/suspend.c b/arch/arm/kernel/suspend.c
index 358bca3a995e..c59c97ea8268 100644
--- a/arch/arm/kernel/suspend.c
+++ b/arch/arm/kernel/suspend.c
@@ -68,6 +68,7 @@ int cpu_suspend(unsigned long arg, int (*fn)(unsigned long))
68 ret = __cpu_suspend(arg, fn); 68 ret = __cpu_suspend(arg, fn);
69 if (ret == 0) { 69 if (ret == 0) {
70 cpu_switch_mm(mm->pgd, mm); 70 cpu_switch_mm(mm->pgd, mm);
71 local_flush_bp_all();
71 local_flush_tlb_all(); 72 local_flush_tlb_all();
72 } 73 }
73 74