Skip to content

Commit 66ade47

Browse files
committed
Merge branch 'fixes' of git://git.linaro.org/people/rmk/linux-arm
Pull ARM fixes from Russell King: "Another round of ARM fixes, which include: - Fixing a problem with LPAE mapping sections - Reporting of some hwcaps on Krait CPUs - Avoiding repetitive warnings in the breakpoint code - Fixing a build error noticed on Dove platforms with PJ4 CPUs - Fix masking of level 2 cache revision. - Fixing timer-based udelay() - A larger fix for an erratum causing people major grief with Cortex A15 CPUs" * 'fixes' of git://git.linaro.org/people/rmk/linux-arm: ARM: 7690/1: mm: fix CONFIG_LPAE typos ARM: 7689/1: add unwind annotations to ftrace asm ARM: 7685/1: delay: use private ticks_per_jiffy field for timer-based delay ops ARM: 7684/1: errata: Workaround for Cortex-A15 erratum 798181 (TLBI/DSB operations) ARM: 7682/1: cache-l2x0: fix masking of RTL revision numbering and set_debug init ARM: iWMMXt: always enable iWMMXt support with PJ4 CPUs ARM: 7681/1: hw_breakpoint: use warn_once to avoid spam from reset_ctrl_regs() ARM: 7678/1: Work around faulty ISAR0 register in some Krait CPUs ARM: 7680/1: Detect support for SDIV/UDIV from ISAR0 register ARM: 7679/1: Clear IDIVT hwcap if CONFIG_ARM_THUMB=n ARM: 7677/1: LPAE: Fix mapping in alloc_init_section for unaligned addresses ARM: KVM: vgic: take distributor lock on sync_hwstate path ARM: KVM: vgic: force EOIed LRs to the empty state
2 parents cbfa0e7 + 4e1db26 commit 66ade47

File tree

17 files changed

+230
-72
lines changed

17 files changed

+230
-72
lines changed

arch/arm/Kconfig

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1183,9 +1183,9 @@ config ARM_NR_BANKS
11831183
default 8
11841184

11851185
config IWMMXT
1186-
bool "Enable iWMMXt support"
1186+
bool "Enable iWMMXt support" if !CPU_PJ4
11871187
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
11891189
help
11901190
Enable support for iWMMXt context switching at run time if
11911191
running on a CPU that supports it.
@@ -1439,6 +1439,16 @@ config ARM_ERRATA_775420
14391439
to deadlock. This workaround puts DSB before executing ISB if
14401440
an abort may occur on cache maintenance.
14411441

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+
14421452
endmenu
14431453

14441454
source "arch/arm/common/Kconfig"

arch/arm/include/asm/delay.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ extern struct arm_delay_ops {
2424
void (*delay)(unsigned long);
2525
void (*const_udelay)(unsigned long);
2626
void (*udelay)(unsigned long);
27-
bool const_clock;
27+
unsigned long ticks_per_jiffy;
2828
} arm_delay_ops;
2929

3030
#define __delay(n) arm_delay_ops.delay(n)

arch/arm/include/asm/highmem.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,13 @@ extern void kunmap_high(struct page *page);
4141
#endif
4242
#endif
4343

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+
4451
#ifdef ARCH_NEEDS_KMAP_HIGH_GET
4552
extern void *kmap_high_get(struct page *page);
4653
#else

arch/arm/include/asm/mmu_context.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ void __check_vmalloc_seq(struct mm_struct *mm);
2727
void check_and_switch_context(struct mm_struct *mm, struct task_struct *tsk);
2828
#define init_new_context(tsk,mm) ({ atomic64_set(&mm->context.id, 0); 0; })
2929

30+
DECLARE_PER_CPU(atomic64_t, active_asids);
31+
3032
#else /* !CONFIG_CPU_HAS_ASID */
3133

3234
#ifdef CONFIG_MMU

arch/arm/include/asm/tlbflush.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -450,6 +450,21 @@ static inline void local_flush_bp_all(void)
450450
isb();
451451
}
452452

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+
453468
/*
454469
* flush_pmd_entry
455470
*

arch/arm/kernel/entry-common.S

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,13 @@ ENDPROC(ftrace_graph_caller_old)
276276
*/
277277

278278
.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)
279284
stmdb sp!, {r0-r3, lr}
285+
UNWIND(.save {r0-r3, lr})
280286
.endm
281287

