Skip to content

Commit 3b120ab

Browse files
committed
* 'fixes' of http://ftp.arm.linux.org.uk/pub/linux/arm/kernel/git-cur/linux-2.6-arm: ARM: 7182/1: ARM cpu topology: fix warning ARM: 7181/1: Restrict kprobes probing SWP instructions to ARMv5 and below ARM: 7180/1: Change kprobes testcase with unpredictable STRD instruction ARM: 7177/1: GIC: avoid skipping non-existent PPIs in irq_start calculation ARM: 7176/1: cpu_pm: register GIC PM notifier only once ARM: 7175/1: add subname parameter to mfp_set_groupg callers ARM: 7174/1: Fix build error in kprobes test code on Thumb2 kernels ARM: 7172/1: dma: Drop GFP_COMP for DMA memory allocations ARM: 7171/1: unwind: add unwind directives to bitops assembly macros ARM: 7170/2: fix compilation breakage in entry-armv.S ARM: 7168/1: use cache type functions for arch_get_unmapped_area ARM: perf: check that we have a platform device when reserving PMU ARM: 7166/1: Use PMD_SHIFT instead of PGDIR_SHIFT in dma-consistent.c ARM: 7165/2: PL330: Fix typo in _prepare_ccr() ARM: 7163/2: PL330: Only register usable channels ARM: 7162/1: errata: tidy up Kconfig options for PL310 errata workarounds ARM: 7161/1: errata: no automatic store buffer drain ARM: perf: initialise used_mask for fake PMU during validation ARM: PMU: remove pmu_init declaration ARM: PMU: re-export release_pmu symbol to modules
2 parents b930c26 + 4cbd6b1 commit 3b120ab

27 files changed

+199
-120
lines changed

arch/arm/Kconfig

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1231,7 +1231,7 @@ config ARM_ERRATA_742231
12311231
capabilities of the processor.
12321232

12331233
config PL310_ERRATA_588369
1234-
bool "Clean & Invalidate maintenance operations do not invalidate clean lines"
1234+
bool "PL310 errata: Clean & Invalidate maintenance operations do not invalidate clean lines"
12351235
depends on CACHE_L2X0
12361236
help
12371237
The PL310 L2 cache controller implements three types of Clean &
@@ -1256,7 +1256,7 @@ config ARM_ERRATA_720789
12561256
entries regardless of the ASID.
12571257

12581258
config PL310_ERRATA_727915
1259-
bool "Background Clean & Invalidate by Way operation can cause data corruption"
1259+
bool "PL310 errata: Background Clean & Invalidate by Way operation can cause data corruption"
12601260
depends on CACHE_L2X0
12611261
help
12621262
PL310 implements the Clean & Invalidate by Way L2 cache maintenance
@@ -1289,8 +1289,8 @@ config ARM_ERRATA_751472
12891289
operation is received by a CPU before the ICIALLUIS has completed,
12901290
potentially leading to corrupted entries in the cache or TLB.
12911291

1292-
config ARM_ERRATA_753970
1293-
bool "ARM errata: cache sync operation may be faulty"
1292+
config PL310_ERRATA_753970
1293+
bool "PL310 errata: cache sync operation may be faulty"
12941294
depends on CACHE_PL310
12951295
help
12961296
This option enables the workaround for the 753970 PL310 (r3p0) erratum.
@@ -1352,6 +1352,18 @@ config ARM_ERRATA_764369
13521352
relevant cache maintenance functions and sets a specific bit
13531353
in the diagnostic control register of the SCU.
13541354

1355+
config PL310_ERRATA_769419
1356+
bool "PL310 errata: no automatic Store Buffer drain"
1357+
depends on CACHE_L2X0
1358+
help
1359+
On revisions of the PL310 prior to r3p2, the Store Buffer does
1360+
not automatically drain. This can cause normal, non-cacheable
1361+
writes to be retained when the memory system is idle, leading
1362+
to suboptimal I/O performance for drivers using coherent DMA.
1363+
This option adds a write barrier to the cpu_idle loop so that,
1364+
on systems with an outer cache, the store buffer is drained
1365+
explicitly.
1366+
13551367
endmenu
13561368

