diff options
Diffstat (limited to 'arch')
28 files changed, 316 insertions, 125 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 13b739469c51..1cacda426a0e 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig | |||
@@ -1183,9 +1183,9 @@ config ARM_NR_BANKS | |||
1183 | default 8 | 1183 | default 8 |
1184 | 1184 | ||
1185 | config IWMMXT | 1185 | config IWMMXT |
1186 | bool "Enable iWMMXt support" | 1186 | bool "Enable iWMMXt support" if !CPU_PJ4 |
1187 | depends on CPU_XSCALE || CPU_XSC3 || CPU_MOHAWK || CPU_PJ4 | 1187 | depends on CPU_XSCALE || CPU_XSC3 || CPU_MOHAWK || CPU_PJ4 |
1188 | default y if PXA27x || PXA3xx || ARCH_MMP | 1188 | default y if PXA27x || PXA3xx || ARCH_MMP || CPU_PJ4 |
1189 | help | 1189 | help |
1190 | Enable support for iWMMXt context switching at run time if | 1190 | Enable support for iWMMXt context switching at run time if |
1191 | running on a CPU that supports it. | 1191 | running on a CPU that supports it. |
@@ -1439,6 +1439,16 @@ config ARM_ERRATA_775420 | |||
1439 | to deadlock. This workaround puts DSB before executing ISB if | 1439 | to deadlock. This workaround puts DSB before executing ISB if |
1440 | an abort may occur on cache maintenance. | 1440 | an abort may occur on cache maintenance. |
1441 | 1441 | ||
1442 | config ARM_ERRATA_798181 | ||
1443 | bool "ARM errata: TLBI/DSB failure on Cortex-A15" | ||
1444 | depends on CPU_V7 && SMP | ||
1445 | help | ||
1446 | On Cortex-A15 (r0p0..r3p2) the TLBI*IS/DSB operations are not | ||
1447 | adequately shooting down all use of the old entries. This | ||
1448 | option enables the Linux kernel workaround for this erratum | ||
1449 | which sends an IPI to the CPUs that are running the same ASID | ||
1450 | as the one being invalidated. | ||
1451 | |||
1442 | endmenu | 1452 | endmenu |
1443 | 1453 | ||
1444 | source "arch/arm/common/Kconfig" | 1454 | source "arch/arm/common/Kconfig" |
diff --git a/arch/arm/include/asm/delay.h b/arch/arm/include/asm/delay.h index 720799fd3a81..dff714d886d5 100644 --- a/arch/arm/include/asm/delay.h +++ b/arch/arm/include/asm/delay.h | |||
@@ -24,7 +24,7 @@ extern struct arm_delay_ops { | |||
24 | void (*delay)(unsigned long); | 24 | void (*delay)(unsigned long); |
25 | void (*const_udelay)(unsigned long); | 25 | void (*const_udelay)(unsigned long); |
26 | void (*udelay)(unsigned long); | 26 | void (*udelay)(unsigned long); |
27 | bool const_clock; | 27 | unsigned long ticks_per_jiffy; |
28 | } arm_delay_ops; | 28 | } arm_delay_ops; |
29 | 29 | ||
30 | #define __delay(n) arm_delay_ops.delay(n) | 30 | #define __delay(n) arm_delay_ops.delay(n) |
diff --git a/arch/arm/include/asm/highmem.h b/arch/arm/include/asm/highmem.h index 8c5e828f484d..91b99abe7a95 100644 --- a/arch/arm/include/asm/highmem.h +++ b/arch/arm/include/asm/highmem.h | |||
@@ -41,6 +41,13 @@ extern void kunmap_high(struct page *page); | |||
41 | #endif | 41 | #endif |
42 | #endif | 42 | #endif |
43 | 43 | ||
44 | /* | ||
45 | * Needed to be able to broadcast the TLB invalidation for kmap. | ||
46 | */ | ||
47 | #ifdef CONFIG_ARM_ERRATA_798181 | ||
48 | #undef ARCH_NEEDS_KMAP_HIGH_GET | ||
49 | #endif | ||
50 | |||
44 | #ifdef ARCH_NEEDS_KMAP_HIGH_GET | 51 | #ifdef ARCH_NEEDS_KMAP_HIGH_GET |
45 | extern void *kmap_high_get(struct page *page); | 52 | extern void *kmap_high_get(struct page *page); |
46 | #else | 53 | #else |
diff --git a/arch/arm/include/asm/mmu_context.h b/arch/arm/include/asm/mmu_context.h index 863a6611323c..a7b85e0d0cc1 100644 --- a/arch/arm/include/asm/mmu_context.h +++ b/arch/arm/include/asm/mmu_context.h | |||
@@ -27,6 +27,8 @@ void __check_vmalloc_seq(struct mm_struct *mm); | |||
27 | void check_and_switch_context(struct mm_struct *mm, struct task_struct *tsk); | 27 | void check_and_switch_context(struct mm_struct *mm, struct task_struct *tsk); |
28 | #define init_new_context(tsk,mm) ({ atomic64_set(&mm->context.id, 0); 0; }) | 28 | #define init_new_context(tsk,mm) ({ atomic64_set(&mm->context.id, 0); 0; }) |
29 | 29 | ||
30 | DECLARE_PER_CPU(atomic64_t, active_asids); | ||
31 | |||
30 | #else /* !CONFIG_CPU_HAS_ASID */ | 32 | #else /* !CONFIG_CPU_HAS_ASID */ |
31 | 33 | ||
32 | #ifdef CONFIG_MMU | 34 | #ifdef CONFIG_MMU |
diff --git a/arch/arm/include/asm/tlbflush.h b/arch/arm/include/asm/tlbflush.h index 4db8c8820f0d..9e9c041358ca 100644 --- a/arch/arm/include/asm/tlbflush.h +++ b/arch/arm/include/asm/tlbflush.h | |||
@@ -450,6 +450,21 @@ static inline void local_flush_bp_all(void) | |||
450 | isb(); | 450 | isb(); |
451 | } | 451 | } |
452 | 452 | ||
453 | #ifdef CONFIG_ARM_ERRATA_798181 | ||
454 | static inline void dummy_flush_tlb_a15_erratum(void) | ||
455 | { | ||
456 | /* | ||
457 | * Dummy TLBIMVAIS. Using the unmapped address 0 and ASID 0. | ||
458 | */ | ||
459 | asm("mcr p15, 0, %0, c8, c3, 1" : : "r" (0)); | ||
460 | dsb(); | ||
461 | } | ||
462 | #else | ||
463 | static inline void dummy_flush_tlb_a15_erratum(void) | ||
464 | { | ||
465 | } | ||
466 | #endif | ||
467 | |||
453 | /* | 468 | /* |
454 | * flush_pmd_entry | 469 | * flush_pmd_entry |
455 | * | 470 | * |
diff --git a/arch/arm/kernel/entry-common.S b/arch/arm/kernel/entry-common.S index 3248cde504ed..fefd7f971437 100644 --- a/arch/arm/kernel/entry-common.S +++ b/arch/arm/kernel/entry-common.S | |||
@@ -276,7 +276,13 @@ ENDPROC(ftrace_graph_caller_old) | |||
276 | */ | 276 | */ |
277 | 277 | ||
278 | .macro mcount_enter | 278 | .macro mcount_enter |
279 | /* | ||
280 | * This pad compensates for the push {lr} at the call site. Note that we are | ||
281 | * unable to unwind through a function which does not otherwise save its lr. | ||
282 | */ | ||
283 | UNWIND(.pad #4) | ||
279 | stmdb sp!, {r0-r3, lr} | 284 | stmdb sp!, {r0-r3, lr} |
285 | UNWIND(.save {r0-r3, lr}) | ||
280 | .endm | 286 | .endm |
281 | 287 | ||
282 | .macro mcount_get_lr reg | 288 | .macro mcount_get_lr reg |
@@ -289,6 +295,7 @@ ENDPROC(ftrace_graph_caller_old) | |||
289 | .endm | 295 | .endm |
290 | 296 | ||
291 | ENTRY(__gnu_mcount_nc) | 297 | ENTRY(__gnu_mcount_nc) |
298 | UNWIND(.fnstart) | ||
292 | #ifdef CONFIG_DYNAMIC_FTRACE | 299 | #ifdef CONFIG_DYNAMIC_FTRACE |
293 | mov ip, lr | 300 | mov ip, lr |
294 | ldmia sp!, {lr} | 301 | ldmia sp!, {lr} |
@@ -296,17 +303,22 @@ ENTRY(__gnu_mcount_nc) | |||
296 | #else | 303 | #else |
297 | __mcount | 304 | __mcount |
298 | #endif | 305 | #endif |
306 | UNWIND(.fnend) | ||
299 | ENDPROC(__gnu_mcount_nc) | 307 | ENDPROC(__gnu_mcount_nc) |
300 | 308 | ||
301 | #ifdef CONFIG_DYNAMIC_FTRACE | 309 | #ifdef CONFIG_DYNAMIC_FTRACE |
302 | ENTRY(ftrace_caller) | 310 | ENTRY(ftrace_caller) |
311 | UNWIND(.fnstart) | ||
303 | __ftrace_caller | 312 | __ftrace_caller |
313 | UNWIND(.fnend) | ||
304 | ENDPROC(ftrace_caller) | 314 | ENDPROC(ftrace_caller) |
305 | #endif | 315 | #endif |
306 | 316 | ||
307 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER | 317 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER |
308 | ENTRY(ftrace_graph_caller) | 318 | ENTRY(ftrace_graph_caller) |
319 | UNWIND(.fnstart) | ||
309 | __ftrace_graph_caller | 320 | __ftrace_graph_caller |
321 | UNWIND(.fnend) | ||
310 | ENDPROC(ftrace_graph_caller) | 322 | ENDPROC(ftrace_graph_caller) |
311 | #endif | 323 | #endif |
312 | 324 | ||
diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S index e0eb9a1cae77..8bac553fe213 100644 --- a/arch/arm/kernel/head.S +++ b/arch/arm/kernel/head.S | |||
@@ -267,7 +267,7 @@ __create_page_tables: | |||
267 | addne r6, r6, #1 << SECTION_SHIFT | 267 | addne r6, r6, #1 << SECTION_SHIFT |
268 | strne r6, [r3] | 268 | strne r6, [r3] |
269 | 269 | ||
270 | #if defined(CONFIG_LPAE) && defined(CONFIG_CPU_ENDIAN_BE8) | 270 | #if defined(CONFIG_ARM_LPAE) && defined(CONFIG_CPU_ENDIAN_BE8) |
271 | sub r4, r4, #4 @ Fixup page table pointer | 271 | sub r4, r4, #4 @ Fixup page table pointer |
272 | @ for 64-bit descriptors | 272 | @ for 64-bit descriptors |
273 | #endif | 273 | #endif |
diff --git a/arch/arm/kernel/hw_breakpoint.c b/arch/arm/kernel/hw_breakpoint.c index 96093b75ab90..5dc1aa6f0f7d 100644 --- a/arch/arm/kernel/hw_breakpoint.c +++ b/arch/arm/kernel/hw_breakpoint.c | |||
@@ -966,7 +966,7 @@ static void reset_ctrl_regs(void *unused) | |||
966 | } | 966 | } |
967 | 967 | ||
968 | if (err) { | 968 | if (err) { |
969 | pr_warning("CPU %d debug is powered down!\n", cpu); | 969 | pr_warn_once("CPU %d debug is powered down!\n", cpu); |
970 | cpumask_or(&debug_err_mask, &debug_err_mask, cpumask_of(cpu)); | 970 | cpumask_or(&debug_err_mask, &debug_err_mask, cpumask_of(cpu)); |
971 | return; | 971 | return; |
972 | } | 972 | } |
@@ -987,7 +987,7 @@ clear_vcr: | |||
987 | isb(); | 987 | isb(); |
988 | 988 | ||
989 | if (cpumask_intersects(&debug_err_mask, cpumask_of(cpu))) { | 989 | if (cpumask_intersects(&debug_err_mask, cpumask_of(cpu))) { |
990 | pr_warning("CPU %d failed to disable vector catch\n", cpu); | 990 | pr_warn_once("CPU %d failed to disable vector catch\n", cpu); |
991 | return; | 991 | return; |
992 | } | 992 | } |
993 | 993 | ||
@@ -1007,7 +1007,7 @@ clear_vcr: | |||
1007 | } | 1007 | } |
1008 | 1008 | ||
1009 | if (cpumask_intersects(&debug_err_mask, cpumask_of(cpu))) { | 1009 | if (cpumask_intersects(&debug_err_mask, cpumask_of(cpu))) { |
1010 | pr_warning("CPU %d failed to clear debug register pairs\n", cpu); | 1010 | pr_warn_once("CPU %d failed to clear debug register pairs\n", cpu); |
1011 | return; | 1011 | return; |
1012 | } | 1012 | } |
1013 | 1013 | ||
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c index 3f6cbb2e3eda..d343a6c3a6d1 100644 --- a/arch/arm/kernel/setup.c +++ b/arch/arm/kernel/setup.c | |||
@@ -353,6 +353,23 @@ void __init early_print(const char *str, ...) | |||
353 | printk("%s", buf); | 353 | printk("%s", buf); |
354 | } | 354 | } |
355 | 355 | ||
356 | static void __init cpuid_init_hwcaps(void) | ||
357 | { | ||
358 | unsigned int divide_instrs; | ||
359 | |||
360 | if (cpu_architecture() < CPU_ARCH_ARMv7) | ||
361 | return; | ||
362 | |||
363 | divide_instrs = (read_cpuid_ext(CPUID_EXT_ISAR0) & 0x0f000000) >> 24; | ||
364 | |||
365 | switch (divide_instrs) { | ||
366 | case 2: | ||
367 | elf_hwcap |= HWCAP_IDIVA; | ||
368 | case 1: | ||
369 | elf_hwcap |= HWCAP_IDIVT; | ||
370 | } | ||
371 | } | ||
372 | |||
356 | static void __init feat_v6_fixup(void) | 373 | static void __init feat_v6_fixup(void) |
357 | { | 374 | { |
358 | int id = read_cpuid_id(); | 375 | int id = read_cpuid_id(); |
@@ -483,8 +500,11 @@ static void __init setup_processor(void) | |||
483 | snprintf(elf_platform, ELF_PLATFORM_SIZE, "%s%c", | 500 | snprintf(elf_platform, ELF_PLATFORM_SIZE, "%s%c", |
484 | list->elf_name, ENDIANNESS); | 501 | list->elf_name, ENDIANNESS); |
485 | elf_hwcap = list->elf_hwcap; | 502 | elf_hwcap = list->elf_hwcap; |
503 | |||
504 | cpuid_init_hwcaps(); | ||
505 | |||
486 | #ifndef CONFIG_ARM_THUMB | 506 | #ifndef CONFIG_ARM_THUMB |
487 | elf_hwcap &= ~HWCAP_THUMB; | 507 | elf_hwcap &= ~(HWCAP_THUMB | HWCAP_IDIVT); |
488 | #endif | 508 | #endif |
489 | 509 | ||
490 | feat_v6_fixup(); | 510 | feat_v6_fixup(); |
@@ -524,7 +544,7 @@ int __init arm_add_memory(phys_addr_t start, phys_addr_t size) | |||
524 | size -= start & ~PAGE_MASK; | 544 | size -= start & ~PAGE_MASK; |
525 | bank->start = PAGE_ALIGN(start); | 545 | bank->start = PAGE_ALIGN(start); |
526 | 546 | ||
527 | #ifndef CONFIG_LPAE | 547 | #ifndef CONFIG_ARM_LPAE |
528 | if (bank->start + size < bank->start) { | 548 | if (bank->start + size < bank->start) { |
529 | printk(KERN_CRIT "Truncating memory at 0x%08llx to fit in " | 549 | printk(KERN_CRIT "Truncating memory at 0x%08llx to fit in " |
530 | "32-bit physical address space\n", (long long)start); | 550 | "32-bit physical address space\n", (long long)start); |
diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c index 79078edbb9bc..1f2ccccaf009 100644 --- a/arch/arm/kernel/smp.c +++ b/arch/arm/kernel/smp.c | |||
@@ -673,9 +673,6 @@ static int cpufreq_callback(struct notifier_block *nb, | |||
673 | if (freq->flags & CPUFREQ_CONST_LOOPS) | 673 | if (freq->flags & CPUFREQ_CONST_LOOPS) |
674 | return NOTIFY_OK; | 674 | return NOTIFY_OK; |
675 | 675 | ||
676 | if (arm_delay_ops.const_clock) | ||
677 | return NOTIFY_OK; | ||
678 | |||
679 | if (!per_cpu(l_p_j_ref, cpu)) { | 676 | if (!per_cpu(l_p_j_ref, cpu)) { |
680 | per_cpu(l_p_j_ref, cpu) = | 677 | per_cpu(l_p_j_ref, cpu) = |
681 | per_cpu(cpu_data, cpu).loops_per_jiffy; | 678 | per_cpu(cpu_data, cpu).loops_per_jiffy; |
diff --git a/arch/arm/kernel/smp_tlb.c b/arch/arm/kernel/smp_tlb.c index bd0300531399..e82e1d248772 100644 --- a/arch/arm/kernel/smp_tlb.c +++ b/arch/arm/kernel/smp_tlb.c | |||
@@ -12,6 +12,7 @@ | |||
12 | 12 | ||
13 | #include <asm/smp_plat.h> | 13 | #include <asm/smp_plat.h> |
14 | #include <asm/tlbflush.h> | 14 | #include <asm/tlbflush.h> |
15 | #include <asm/mmu_context.h> | ||
15 | 16 | ||
16 | /**********************************************************************/ | 17 | /**********************************************************************/ |
17 | 18 | ||
@@ -69,12 +70,72 @@ static inline void ipi_flush_bp_all(void *ignored) | |||
69 | local_flush_bp_all(); | 70 | local_flush_bp_all(); |
70 | } | 71 | } |
71 | 72 | ||
73 | #ifdef CONFIG_ARM_ERRATA_798181 | ||
74 | static int erratum_a15_798181(void) | ||
75 | { | ||
76 | unsigned int midr = read_cpuid_id(); | ||
77 | |||
78 | /* Cortex-A15 r0p0..r3p2 affected */ | ||
79 | if ((midr & 0xff0ffff0) != 0x410fc0f0 || midr > 0x413fc0f2) | ||
80 | return 0; | ||
81 | return 1; | ||
82 | } | ||
83 | #else | ||
84 | static int erratum_a15_798181(void) | ||
85 | { | ||
86 | return 0; | ||
87 | } | ||
88 | #endif | ||
89 | |||
90 | static void ipi_flush_tlb_a15_erratum(void *arg) | ||
91 | { | ||
92 | dmb(); | ||
93 | } | ||
94 | |||
95 | static void broadcast_tlb_a15_erratum(void) | ||
96 | { | ||
97 | if (!erratum_a15_798181()) | ||
98 | return; | ||
99 | |||
100 | dummy_flush_tlb_a15_erratum(); | ||
101 | smp_call_function_many(cpu_online_mask, ipi_flush_tlb_a15_erratum, | ||
102 | NULL, 1); | ||
103 | } | ||
104 | |||
105 | static void broadcast_tlb_mm_a15_erratum(struct mm_struct *mm) | ||
106 | { | ||
107 | int cpu; | ||
108 | cpumask_t mask = { CPU_BITS_NONE }; | ||
109 | |||
110 | if (!erratum_a15_798181()) | ||
111 | return; | ||
112 | |||
113 | dummy_flush_tlb_a15_erratum(); | ||
114 | for_each_online_cpu(cpu) { | ||
115 | if (cpu == smp_processor_id()) | ||
116 | continue; | ||
117 | /* | ||
118 | * We only need to send an IPI if the other CPUs are running | ||
119 | * the same ASID as the one being invalidated. There is no | ||
120 | * need for locking around the active_asids check since the | ||
121 | * switch_mm() function has at least one dmb() (as required by | ||
122 | * this workaround) in case a context switch happens on | ||
123 | * another CPU after the condition below. | ||
124 | */ | ||
125 | if (atomic64_read(&mm->context.id) == | ||
126 | atomic64_read(&per_cpu(active_asids, cpu))) | ||
127 | cpumask_set_cpu(cpu, &mask); | ||
128 | } | ||
129 | smp_call_function_many(&mask, ipi_flush_tlb_a15_erratum, NULL, 1); | ||
130 | } | ||
131 | |||
72 | void flush_tlb_all(void) | 132 | void flush_tlb_all(void) |
73 | { | 133 | { |
74 | if (tlb_ops_need_broadcast()) | 134 | if (tlb_ops_need_broadcast()) |
75 | on_each_cpu(ipi_flush_tlb_all, NULL, 1); | 135 | on_each_cpu(ipi_flush_tlb_all, NULL, 1); |
76 | else | 136 | else |
77 | local_flush_tlb_all(); | 137 | local_flush_tlb_all(); |
138 | broadcast_tlb_a15_erratum(); | ||
78 | } | 139 | } |
79 | 140 | ||
80 | void flush_tlb_mm(struct mm_struct *mm) | 141 | void flush_tlb_mm(struct mm_struct *mm) |
@@ -83,6 +144,7 @@ void flush_tlb_mm(struct mm_struct *mm) | |||
83 | on_each_cpu_mask(mm_cpumask(mm), ipi_flush_tlb_mm, mm, 1); | 144 | on_each_cpu_mask(mm_cpumask(mm), ipi_flush_tlb_mm, mm, 1); |
84 | else | 145 | else |
85 | local_flush_tlb_mm(mm); | 146 | local_flush_tlb_mm(mm); |
147 | broadcast_tlb_mm_a15_erratum(mm); | ||
86 | } | 148 | } |
87 | 149 | ||
88 | void flush_tlb_page(struct vm_area_struct *vma, unsigned long uaddr) | 150 | void flush_tlb_page(struct vm_area_struct *vma, unsigned long uaddr) |
@@ -95,6 +157,7 @@ void flush_tlb_page(struct vm_area_struct *vma, unsigned long uaddr) | |||
95 | &ta, 1); | 157 | &ta, 1); |
96 | } else | 158 | } else |
97 | local_flush_tlb_page(vma, uaddr); | 159 | local_flush_tlb_page(vma, uaddr); |
160 | broadcast_tlb_mm_a15_erratum(vma->vm_mm); | ||
98 | } | 161 | } |
99 | 162 | ||
100 | void flush_tlb_kernel_page(unsigned long kaddr) | 163 | void flush_tlb_kernel_page(unsigned long kaddr) |
@@ -105,6 +168,7 @@ void flush_tlb_kernel_page(unsigned long kaddr) | |||
105 | on_each_cpu(ipi_flush_tlb_kernel_page, &ta, 1); | 168 | on_each_cpu(ipi_flush_tlb_kernel_page, &ta, 1); |
106 | } else | 169 | } else |
107 | local_flush_tlb_kernel_page(kaddr); | 170 | local_flush_tlb_kernel_page(kaddr); |
171 | broadcast_tlb_a15_erratum(); | ||
108 | } | 172 | } |
109 | 173 | ||
110 | void flush_tlb_range(struct vm_area_struct *vma, | 174 | void flush_tlb_range(struct vm_area_struct *vma, |
@@ -119,6 +183,7 @@ void flush_tlb_range(struct vm_area_struct *vma, | |||
119 | &ta, 1); | 183 | &ta, 1); |
120 | } else | 184 | } else |
121 | local_flush_tlb_range(vma, start, end); | 185 | local_flush_tlb_range(vma, start, end); |
186 | broadcast_tlb_mm_a15_erratum(vma->vm_mm); | ||
122 | } | 187 | } |
123 | 188 | ||
124 | void flush_tlb_kernel_range(unsigned long start, unsigned long end) | 189 | void flush_tlb_kernel_range(unsigned long start, unsigned long end) |
@@ -130,6 +195,7 @@ void flush_tlb_kernel_range(unsigned long start, unsigned long end) | |||
130 | on_each_cpu(ipi_flush_tlb_kernel_range, &ta, 1); | 195 | on_each_cpu(ipi_flush_tlb_kernel_range, &ta, 1); |
131 | } else | 196 | } else |
132 | local_flush_tlb_kernel_range(start, end); | 197 | local_flush_tlb_kernel_range(start, end); |
198 | broadcast_tlb_a15_erratum(); | ||
133 | } | 199 | } |
134 | 200 | ||
135 | void flush_bp_all(void) | 201 | void flush_bp_all(void) |
diff --git a/arch/arm/kvm/vgic.c b/arch/arm/kvm/vgic.c index c9a17316e9fe..0e4cfe123b38 100644 --- a/arch/arm/kvm/vgic.c +++ b/arch/arm/kvm/vgic.c | |||
@@ -883,8 +883,7 @@ static bool vgic_queue_irq(struct kvm_vcpu *vcpu, u8 sgi_source_id, int irq) | |||
883 | lr, irq, vgic_cpu->vgic_lr[lr]); | 883 | lr, irq, vgic_cpu->vgic_lr[lr]); |
884 | BUG_ON(!test_bit(lr, vgic_cpu->lr_used)); | 884 | BUG_ON(!test_bit(lr, vgic_cpu->lr_used)); |
885 | vgic_cpu->vgic_lr[lr] |= GICH_LR_PENDING_BIT; | 885 | vgic_cpu->vgic_lr[lr] |= GICH_LR_PENDING_BIT; |
886 | 886 | return true; | |
887 | goto out; | ||
888 | } | 887 | } |
889 | 888 | ||
890 | /* Try to use another LR for this interrupt */ | 889 | /* Try to use another LR for this interrupt */ |
@@ -898,7 +897,6 @@ static bool vgic_queue_irq(struct kvm_vcpu *vcpu, u8 sgi_source_id, int irq) | |||
898 | vgic_cpu->vgic_irq_lr_map[irq] = lr; | 897 | vgic_cpu->vgic_irq_lr_map[irq] = lr; |
899 | set_bit(lr, vgic_cpu->lr_used); | 898 | set_bit(lr, vgic_cpu->lr_used); |
900 | 899 | ||
901 | out: | ||
902 | if (!vgic_irq_is_edge(vcpu, irq)) | 900 | if (!vgic_irq_is_edge(vcpu, irq)) |
903 | vgic_cpu->vgic_lr[lr] |= GICH_LR_EOI; | 901 | vgic_cpu->vgic_lr[lr] |= GICH_LR_EOI; |
904 | 902 | ||
@@ -1018,21 +1016,6 @@ static bool vgic_process_maintenance(struct kvm_vcpu *vcpu) | |||
1018 | 1016 | ||
1019 | kvm_debug("MISR = %08x\n", vgic_cpu->vgic_misr); | 1017 | kvm_debug("MISR = %08x\n", vgic_cpu->vgic_misr); |
1020 | 1018 | ||
1021 | /* | ||
1022 | * We do not need to take the distributor lock here, since the only | ||
1023 | * action we perform is clearing the irq_active_bit for an EOIed | ||
1024 | * level interrupt. There is a potential race with | ||
1025 | * the queuing of an interrupt in __kvm_vgic_flush_hwstate(), where we | ||
1026 | * check if the interrupt is already active. Two possibilities: | ||
1027 | * | ||
1028 | * - The queuing is occurring on the same vcpu: cannot happen, | ||
1029 | * as we're already in the context of this vcpu, and | ||
1030 | * executing the handler | ||
1031 | * - The interrupt has been migrated to another vcpu, and we | ||
1032 | * ignore this interrupt for this run. Big deal. It is still | ||
1033 | * pending though, and will get considered when this vcpu | ||
1034 | * exits. | ||
1035 | */ | ||
1036 | if (vgic_cpu->vgic_misr & GICH_MISR_EOI) { | 1019 | if (vgic_cpu->vgic_misr & GICH_MISR_EOI) { |
1037 | /* | 1020 | /* |
1038 | * Some level interrupts have been EOIed. Clear their | 1021 | * Some level interrupts have been EOIed. Clear their |
@@ -1054,6 +1037,13 @@ static bool vgic_process_maintenance(struct kvm_vcpu *vcpu) | |||
1054 | } else { | 1037 | } else { |
1055 | vgic_cpu_irq_clear(vcpu, irq); | 1038 | vgic_cpu_irq_clear(vcpu, irq); |
1056 | } | 1039 | } |
1040 | |||
1041 | /* | ||
1042 | * Despite being EOIed, the LR may not have | ||
1043 | * been marked as empty. | ||
1044 | */ | ||
1045 | set_bit(lr, (unsigned long *)vgic_cpu->vgic_elrsr); | ||
1046 | vgic_cpu->vgic_lr[lr] &= ~GICH_LR_ACTIVE_BIT; | ||
1057 | } | 1047 | } |
1058 | } | 1048 | } |
1059 | 1049 | ||
@@ -1064,9 +1054,8 @@ static bool vgic_process_maintenance(struct kvm_vcpu *vcpu) | |||
1064 | } | 1054 | } |
1065 | 1055 | ||
1066 | /* | 1056 | /* |
1067 | * Sync back the VGIC state after a guest run. We do not really touch | 1057 | * Sync back the VGIC state after a guest run. The distributor lock is |
1068 | * the distributor here (the irq_pending_on_cpu bit is safe to set), | 1058 | * needed so we don't get preempted in the middle of the state processing. |
1069 | * so there is no need for taking its lock. | ||
1070 | */ | 1059 | */ |
1071 | static void __kvm_vgic_sync_hwstate(struct kvm_vcpu *vcpu) | 1060 | static void __kvm_vgic_sync_hwstate(struct kvm_vcpu *vcpu) |
1072 | { | 1061 | { |
@@ -1112,10 +1101,14 @@ void kvm_vgic_flush_hwstate(struct kvm_vcpu *vcpu) | |||
1112 | 1101 | ||
1113 | void kvm_vgic_sync_hwstate(struct kvm_vcpu *vcpu) | 1102 | void kvm_vgic_sync_hwstate(struct kvm_vcpu *vcpu) |
1114 | { | 1103 | { |
1104 | struct vgic_dist *dist = &vcpu->kvm->arch.vgic; | ||
1105 | |||
1115 | if (!irqchip_in_kernel(vcpu->kvm)) | 1106 | if (!irqchip_in_kernel(vcpu->kvm)) |
1116 | return; | 1107 | return; |
1117 | 1108 | ||
1109 | spin_lock(&dist->lock); | ||
1118 | __kvm_vgic_sync_hwstate(vcpu); | 1110 | __kvm_vgic_sync_hwstate(vcpu); |
1111 | spin_unlock(&dist->lock); | ||
1119 | } | 1112 | } |
1120 | 1113 | ||
1121 | int kvm_vgic_vcpu_pending_irq(struct kvm_vcpu *vcpu) | 1114 | int kvm_vgic_vcpu_pending_irq(struct kvm_vcpu *vcpu) |
diff --git a/arch/arm/lib/delay.c b/arch/arm/lib/delay.c index 6b93f6a1a3c7..64dbfa57204a 100644 --- a/arch/arm/lib/delay.c +++ b/arch/arm/lib/delay.c | |||
@@ -58,7 +58,7 @@ static void __timer_delay(unsigned long cycles) | |||
58 | static void __timer_const_udelay(unsigned long xloops) | 58 | static void __timer_const_udelay(unsigned long xloops) |
59 | { | 59 | { |
60 | unsigned long long loops = xloops; | 60 | unsigned long long loops = xloops; |
61 | loops *= loops_per_jiffy; | 61 | loops *= arm_delay_ops.ticks_per_jiffy; |
62 | __timer_delay(loops >> UDELAY_SHIFT); | 62 | __timer_delay(loops >> UDELAY_SHIFT); |
63 | } | 63 | } |
64 | 64 | ||
@@ -73,11 +73,13 @@ void __init register_current_timer_delay(const struct delay_timer *timer) | |||
73 | pr_info("Switching to timer-based delay loop\n"); | 73 | pr_info("Switching to timer-based delay loop\n"); |
74 | delay_timer = timer; | 74 | delay_timer = timer; |
75 | lpj_fine = timer->freq / HZ; | 75 | lpj_fine = timer->freq / HZ; |
76 | loops_per_jiffy = lpj_fine; | 76 | |
77 | /* cpufreq may scale loops_per_jiffy, so keep a private copy */ | ||
78 | arm_delay_ops.ticks_per_jiffy = lpj_fine; | ||
77 | arm_delay_ops.delay = __timer_delay; | 79 | arm_delay_ops.delay = __timer_delay; |
78 | arm_delay_ops.const_udelay = __timer_const_udelay; | 80 | arm_delay_ops.const_udelay = __timer_const_udelay; |
79 | arm_delay_ops.udelay = __timer_udelay; | 81 | arm_delay_ops.udelay = __timer_udelay; |
80 | arm_delay_ops.const_clock = true; | 82 | |
81 | delay_calibrated = true; | 83 | delay_calibrated = true; |
82 | } else { | 84 | } else { |
83 | pr_info("Ignoring duplicate/late registration of read_current_timer delay\n"); | 85 | pr_info("Ignoring duplicate/late registration of read_current_timer delay\n"); |
diff --git a/arch/arm/mm/cache-l2x0.c b/arch/arm/mm/cache-l2x0.c index c2f37390308a..c465faca51b0 100644 --- a/arch/arm/mm/cache-l2x0.c +++ b/arch/arm/mm/cache-l2x0.c | |||
@@ -299,7 +299,7 @@ static void l2x0_unlock(u32 cache_id) | |||
299 | int lockregs; | 299 | int lockregs; |
300 | int i; | 300 | int i; |
301 | 301 | ||
302 | switch (cache_id) { | 302 | switch (cache_id & L2X0_CACHE_ID_PART_MASK) { |
303 | case L2X0_CACHE_ID_PART_L310: | 303 | case L2X0_CACHE_ID_PART_L310: |
304 | lockregs = 8; | 304 | lockregs = 8; |
305 | break; | 305 | break; |
@@ -333,15 +333,14 @@ void __init l2x0_init(void __iomem *base, u32 aux_val, u32 aux_mask) | |||
333 | if (cache_id_part_number_from_dt) | 333 | if (cache_id_part_number_from_dt) |
334 | cache_id = cache_id_part_number_from_dt; | 334 | cache_id = cache_id_part_number_from_dt; |
335 | else | 335 | else |
336 | cache_id = readl_relaxed(l2x0_base + L2X0_CACHE_ID) | 336 | cache_id = readl_relaxed(l2x0_base + L2X0_CACHE_ID); |
337 | & L2X0_CACHE_ID_PART_MASK; | ||
338 | aux = readl_relaxed(l2x0_base + L2X0_AUX_CTRL); | 337 | aux = readl_relaxed(l2x0_base + L2X0_AUX_CTRL); |
339 | 338 | ||
340 | aux &= aux_mask; | 339 | aux &= aux_mask; |
341 | aux |= aux_val; | 340 | aux |= aux_val; |
342 | 341 | ||
343 | /* Determine the number of ways */ | 342 | /* Determine the number of ways */ |
344 | switch (cache_id) { | 343 | switch (cache_id & L2X0_CACHE_ID_PART_MASK) { |
345 | case L2X0_CACHE_ID_PART_L310: | 344 | case L2X0_CACHE_ID_PART_L310: |
346 | if (aux & (1 << 16)) | 345 | if (aux & (1 << 16)) |
347 | ways = 16; | 346 | ways = 16; |
@@ -725,7 +724,6 @@ static const struct l2x0_of_data pl310_data = { | |||
725 | .flush_all = l2x0_flush_all, | 724 | .flush_all = l2x0_flush_all, |
726 | .inv_all = l2x0_inv_all, | 725 | .inv_all = l2x0_inv_all, |
727 | .disable = l2x0_disable, | 726 | .disable = l2x0_disable, |
728 | .set_debug = pl310_set_debug, | ||
729 | }, | 727 | }, |
730 | }; | 728 | }; |
731 | 729 | ||
@@ -814,9 +812,8 @@ int __init l2x0_of_init(u32 aux_val, u32 aux_mask) | |||
814 | data->save(); | 812 | data->save(); |
815 | 813 | ||
816 | of_init = true; | 814 | of_init = true; |
817 | l2x0_init(l2x0_base, aux_val, aux_mask); | ||
818 | |||
819 | memcpy(&outer_cache, &data->outer_cache, sizeof(outer_cache)); | 815 | memcpy(&outer_cache, &data->outer_cache, sizeof(outer_cache)); |
816 | l2x0_init(l2x0_base, aux_val, aux_mask); | ||
820 | 817 | ||
821 | return 0; | 818 | return 0; |
822 | } | 819 | } |
diff --git a/arch/arm/mm/context.c b/arch/arm/mm/context.c index a5a4b2bc42ba..2ac37372ef52 100644 --- a/arch/arm/mm/context.c +++ b/arch/arm/mm/context.c | |||
@@ -48,7 +48,7 @@ static DEFINE_RAW_SPINLOCK(cpu_asid_lock); | |||
48 | static atomic64_t asid_generation = ATOMIC64_INIT(ASID_FIRST_VERSION); | 48 | static atomic64_t asid_generation = ATOMIC64_INIT(ASID_FIRST_VERSION); |
49 | static DECLARE_BITMAP(asid_map, NUM_USER_ASIDS); | 49 | static DECLARE_BITMAP(asid_map, NUM_USER_ASIDS); |
50 | 50 | ||
51 | static DEFINE_PER_CPU(atomic64_t, active_asids); | 51 | DEFINE_PER_CPU(atomic64_t, active_asids); |
52 | static DEFINE_PER_CPU(u64, reserved_asids); | 52 | static DEFINE_PER_CPU(u64, reserved_asids); |
53 | static cpumask_t tlb_flush_pending; | 53 | static cpumask_t tlb_flush_pending; |
54 | 54 | ||
@@ -215,6 +215,7 @@ void check_and_switch_context(struct mm_struct *mm, struct task_struct *tsk) | |||
215 | if (cpumask_test_and_clear_cpu(cpu, &tlb_flush_pending)) { | 215 | if (cpumask_test_and_clear_cpu(cpu, &tlb_flush_pending)) { |
216 | local_flush_bp_all(); | 216 | local_flush_bp_all(); |
217 | local_flush_tlb_all(); | 217 | local_flush_tlb_all(); |
218 | dummy_flush_tlb_a15_erratum(); | ||
218 | } | 219 | } |
219 | 220 | ||
220 | atomic64_set(&per_cpu(active_asids, cpu), asid); | 221 | atomic64_set(&per_cpu(active_asids, cpu), asid); |
diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c index e95a996ab78f..78978945492a 100644 --- a/arch/arm/mm/mmu.c +++ b/arch/arm/mm/mmu.c | |||
@@ -598,39 +598,60 @@ static void __init alloc_init_pte(pmd_t *pmd, unsigned long addr, | |||
598 | } while (pte++, addr += PAGE_SIZE, addr != end); | 598 | } while (pte++, addr += PAGE_SIZE, addr != end); |
599 | } | 599 | } |
600 | 600 | ||
601 | static void __init alloc_init_section(pud_t *pud, unsigned long addr, | 601 | static void __init map_init_section(pmd_t *pmd, unsigned long addr, |
602 | unsigned long end, phys_addr_t phys, | 602 | unsigned long end, phys_addr_t phys, |
603 | const struct mem_type *type) | 603 | const struct mem_type *type) |
604 | { | 604 | { |
605 | pmd_t *pmd = pmd_offset(pud, addr); | 605 | #ifndef CONFIG_ARM_LPAE |
606 | |||
607 | /* | 606 | /* |
608 | * Try a section mapping - end, addr and phys must all be aligned | 607 | * In classic MMU format, puds and pmds are folded in to |
609 | * to a section boundary. Note that PMDs refer to the individual | 608 | * the pgds. pmd_offset gives the PGD entry. PGDs refer to a |
610 | * L1 entries, whereas PGDs refer to a group of L1 entries making | 609 | * group of L1 entries making up one logical pointer to |
611 | * up one logical pointer to an L2 table. | 610 | * an L2 table (2MB), where as PMDs refer to the individual |
611 | * L1 entries (1MB). Hence increment to get the correct | ||
612 | * offset for odd 1MB sections. | ||
613 | * (See arch/arm/include/asm/pgtable-2level.h) | ||
612 | */ | 614 | */ |
613 | if (type->prot_sect && ((addr | end | phys) & ~SECTION_MASK) == 0) { | 615 | if (addr & SECTION_SIZE) |
614 | pmd_t *p = pmd; | 616 | pmd++; |
615 | |||
616 | #ifndef CONFIG_ARM_LPAE | ||
617 | if (addr & SECTION_SIZE) | ||
618 | pmd++; | ||
619 | #endif | 617 | #endif |
618 | do { | ||
619 | *pmd = __pmd(phys | type->prot_sect); | ||
620 | phys += SECTION_SIZE; | ||
621 | } while (pmd++, addr += SECTION_SIZE, addr != end); | ||
620 | 622 | ||
621 | do { | 623 | flush_pmd_entry(pmd); |
622 | *pmd = __pmd(phys | type->prot_sect); | 624 | } |
623 | phys += SECTION_SIZE; | ||
624 | } while (pmd++, addr += SECTION_SIZE, addr != end); | ||
625 | 625 | ||
626 | flush_pmd_entry(p); | 626 | static void __init alloc_init_pmd(pud_t *pud, unsigned long addr, |
627 | } else { | 627 | unsigned long end, phys_addr_t phys, |
628 | const struct mem_type *type) | ||
629 | { | ||
630 | pmd_t *pmd = pmd_offset(pud, addr); | ||
631 | unsigned long next; | ||
632 | |||
633 | do { | ||
628 | /* | 634 | /* |
629 | * No need to loop; pte's aren't interested in the | 635 | * With LPAE, we must loop over to map |
630 | * individual L1 entries. | 636 | * all the pmds for the given range. |
631 | */ | 637 | */ |
632 | alloc_init_pte(pmd, addr, end, __phys_to_pfn(phys), type); | 638 | next = pmd_addr_end(addr, end); |
633 | } | 639 | |
640 | /* | ||
641 | * Try a section mapping - addr, next and phys must all be | ||
642 | * aligned to a section boundary. | ||
643 | */ | ||
644 | if (type->prot_sect && | ||
645 | ((addr | next | phys) & ~SECTION_MASK) == 0) { | ||
646 | map_init_section(pmd, addr, next, phys, type); | ||
647 | } else { | ||
648 | alloc_init_pte(pmd, addr, next, | ||
649 | __phys_to_pfn(phys), type); | ||
650 | } | ||
651 | |||
652 | phys += next - addr; | ||
653 | |||
654 | } while (pmd++, addr = next, addr != end); | ||
634 | } | 655 | } |
635 | 656 | ||
636 | static void __init alloc_init_pud(pgd_t *pgd, unsigned long addr, | 657 | static void __init alloc_init_pud(pgd_t *pgd, unsigned long addr, |
@@ -641,7 +662,7 @@ static void __init alloc_init_pud(pgd_t *pgd, unsigned long addr, | |||
641 | 662 | ||
642 | do { | 663 | do { |
643 | next = pud_addr_end(addr, end); | 664 | next = pud_addr_end(addr, end); |
644 | alloc_init_section(pud, addr, next, phys, type); | 665 | alloc_init_pmd(pud, addr, next, phys, type); |
645 | phys += next - addr; | 666 | phys += next - addr; |
646 | } while (pud++, addr = next, addr != end); | 667 | } while (pud++, addr = next, addr != end); |
647 | } | 668 | } |
diff --git a/arch/arm/mm/proc-v7.S b/arch/arm/mm/proc-v7.S index 3a3c015f8d5c..f584d3f5b37c 100644 --- a/arch/arm/mm/proc-v7.S +++ b/arch/arm/mm/proc-v7.S | |||
@@ -420,7 +420,7 @@ __v7_pj4b_proc_info: | |||
420 | __v7_ca7mp_proc_info: | 420 | __v7_ca7mp_proc_info: |
421 | .long 0x410fc070 | 421 | .long 0x410fc070 |
422 | .long 0xff0ffff0 | 422 | .long 0xff0ffff0 |
423 | __v7_proc __v7_ca7mp_setup, hwcaps = HWCAP_IDIV | 423 | __v7_proc __v7_ca7mp_setup |
424 | .size __v7_ca7mp_proc_info, . - __v7_ca7mp_proc_info | 424 | .size __v7_ca7mp_proc_info, . - __v7_ca7mp_proc_info |
425 | 425 | ||
426 | /* | 426 | /* |
@@ -430,10 +430,25 @@ __v7_ca7mp_proc_info: | |||
430 | __v7_ca15mp_proc_info: | 430 | __v7_ca15mp_proc_info: |
431 | .long 0x410fc0f0 | 431 | .long 0x410fc0f0 |
432 | .long 0xff0ffff0 | 432 | .long 0xff0ffff0 |
433 | __v7_proc __v7_ca15mp_setup, hwcaps = HWCAP_IDIV | 433 | __v7_proc __v7_ca15mp_setup |
434 | .size __v7_ca15mp_proc_info, . - __v7_ca15mp_proc_info | 434 | .size __v7_ca15mp_proc_info, . - __v7_ca15mp_proc_info |
435 | 435 | ||
436 | /* | 436 | /* |
437 | * Qualcomm Inc. Krait processors. | ||
438 | */ | ||
439 | .type __krait_proc_info, #object | ||
440 | __krait_proc_info: | ||
441 | .long 0x510f0400 @ Required ID value | ||
442 | .long 0xff0ffc00 @ Mask for ID | ||
443 | /* | ||
444 | * Some Krait processors don't indicate support for SDIV and UDIV | ||
445 | * instructions in the ARM instruction set, even though they actually | ||
446 | * do support them. | ||
447 | */ | ||
448 | __v7_proc __v7_setup, hwcaps = HWCAP_IDIV | ||
449 | .size __krait_proc_info, . - __krait_proc_info | ||
450 | |||
451 | /* | ||
437 | * Match any ARMv7 processor core. | 452 | * Match any ARMv7 processor core. |
438 | */ | 453 | */ |
439 | .type __v7_proc_info, #object | 454 | .type __v7_proc_info, #object |
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index a6fdd1643903..51244bf97271 100644 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig | |||
@@ -657,7 +657,7 @@ config SNI_RM | |||
657 | bool "SNI RM200/300/400" | 657 | bool "SNI RM200/300/400" |
658 | select FW_ARC if CPU_LITTLE_ENDIAN | 658 | select FW_ARC if CPU_LITTLE_ENDIAN |
659 | select FW_ARC32 if CPU_LITTLE_ENDIAN | 659 | select FW_ARC32 if CPU_LITTLE_ENDIAN |
660 | select SNIPROM if CPU_BIG_ENDIAN | 660 | select FW_SNIPROM if CPU_BIG_ENDIAN |
661 | select ARCH_MAY_HAVE_PC_FDC | 661 | select ARCH_MAY_HAVE_PC_FDC |
662 | select BOOT_ELF32 | 662 | select BOOT_ELF32 |
663 | select CEVT_R4K | 663 | select CEVT_R4K |
@@ -1144,7 +1144,7 @@ config DEFAULT_SGI_PARTITION | |||
1144 | config FW_ARC32 | 1144 | config FW_ARC32 |
1145 | bool | 1145 | bool |
1146 | 1146 | ||
1147 | config SNIPROM | 1147 | config FW_SNIPROM |
1148 | bool | 1148 | bool |
1149 | 1149 | ||
1150 | config BOOT_ELF32 | 1150 | config BOOT_ELF32 |
diff --git a/arch/mips/cavium-octeon/setup.c b/arch/mips/cavium-octeon/setup.c index c594a3d4f743..b0baa299f899 100644 --- a/arch/mips/cavium-octeon/setup.c +++ b/arch/mips/cavium-octeon/setup.c | |||
@@ -174,7 +174,10 @@ static int octeon_kexec_prepare(struct kimage *image) | |||
174 | 174 | ||
175 | static void octeon_generic_shutdown(void) | 175 | static void octeon_generic_shutdown(void) |
176 | { | 176 | { |
177 | int cpu, i; | 177 | int i; |
178 | #ifdef CONFIG_SMP | ||
179 | int cpu; | ||
180 | #endif | ||
178 | struct cvmx_bootmem_desc *bootmem_desc; | 181 | struct cvmx_bootmem_desc *bootmem_desc; |
179 | void *named_block_array_ptr; | 182 | void *named_block_array_ptr; |
180 | 183 | ||
diff --git a/arch/mips/include/uapi/asm/signal.h b/arch/mips/include/uapi/asm/signal.h index d6b18b4d0f3a..addb9f556b71 100644 --- a/arch/mips/include/uapi/asm/signal.h +++ b/arch/mips/include/uapi/asm/signal.h | |||
@@ -72,6 +72,12 @@ typedef unsigned long old_sigset_t; /* at least 32 bits */ | |||
72 | * | 72 | * |
73 | * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single | 73 | * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single |
74 | * Unix names RESETHAND and NODEFER respectively. | 74 | * Unix names RESETHAND and NODEFER respectively. |
75 | * | ||
76 | * SA_RESTORER used to be defined as 0x04000000 but only the O32 ABI ever | ||
77 | * supported its use and no libc was using it, so the entire sa-restorer | ||
78 | * functionality was removed with lmo commit 39bffc12c3580ab for 2.5.48 | ||
79 | * retaining only the SA_RESTORER definition as a reminder to avoid | ||
80 | * accidental reuse of the mask bit. | ||
75 | */ | 81 | */ |
76 | #define SA_ONSTACK 0x08000000 | 82 | #define SA_ONSTACK 0x08000000 |
77 | #define SA_RESETHAND 0x80000000 | 83 | #define SA_RESETHAND 0x80000000 |
@@ -84,8 +90,6 @@ typedef unsigned long old_sigset_t; /* at least 32 bits */ | |||
84 | #define SA_NOMASK SA_NODEFER | 90 | #define SA_NOMASK SA_NODEFER |
85 | #define SA_ONESHOT SA_RESETHAND | 91 | #define SA_ONESHOT SA_RESETHAND |
86 | 92 | ||
87 | #define SA_RESTORER 0x04000000 /* Only for o32 */ | ||
88 | |||
89 | #define MINSIGSTKSZ 2048 | 93 | #define MINSIGSTKSZ 2048 |
90 | #define SIGSTKSZ 8192 | 94 | #define SIGSTKSZ 8192 |
91 | 95 | ||
diff --git a/arch/mips/kernel/cpu-probe.c b/arch/mips/kernel/cpu-probe.c index d069a19112e8..5fe66a0c3224 100644 --- a/arch/mips/kernel/cpu-probe.c +++ b/arch/mips/kernel/cpu-probe.c | |||
@@ -1227,10 +1227,8 @@ __cpuinit void cpu_probe(void) | |||
1227 | if (c->options & MIPS_CPU_FPU) { | 1227 | if (c->options & MIPS_CPU_FPU) { |
1228 | c->fpu_id = cpu_get_fpu_id(); | 1228 | c->fpu_id = cpu_get_fpu_id(); |
1229 | 1229 | ||
1230 | if (c->isa_level == MIPS_CPU_ISA_M32R1 || | 1230 | if (c->isa_level & (MIPS_CPU_ISA_M32R1 | MIPS_CPU_ISA_M32R2 | |
1231 | c->isa_level == MIPS_CPU_ISA_M32R2 || | 1231 | MIPS_CPU_ISA_M64R1 | MIPS_CPU_ISA_M64R2)) { |
1232 | c->isa_level == MIPS_CPU_ISA_M64R1 || | ||
1233 | c->isa_level == MIPS_CPU_ISA_M64R2) { | ||
1234 | if (c->fpu_id & MIPS_FPIR_3D) | 1232 | if (c->fpu_id & MIPS_FPIR_3D) |
1235 | c->ases |= MIPS_ASE_MIPS3D; | 1233 | c->ases |= MIPS_ASE_MIPS3D; |
1236 | } | 1234 | } |
diff --git a/arch/mips/kernel/mcount.S b/arch/mips/kernel/mcount.S index 165867673357..33d067148e61 100644 --- a/arch/mips/kernel/mcount.S +++ b/arch/mips/kernel/mcount.S | |||
@@ -46,10 +46,9 @@ | |||
46 | PTR_L a5, PT_R9(sp) | 46 | PTR_L a5, PT_R9(sp) |
47 | PTR_L a6, PT_R10(sp) | 47 | PTR_L a6, PT_R10(sp) |
48 | PTR_L a7, PT_R11(sp) | 48 | PTR_L a7, PT_R11(sp) |
49 | #else | ||
50 | PTR_ADDIU sp, PT_SIZE | ||
51 | #endif | 49 | #endif |
52 | .endm | 50 | PTR_ADDIU sp, PT_SIZE |
51 | .endm | ||
53 | 52 | ||
54 | .macro RETURN_BACK | 53 | .macro RETURN_BACK |
55 | jr ra | 54 | jr ra |
@@ -68,7 +67,11 @@ NESTED(ftrace_caller, PT_SIZE, ra) | |||
68 | .globl _mcount | 67 | .globl _mcount |
69 | _mcount: | 68 | _mcount: |
70 | b ftrace_stub | 69 | b ftrace_stub |
71 | addiu sp,sp,8 | 70 | #ifdef CONFIG_32BIT |
71 | addiu sp,sp,8 | ||
72 | #else | ||
73 | nop | ||
74 | #endif | ||
72 | 75 | ||
73 | /* When tracing is activated, it calls ftrace_caller+8 (aka here) */ | 76 | /* When tracing is activated, it calls ftrace_caller+8 (aka here) */ |
74 | lw t1, function_trace_stop | 77 | lw t1, function_trace_stop |
diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c index a200b5bdbb87..c3abb88170fc 100644 --- a/arch/mips/kernel/traps.c +++ b/arch/mips/kernel/traps.c | |||
@@ -1571,7 +1571,7 @@ void __cpuinit per_cpu_trap_init(bool is_boot_cpu) | |||
1571 | #ifdef CONFIG_64BIT | 1571 | #ifdef CONFIG_64BIT |
1572 | status_set |= ST0_FR|ST0_KX|ST0_SX|ST0_UX; | 1572 | status_set |= ST0_FR|ST0_KX|ST0_SX|ST0_UX; |
1573 | #endif | 1573 | #endif |
1574 | if (current_cpu_data.isa_level == MIPS_CPU_ISA_IV) | 1574 | if (current_cpu_data.isa_level & MIPS_CPU_ISA_IV) |
1575 | status_set |= ST0_XX; | 1575 | status_set |= ST0_XX; |
1576 | if (cpu_has_dsp) | 1576 | if (cpu_has_dsp) |
1577 | status_set |= ST0_MX; | 1577 | status_set |= ST0_MX; |
diff --git a/arch/mips/mm/c-r4k.c b/arch/mips/mm/c-r4k.c index ecca559b8d7b..2078915eacb9 100644 --- a/arch/mips/mm/c-r4k.c +++ b/arch/mips/mm/c-r4k.c | |||
@@ -1247,10 +1247,8 @@ static void __cpuinit setup_scache(void) | |||
1247 | return; | 1247 | return; |
1248 | 1248 | ||
1249 | default: | 1249 | default: |
1250 | if (c->isa_level == MIPS_CPU_ISA_M32R1 || | 1250 | if (c->isa_level & (MIPS_CPU_ISA_M32R1 | MIPS_CPU_ISA_M32R2 | |
1251 | c->isa_level == MIPS_CPU_ISA_M32R2 || | 1251 | MIPS_CPU_ISA_M64R1 | MIPS_CPU_ISA_M64R2)) { |
1252 | c->isa_level == MIPS_CPU_ISA_M64R1 || | ||
1253 | c->isa_level == MIPS_CPU_ISA_M64R2) { | ||
1254 | #ifdef CONFIG_MIPS_CPU_SCACHE | 1252 | #ifdef CONFIG_MIPS_CPU_SCACHE |
1255 | if (mips_sc_init ()) { | 1253 | if (mips_sc_init ()) { |
1256 | scache_size = c->scache.ways * c->scache.sets * c->scache.linesz; | 1254 | scache_size = c->scache.ways * c->scache.sets * c->scache.linesz; |
diff --git a/arch/mips/mm/sc-mips.c b/arch/mips/mm/sc-mips.c index 93d937b4b1ba..df96da7e939b 100644 --- a/arch/mips/mm/sc-mips.c +++ b/arch/mips/mm/sc-mips.c | |||
@@ -98,10 +98,8 @@ static inline int __init mips_sc_probe(void) | |||
98 | c->scache.flags |= MIPS_CACHE_NOT_PRESENT; | 98 | c->scache.flags |= MIPS_CACHE_NOT_PRESENT; |
99 | 99 | ||
100 | /* Ignore anything but MIPSxx processors */ | 100 | /* Ignore anything but MIPSxx processors */ |
101 | if (c->isa_level != MIPS_CPU_ISA_M32R1 && | 101 | if (!(c->isa_level & (MIPS_CPU_ISA_M32R1 | MIPS_CPU_ISA_M32R2 | |
102 | c->isa_level != MIPS_CPU_ISA_M32R2 && | 102 | MIPS_CPU_ISA_M64R1 | MIPS_CPU_ISA_M64R2))) |
103 | c->isa_level != MIPS_CPU_ISA_M64R1 && | ||
104 | c->isa_level != MIPS_CPU_ISA_M64R2) | ||
105 | return 0; | 103 | return 0; |
106 | 104 | ||
107 | /* Does this MIPS32/MIPS64 CPU have a config2 register? */ | 105 | /* Does this MIPS32/MIPS64 CPU have a config2 register? */ |
diff --git a/arch/mips/pci/pci-alchemy.c b/arch/mips/pci/pci-alchemy.c index 38a80c83fd67..d1faece21b6a 100644 --- a/arch/mips/pci/pci-alchemy.c +++ b/arch/mips/pci/pci-alchemy.c | |||
@@ -19,7 +19,7 @@ | |||
19 | #include <asm/mach-au1x00/au1000.h> | 19 | #include <asm/mach-au1x00/au1000.h> |
20 | #include <asm/tlbmisc.h> | 20 | #include <asm/tlbmisc.h> |
21 | 21 | ||
22 | #ifdef CONFIG_DEBUG_PCI | 22 | #ifdef CONFIG_PCI_DEBUG |
23 | #define DBG(x...) printk(KERN_DEBUG x) | 23 | #define DBG(x...) printk(KERN_DEBUG x) |
24 | #else | 24 | #else |
25 | #define DBG(x...) do {} while (0) | 25 | #define DBG(x...) do {} while (0) |
@@ -162,7 +162,7 @@ static int config_access(unsigned char access_type, struct pci_bus *bus, | |||
162 | if (status & (1 << 29)) { | 162 | if (status & (1 << 29)) { |
163 | *data = 0xffffffff; | 163 | *data = 0xffffffff; |
164 | error = -1; | 164 | error = -1; |
165 | DBG("alchemy-pci: master abort on cfg access %d bus %d dev %d", | 165 | DBG("alchemy-pci: master abort on cfg access %d bus %d dev %d\n", |
166 | access_type, bus->number, device); | 166 | access_type, bus->number, device); |
167 | } else if ((status >> 28) & 0xf) { | 167 | } else if ((status >> 28) & 0xf) { |
168 | DBG("alchemy-pci: PCI ERR detected: dev %d, status %lx\n", | 168 | DBG("alchemy-pci: PCI ERR detected: dev %d, status %lx\n", |
diff --git a/arch/s390/include/asm/pgtable.h b/arch/s390/include/asm/pgtable.h index 4a2930844d43..4a5443118cfb 100644 --- a/arch/s390/include/asm/pgtable.h +++ b/arch/s390/include/asm/pgtable.h | |||
@@ -344,6 +344,7 @@ extern unsigned long MODULES_END; | |||
344 | #define _REGION3_ENTRY_CO 0x100 /* change-recording override */ | 344 | #define _REGION3_ENTRY_CO 0x100 /* change-recording override */ |
345 | 345 | ||
346 | /* Bits in the segment table entry */ | 346 | /* Bits in the segment table entry */ |
347 | #define _SEGMENT_ENTRY_ORIGIN_LARGE ~0xfffffUL /* large page address */ | ||
347 | #define _SEGMENT_ENTRY_ORIGIN ~0x7ffUL/* segment table origin */ | 348 | #define _SEGMENT_ENTRY_ORIGIN ~0x7ffUL/* segment table origin */ |
348 | #define _SEGMENT_ENTRY_RO 0x200 /* page protection bit */ | 349 | #define _SEGMENT_ENTRY_RO 0x200 /* page protection bit */ |
349 | #define _SEGMENT_ENTRY_INV 0x20 /* invalid segment table entry */ | 350 | #define _SEGMENT_ENTRY_INV 0x20 /* invalid segment table entry */ |
@@ -1531,7 +1532,8 @@ extern int s390_enable_sie(void); | |||
1531 | /* | 1532 | /* |
1532 | * No page table caches to initialise | 1533 | * No page table caches to initialise |
1533 | */ | 1534 | */ |
1534 | #define pgtable_cache_init() do { } while (0) | 1535 | static inline void pgtable_cache_init(void) { } |
1536 | static inline void check_pgt_cache(void) { } | ||
1535 | 1537 | ||
1536 | #include <asm-generic/pgtable.h> | 1538 | #include <asm-generic/pgtable.h> |
1537 | 1539 | ||
diff --git a/arch/s390/lib/uaccess_pt.c b/arch/s390/lib/uaccess_pt.c index dff631d34b45..466fb3383960 100644 --- a/arch/s390/lib/uaccess_pt.c +++ b/arch/s390/lib/uaccess_pt.c | |||
@@ -77,42 +77,69 @@ static size_t copy_in_kernel(size_t count, void __user *to, | |||
77 | * >= -4095 (IS_ERR_VALUE(x) returns true), a fault has occured and the address | 77 | * >= -4095 (IS_ERR_VALUE(x) returns true), a fault has occured and the address |
78 | * contains the (negative) exception code. | 78 | * contains the (negative) exception code. |
79 | */ | 79 | */ |
80 | static __always_inline unsigned long follow_table(struct mm_struct *mm, | 80 | #ifdef CONFIG_64BIT |
81 | unsigned long addr, int write) | 81 | static unsigned long follow_table(struct mm_struct *mm, |
82 | unsigned long address, int write) | ||
82 | { | 83 | { |
83 | pgd_t *pgd; | 84 | unsigned long *table = (unsigned long *)__pa(mm->pgd); |
84 | pud_t *pud; | 85 | |
85 | pmd_t *pmd; | 86 | switch (mm->context.asce_bits & _ASCE_TYPE_MASK) { |
86 | pte_t *ptep; | 87 | case _ASCE_TYPE_REGION1: |
88 | table = table + ((address >> 53) & 0x7ff); | ||
89 | if (unlikely(*table & _REGION_ENTRY_INV)) | ||
90 | return -0x39UL; | ||
91 | table = (unsigned long *)(*table & _REGION_ENTRY_ORIGIN); | ||
92 | case _ASCE_TYPE_REGION2: | ||
93 | table = table + ((address >> 42) & 0x7ff); | ||
94 | if (unlikely(*table & _REGION_ENTRY_INV)) | ||
95 | return -0x3aUL; | ||
96 | table = (unsigned long *)(*table & _REGION_ENTRY_ORIGIN); | ||
97 | case _ASCE_TYPE_REGION3: | ||
98 | table = table + ((address >> 31) & 0x7ff); | ||
99 | if (unlikely(*table & _REGION_ENTRY_INV)) | ||
100 | return -0x3bUL; | ||
101 | table = (unsigned long *)(*table & _REGION_ENTRY_ORIGIN); | ||
102 | case _ASCE_TYPE_SEGMENT: | ||
103 | table = table + ((address >> 20) & 0x7ff); | ||
104 | if (unlikely(*table & _SEGMENT_ENTRY_INV)) | ||
105 | return -0x10UL; | ||
106 | if (unlikely(*table & _SEGMENT_ENTRY_LARGE)) { | ||
107 | if (write && (*table & _SEGMENT_ENTRY_RO)) | ||
108 | return -0x04UL; | ||
109 | return (*table & _SEGMENT_ENTRY_ORIGIN_LARGE) + | ||
110 | (address & ~_SEGMENT_ENTRY_ORIGIN_LARGE); | ||
111 | } | ||
112 | table = (unsigned long *)(*table & _SEGMENT_ENTRY_ORIGIN); | ||
113 | } | ||
114 | table = table + ((address >> 12) & 0xff); | ||
115 | if (unlikely(*table & _PAGE_INVALID)) | ||
116 | return -0x11UL; | ||
117 | if (write && (*table & _PAGE_RO)) | ||
118 | return -0x04UL; | ||
119 | return (*table & PAGE_MASK) + (address & ~PAGE_MASK); | ||
120 | } | ||
87 | 121 | ||
88 | pgd = pgd_offset(mm, addr); | 122 | #else /* CONFIG_64BIT */ |
89 | if (pgd_none(*pgd) || unlikely(pgd_bad(*pgd))) | ||
90 | return -0x3aUL; | ||
91 | 123 | ||
92 | pud = pud_offset(pgd, addr); | 124 | static unsigned long follow_table(struct mm_struct *mm, |
93 | if (pud_none(*pud) || unlikely(pud_bad(*pud))) | 125 | unsigned long address, int write) |
94 | return -0x3bUL; | 126 | { |
127 | unsigned long *table = (unsigned long *)__pa(mm->pgd); | ||
95 | 128 | ||
96 | pmd = pmd_offset(pud, addr); | 129 | table = table + ((address >> 20) & 0x7ff); |
97 | if (pmd_none(*pmd)) | 130 | if (unlikely(*table & _SEGMENT_ENTRY_INV)) |
98 | return -0x10UL; | 131 | return -0x10UL; |
99 | if (pmd_large(*pmd)) { | 132 | table = (unsigned long *)(*table & _SEGMENT_ENTRY_ORIGIN); |
100 | if (write && (pmd_val(*pmd) & _SEGMENT_ENTRY_RO)) | 133 | table = table + ((address >> 12) & 0xff); |
101 | return -0x04UL; | 134 | if (unlikely(*table & _PAGE_INVALID)) |
102 | return (pmd_val(*pmd) & HPAGE_MASK) + (addr & ~HPAGE_MASK); | ||
103 | } | ||
104 | if (unlikely(pmd_bad(*pmd))) | ||
105 | return -0x10UL; | ||
106 | |||
107 | ptep = pte_offset_map(pmd, addr); | ||
108 | if (!pte_present(*ptep)) | ||
109 | return -0x11UL; | 135 | return -0x11UL; |
110 | if (write && (!pte_write(*ptep) || !pte_dirty(*ptep))) | 136 | if (write && (*table & _PAGE_RO)) |
111 | return -0x04UL; | 137 | return -0x04UL; |
112 | 138 | return (*table & PAGE_MASK) + (address & ~PAGE_MASK); | |
113 | return (pte_val(*ptep) & PAGE_MASK) + (addr & ~PAGE_MASK); | ||
114 | } | 139 | } |
115 | 140 | ||
141 | #endif /* CONFIG_64BIT */ | ||
142 | |||
116 | static __always_inline size_t __user_copy_pt(unsigned long uaddr, void *kptr, | 143 | static __always_inline size_t __user_copy_pt(unsigned long uaddr, void *kptr, |
117 | size_t n, int write_user) | 144 | size_t n, int write_user) |
118 | { | 145 | { |
@@ -197,7 +224,7 @@ size_t copy_to_user_pt(size_t n, void __user *to, const void *from) | |||
197 | 224 | ||
198 | static size_t clear_user_pt(size_t n, void __user *to) | 225 | static size_t clear_user_pt(size_t n, void __user *to) |
199 | { | 226 | { |
200 | void *zpage = &empty_zero_page; | 227 | void *zpage = (void *) empty_zero_page; |
201 | long done, size, ret; | 228 | long done, size, ret; |
202 | 229 | ||
203 | done = 0; | 230 | done = 0; |