282288
.macro mcount_get_lr reg
@@ -289,24 +295,30 @@ ENDPROC(ftrace_graph_caller_old)
289295
.endm
290296

291297
ENTRY(__gnu_mcount_nc)
298+
UNWIND(.fnstart)
292299
#ifdef CONFIG_DYNAMIC_FTRACE
293300
mov ip, lr
294301
ldmia sp!, {lr}
295302
mov pc, ip
296303
#else
297304
__mcount
298305
#endif
306+
UNWIND(.fnend)
299307
ENDPROC(__gnu_mcount_nc)
300308

301309
#ifdef CONFIG_DYNAMIC_FTRACE
302310
ENTRY(ftrace_caller)
311+
UNWIND(.fnstart)
303312
__ftrace_caller
313+
UNWIND(.fnend)
304314
ENDPROC(ftrace_caller)
305315
#endif
306316

307317
#ifdef CONFIG_FUNCTION_GRAPH_TRACER
308318
ENTRY(ftrace_graph_caller)
319+
UNWIND(.fnstart)
309320
__ftrace_graph_caller
321+
UNWIND(.fnend)
310322
ENDPROC(ftrace_graph_caller)
311323
#endif
312324

arch/arm/kernel/head.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ __create_page_tables:
267267
addne r6, r6, #1 << SECTION_SHIFT
268268
strne r6, [r3]
269269

270-
#if defined(CONFIG_LPAE) && defined(CONFIG_CPU_ENDIAN_BE8)
270+
#if defined(CONFIG_ARM_LPAE) && defined(CONFIG_CPU_ENDIAN_BE8)
271271
sub r4, r4, #4 @ Fixup page table pointer
272272
@ for 64-bit descriptors
273273
#endif

arch/arm/kernel/hw_breakpoint.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -966,7 +966,7 @@ static void reset_ctrl_regs(void *unused)
966966
}
967967

968968
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);
970970
cpumask_or(&debug_err_mask, &debug_err_mask, cpumask_of(cpu));
971971
return;
972972
}
@@ -987,7 +987,7 @@ static void reset_ctrl_regs(void *unused)
987987
isb();
988988

989989
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);
991991
return;
992992
}
993993

@@ -1007,7 +1007,7 @@ static void reset_ctrl_regs(void *unused)
10071007
}
10081008

10091009
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);
10111011
return;
10121012
}
10131013

arch/arm/kernel/setup.c

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,23 @@ void __init early_print(const char *str, ...)
353353
printk("%s", buf);
354354
}
355355

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+
356373
static void __init feat_v6_fixup(void)
357374
{
358375
int id = read_cpuid_id();
@@ -483,8 +500,11 @@ static void __init setup_processor(void)
483500
snprintf(elf_platform, ELF_PLATFORM_SIZE, "%s%c",
484501
list->elf_name, ENDIANNESS);
485502
elf_hwcap = list->elf_hwcap;
503+
504+
cpuid_init_hwcaps();
505+
486506
#ifndef CONFIG_ARM_THUMB
487-
elf_hwcap &= ~HWCAP_THUMB;
507+
elf_hwcap &= ~(HWCAP_THUMB | HWCAP_IDIVT);
488508
#endif
489509

490510
feat_v6_fixup();
@@ -524,7 +544,7 @@ int __init arm_add_memory(phys_addr_t start, phys_addr_t size)
524544
size -= start & ~PAGE_MASK;
525545
bank->start = PAGE_ALIGN(start);
526546

527-
#ifndef CONFIG_LPAE
547+
#ifndef CONFIG_ARM_LPAE
528548
if (bank->start + size < bank->start) {
529549
printk(KERN_CRIT "Truncating memory at 0x%08llx to fit in "
530550
"32-bit physical address space\n", (long long)start);

arch/arm/kernel/smp.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -673,9 +673,6 @@ static int cpufreq_callback(struct notifier_block *nb,
673673
if (freq->flags & CPUFREQ_CONST_LOOPS)
674674
return NOTIFY_OK;
675675

676-
if (arm_delay_ops.const_clock)
677-
return NOTIFY_OK;
678-
679676
if (!per_cpu(l_p_j_ref, cpu)) {
680677
per_cpu(l_p_j_ref, cpu) =
681678
per_cpu(cpu_data, cpu).loops_per_jiffy;

0 commit comments

Comments
 (0)