13571369
source "arch/arm/common/Kconfig"

arch/arm/common/gic.c

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,8 @@ static void __init gic_pm_init(struct gic_chip_data *gic)
526526
sizeof(u32));
527527
BUG_ON(!gic->saved_ppi_conf);
528528

529-
cpu_pm_register_notifier(&gic_notifier_block);
529+
if (gic == &gic_data[0])
530+
cpu_pm_register_notifier(&gic_notifier_block);
530531
}
531532
#else
532533
static void __init gic_pm_init(struct gic_chip_data *gic)
@@ -581,13 +582,16 @@ void __init gic_init(unsigned int gic_nr, int irq_start,
581582
* For primary GICs, skip over SGIs.
582583
* For secondary GICs, skip over PPIs, too.
583584
*/
585+
domain->hwirq_base = 32;
584586
if (gic_nr == 0) {
585587
gic_cpu_base_addr = cpu_base;
586-
domain->hwirq_base = 16;
587-
if (irq_start > 0)
588-
irq_start = (irq_start & ~31) + 16;
589-
} else
590-
domain->hwirq_base = 32;
588+
589+
if ((irq_start & 31) > 0) {
590+
domain->hwirq_base = 16;
591+
if (irq_start != -1)
592+
irq_start = (irq_start & ~31) + 16;
593+
}
594+
}
591595

592596
/*
593597
* Find out how many interrupts are supported.

arch/arm/common/pl330.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1211,8 +1211,8 @@ static inline u32 _prepare_ccr(const struct pl330_reqcfg *rqc)
12111211
ccr |= (rqc->brst_size << CC_SRCBRSTSIZE_SHFT);
12121212
ccr |= (rqc->brst_size << CC_DSTBRSTSIZE_SHFT);
12131213

1214-
ccr |= (rqc->dcctl << CC_SRCCCTRL_SHFT);
1215-
ccr |= (rqc->scctl << CC_DSTCCTRL_SHFT);
1214+
ccr |= (rqc->scctl << CC_SRCCCTRL_SHFT);
1215+
ccr |= (rqc->dcctl << CC_DSTCCTRL_SHFT);
12161216

12171217
ccr |= (rqc->swap << CC_SWAP_SHFT);
12181218

@@ -1623,6 +1623,11 @@ static inline int _alloc_event(struct pl330_thread *thrd)
16231623
return -1;
16241624
}
16251625

1626+
static bool _chan_ns(const struct pl330_info *pi, int i)
1627+
{
1628+
return pi->pcfg.irq_ns & (1 << i);
1629+
}
1630+
16261631
/* Upon success, returns IdentityToken for the
16271632
* allocated channel, NULL otherwise.
16281633
*/
@@ -1647,7 +1652,8 @@ void *pl330_request_channel(const struct pl330_info *pi)
16471652

