Skip to content

Commit f15bdfe

Browse files
author
Russell King
committed
Merge branch 'devel-stable' into for-next
Conflicts: arch/arm/kernel/perf_event_cpu.c
2 parents c89c3a6 + c70fbb0 commit f15bdfe

10 files changed

Lines changed: 362 additions & 1107 deletions

File tree

‎arch/arm/include/asm/memory.h‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,7 @@
9191
* of this define that was meant to.
9292
* Fortunately, there is no reference for this in noMMU mode, for now.
9393
*/
94-
#ifndef TASK_SIZE
95-
#define TASK_SIZE (CONFIG_DRAM_SIZE)
96-
#endif
94+
#define TASK_SIZE UL(0xffffffff)
9795

9896
#ifndef TASK_UNMAPPED_BASE
9997
#define TASK_UNMAPPED_BASE UL(0x00000000)

‎arch/arm/include/asm/perf_event.h‎

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,6 @@
1212
#ifndef __ARM_PERF_EVENT_H__
1313
#define __ARM_PERF_EVENT_H__
1414

15-
/*
16-
* The ARMv7 CPU PMU supports up to 32 event counters.
17-
*/
18-
#define ARMPMU_MAX_HWEVENTS 32
19-
20-
#define HW_OP_UNSUPPORTED 0xFFFF
21-
#define C(_x) PERF_COUNT_HW_CACHE_##_x
22-
#define CACHE_OP_UNSUPPORTED 0xFFFF
23-
2415
#ifdef CONFIG_HW_PERF_EVENTS
2516
struct pt_regs;
2617
extern unsigned long perf_instruction_pointer(struct pt_regs *regs);

‎arch/arm/include/asm/pmu.h‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,25 @@ struct arm_pmu_platdata {
4242

4343
#ifdef CONFIG_HW_PERF_EVENTS
4444

45+
/*
46+
* The ARMv7 CPU PMU supports up to 32 event counters.
47+
*/
48+
#define ARMPMU_MAX_HWEVENTS 32
49+
50+
#define HW_OP_UNSUPPORTED 0xFFFF
51+
#define C(_x) PERF_COUNT_HW_CACHE_##_x
52+
#define CACHE_OP_UNSUPPORTED 0xFFFF
53+
54+
#define PERF_MAP_ALL_UNSUPPORTED \
55+
[0 ... PERF_COUNT_HW_MAX - 1] = HW_OP_UNSUPPORTED
56+
57+
#define PERF_CACHE_MAP_ALL_UNSUPPORTED \
58+
[0 ... C(MAX) - 1] = { \
59+
[0 ... C(OP_MAX) - 1] = { \
60+
[0 ... C(RESULT_MAX) - 1] = CACHE_OP_UNSUPPORTED, \
61+
}, \
62+
}
63+
4564
/* The events for a given PMU register set. */
4665
struct pmu_hw_events {
4766
/*

‎arch/arm/include/asm/uaccess.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ static inline void set_fs(mm_segment_t fs)
242242
#define access_ok(type,addr,size) (__range_ok(addr,size) == 0)
243243

244244
#define user_addr_max() \
245-
(segment_eq(get_fs(), USER_DS) ? TASK_SIZE : ~0UL)
245+
(segment_eq(get_fs(), KERNEL_DS) ? ~0UL : get_fs())
246246

247247
/*
248248
* The "__xxx" versions of the user access functions do not verify the

‎arch/arm/kernel/perf_event.c‎

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -560,11 +560,16 @@ user_backtrace(struct frame_tail __user *tail,
560560
struct perf_callchain_entry *entry)
561561
{
562562
struct frame_tail buftail;
563+
unsigned long err;
563564

564-
/* Also check accessibility of one struct frame_tail beyond */
565565
if (!access_ok(VERIFY_READ, tail, sizeof(buftail)))
566566
return NULL;
567-
if (__copy_from_user_inatomic(&buftail, tail, sizeof(buftail)))
567+
568+
pagefault_disable();
569+
err = __copy_from_user_inatomic(&buftail, tail, sizeof(buftail));
570+
pagefault_enable();
571+
572+
if (err)
568573
return NULL;
569574

570575
perf_callchain_store(entry, buftail.lr);
@@ -590,6 +595,10 @@ perf_callchain_user(struct perf_callchain_entry *entry, struct pt_regs *regs)
590595
}
591596

592597
perf_callchain_store(entry, regs->ARM_pc);
598+
599+
if (!current->mm)
600+
return;
601+
593602
tail = (struct frame_tail __user *)regs->ARM_fp - 1;
594603

595604
while ((entry->nr < PERF_MAX_STACK_DEPTH) &&

‎arch/arm/kernel/perf_event_cpu.c‎

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -233,14 +233,17 @@ static struct of_device_id cpu_pmu_of_device_ids[] = {
233233
{.compatible = "arm,cortex-a7-pmu", .data = armv7_a7_pmu_init},
234234
{.compatible = "arm,cortex-a5-pmu", .data = armv7_a5_pmu_init},
235235
{.compatible = "arm,arm11mpcore-pmu", .data = armv6mpcore_pmu_init},
236-
{.compatible = "arm,arm1176-pmu", .data = armv6pmu_init},
237-
{.compatible = "arm,arm1136-pmu", .data = armv6pmu_init},
236+
{.compatible = "arm,arm1176-pmu", .data = armv6_1176_pmu_init},
237+
{.compatible = "arm,arm1136-pmu", .data = armv6_1136_pmu_init},
238238
{.compatible = "qcom,krait-pmu", .data = krait_pmu_init},
239239
{},
240240
};
241241

242242
static struct platform_device_id cpu_pmu_plat_device_ids[] = {
243243
{.name = "arm-pmu"},
244+
{.name = "armv6-pmu"},
245+
{.name = "armv7-pmu"},
246+
{.name = "xscale-pmu"},
244247
{},
245248
};
246249

@@ -257,9 +260,13 @@ static int probe_current_pmu(struct arm_pmu *pmu)
257260
switch (read_cpuid_part()) {
258261
/* ARM Ltd CPUs. */
259262
case ARM_CPU_PART_ARM1136:
263+
ret = armv6_1136_pmu_init(pmu);
264+
break;
260265
case ARM_CPU_PART_ARM1156:
266+
ret = armv6_1156_pmu_init(pmu);
267+
break;
261268
case ARM_CPU_PART_ARM1176:
262-
ret = armv6pmu_init(pmu);
269+
ret = armv6_1176_pmu_init(pmu);
263270
break;
264271
case ARM_CPU_PART_ARM11MPCORE:
265272
ret = armv6mpcore_pmu_init(pmu);

0 commit comments

Comments
 (0)