16481653
for (i = 0; i < chans; i++) {
16491654
thrd = &pl330->channels[i];
1650-
if (thrd->free) {
1655+
if ((thrd->free) && (!_manager_ns(thrd) ||
1656+
_chan_ns(pi, i))) {
16511657
thrd->ev = _alloc_event(thrd);
16521658
if (thrd->ev >= 0) {
16531659
thrd->free = false;

arch/arm/include/asm/pmu.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -55,16 +55,6 @@ reserve_pmu(enum arm_pmu_type type);
5555
extern void
5656
release_pmu(enum arm_pmu_type type);
5757

58-
/**
59-
* init_pmu() - Initialise the PMU.
60-
*
61-
* Initialise the system ready for PMU enabling. This should typically set the
62-
* IRQ affinity and nothing else. The users (oprofile/perf events etc) will do
63-
* the actual hardware initialisation.
64-
*/
65-
extern int
66-
init_pmu(enum arm_pmu_type type);
67-
6858
#else /* CONFIG_CPU_HAS_PMU */
6959

7060
#include <linux/err.h>

arch/arm/include/asm/topology.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ extern struct cputopo_arm cpu_topology[NR_CPUS];
2525

2626
void init_cpu_topology(void);
2727
void store_cpu_topology(unsigned int cpuid);
28-
const struct cpumask *cpu_coregroup_mask(unsigned int cpu);
28+
const struct cpumask *cpu_coregroup_mask(int cpu);
2929

3030
#else
3131

arch/arm/kernel/entry-armv.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@ ENDPROC(__und_usr)
497497
.popsection
498498
.pushsection __ex_table,"a"
499499
.long 1b, 4b
500-
#if __LINUX_ARM_ARCH__ >= 7
500+
#if CONFIG_ARM_THUMB && __LINUX_ARM_ARCH__ >= 6 && CONFIG_CPU_V7
501501
.long 2b, 4b
502502
.long 3b, 4b
503503
#endif

arch/arm/kernel/kprobes-arm.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -519,10 +519,12 @@ static const union decode_item arm_cccc_0000_____1001_table[] = {
519519
static const union decode_item arm_cccc_0001_____1001_table[] = {
520520
/* Synchronization primitives */
521521

522+
#if __LINUX_ARM_ARCH__ < 6
523+
/* Deprecated on ARMv6 and may be UNDEFINED on v7 */
522524
/* SMP/SWPB cccc 0001 0x00 xxxx xxxx xxxx 1001 xxxx */
523525
DECODE_EMULATEX (0x0fb000f0, 0x01000090, emulate_rd12rn16rm0_rwflags_nopc,
524526
REGS(NOPC, NOPC, 0, 0, NOPC)),
525-
527+
#endif
526528
/* LDREX/STREX{,D,B,H} cccc 0001 1xxx xxxx xxxx xxxx 1001 xxxx */
527529
/* And unallocated instructions... */
528530
DECODE_END

arch/arm/kernel/kprobes-test-arm.c

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -427,18 +427,25 @@ void kprobe_arm_test_cases(void)
427427

428428
TEST_GROUP("Synchronization primitives")
429429

430-
/*
431-
* Use hard coded constants for SWP instructions to avoid warnings
432-
* about deprecated instructions.
433-
*/
434-
TEST_RP( ".word 0xe108e097 @ swp lr, r",7,VAL2,", [r",8,0,"]")
435-
TEST_R( ".word 0x610d0091 @ swpvs r0, r",1,VAL1,", [sp]")
436-
TEST_RP( ".word 0xe10cd09e @ swp sp, r",14,VAL2,", [r",12,13*4,"]")
430+
#if __LINUX_ARM_ARCH__ < 6
431+
TEST_RP("swp lr, r",7,VAL2,", [r",8,0,"]")
432+
TEST_R( "swpvs r0, r",1,VAL1,", [sp]")
433+
TEST_RP("swp sp, r",14,VAL2,", [r",12,13*4,"]")
434+
#else
435+
TEST_UNSUPPORTED(".word 0xe108e097 @ swp lr, r7, [r8]")
436+
TEST_UNSUPPORTED(".word 0x610d0091 @ swpvs r0, r1, [sp]")
437+
TEST_UNSUPPORTED(".word 0xe10cd09e @ swp sp, r14 [r12]")
438+
#endif
437439
TEST_UNSUPPORTED(".word 0xe102f091 @ swp pc, r1, [r2]")
438440
TEST_UNSUPPORTED(".word 0xe102009f @ swp r0, pc, [r2]")
439441
TEST_UNSUPPORTED(".word 0xe10f0091 @ swp r0, r1, [pc]")
440-
TEST_RP( ".word 0xe148e097 @ swpb lr, r",7,VAL2,", [r",8,0,"]")
441-
TEST_R( ".word 0x614d0091 @ swpvsb r0, r",1,VAL1,", [sp]")
442+
#if __LINUX_ARM_ARCH__ < 6
443+
TEST_RP("swpb lr, r",7,VAL2,", [r",8,0,"]")
444+
TEST_R( "swpvsb r0, r",1,VAL1,", [sp]")
445+
#else
446+
TEST_UNSUPPORTED(".word 0xe148e097 @ swpb lr, r7, [r8]")
447+
TEST_UNSUPPORTED(".word 0x614d0091 @ swpvsb r0, r1, [sp]")
448+
#endif
442449
TEST_UNSUPPORTED(".word 0xe142f091 @ swpb pc, r1, [r2]")
443450

444451
TEST_UNSUPPORTED(".word 0xe1100090") /* Unallocated space */
@@ -550,7 +557,7 @@ void kprobe_arm_test_cases(void)
550557
TEST_RPR( "strccd r",8, VAL2,", [r",13,0, ", r",12,48,"]")
551558
TEST_RPR( "strd r",4, VAL1,", [r",2, 24,", r",3, 48,"]!")
552559
TEST_RPR( "strcsd r",12,VAL2,", [r",11,48,", -r",10,24,"]!")
553-
TEST_RPR( "strd r",2, VAL1,", [r",3, 24,"], r",4,48,"")
560+
TEST_RPR( "strd r",2, VAL1,", [r",5, 24,"], r",4,48,"")
554561
TEST_RPR( "strd r",10,VAL2,", [r",9, 48,"], -r",7,24,"")
555562
TEST_UNSUPPORTED(".word 0xe1afc0fa @ strd r12, [pc, r10]!")
556563

arch/arm/kernel/kprobes-test-thumb.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -222,8 +222,8 @@ void kprobe_thumb16_test_cases(void)
222222
DONT_TEST_IN_ITBLOCK(
223223
TEST_BF_R( "cbnz r",0,0, ", 2f")
224224
TEST_BF_R( "cbz r",2,-1,", 2f")
225-
TEST_BF_RX( "cbnz r",4,1, ", 2f",0x20)
226-
TEST_BF_RX( "cbz r",7,0, ", 2f",0x40)
225+
TEST_BF_RX( "cbnz r",4,1, ", 2f", SPACE_0x20)
226+
TEST_BF_RX( "cbz r",7,0, ", 2f", SPACE_0x40)
227227
)
228228
TEST_R("sxth r0, r",7, HH1,"")
229229
TEST_R("sxth r7, r",0, HH2,"")
@@ -246,7 +246,7 @@ DONT_TEST_IN_ITBLOCK(
246246
TESTCASE_START(code) \
247247
TEST_ARG_PTR(13, offset) \
248248
TEST_ARG_END("") \
249-
TEST_BRANCH_F(code,0) \
249+
TEST_BRANCH_F(code) \
250250
TESTCASE_END
251251

252252
TEST("push {r0}")
@@ -319,8 +319,8 @@ CONDITION_INSTRUCTIONS(8,
319319

320320
TEST_BF( "b 2f")
321321
TEST_BB( "b 2b")
322-
TEST_BF_X("b 2f", 0x400)
323-
TEST_BB_X("b 2b", 0x400)
322+
TEST_BF_X("b 2f", SPACE_0x400)
323+
TEST_BB_X("b 2b", SPACE_0x400)
324324

325325
TEST_GROUP("Testing instructions in IT blocks")
326326

@@ -746,7 +746,7 @@ CONDITION_INSTRUCTIONS(22,
746746
TEST_BB("bne.w 2b")
747747
TEST_BF("bgt.w 2f")
748748
TEST_BB("blt.w 2b")
749-
TEST_BF_X("bpl.w 2f",0x1000)
749+
TEST_BF_X("bpl.w 2f", SPACE_0x1000)
750750
)
751751

752752
TEST_UNSUPPORTED("msr cpsr, r0")
@@ -786,11 +786,11 @@ CONDITION_INSTRUCTIONS(22,
786786

787787
TEST_BF( "b.w 2f")
788788
TEST_BB( "b.w 2b")
789-
TEST_BF_X("b.w 2f", 0x1000)
789+
TEST_BF_X("b.w 2f", SPACE_0x1000)
790790

791791
TEST_BF( "bl.w 2f")
792792
TEST_BB( "bl.w 2b")
793-
TEST_BB_X("bl.w 2b", 0x1000)
793+
TEST_BB_X("bl.w 2b", SPACE_0x1000)
794794

795795
TEST_X( "blx __dummy_arm_subroutine",
796796
".arm \n\t"

0 commit comments

Comments
 (0)