diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-04-06 11:11:57 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-04-06 11:11:57 -0400 |
commit | 18a1a7a1d862ae0794a0179473d08a414dd49234 (patch) | |
tree | 013ffe8b7fbbe9169801d0be1a780ee9bf53c08e /arch/tile/include | |
parent | 04535d273ee3edacd9551b2512b4e939ba20277f (diff) | |
parent | 5eb0bdf84433eb7b7ad4ba92a80aac57ad4b46ea (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile
Pull arch/tile updates from Chris Metcalf:
"These fix a few stray build issues seen in linux-next, and also add
the minimal required support for perf to tilegx"
* git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile:
arch/tile: remove unused variable 'devcap'
tile: Fix vDSO compilation issue with allyesconfig
perf tools: Allow building for tile
tile/perf: Support perf_events on tilegx and tilepro
tile: Enable NMIs on return from handle_nmi() without errors
tile: Add support for handling PMC hardware
tile: don't use __get_cpu_var() with structure-typed arguments
tile: avoid overflow in ns2cycles
Diffstat (limited to 'arch/tile/include')
-rw-r--r-- | arch/tile/include/asm/perf_event.h | 22 | ||||
-rw-r--r-- | arch/tile/include/asm/pmc.h | 64 |
2 files changed, 86 insertions, 0 deletions
diff --git a/arch/tile/include/asm/perf_event.h b/arch/tile/include/asm/perf_event.h new file mode 100644 index 000000000000..59c5b164e5b6 --- /dev/null +++ b/arch/tile/include/asm/perf_event.h | |||
@@ -0,0 +1,22 @@ | |||
1 | /* | ||
2 | * Copyright 2014 Tilera Corporation. All Rights Reserved. | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or | ||
5 | * modify it under the terms of the GNU General Public License | ||
6 | * as published by the Free Software Foundation, version 2. | ||
7 | * | ||
8 | * This program is distributed in the hope that it will be useful, but | ||
9 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
10 | * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or | ||
11 | * NON INFRINGEMENT. See the GNU General Public License for | ||
12 | * more details. | ||
13 | */ | ||
14 | |||
15 | #ifndef _ASM_TILE_PERF_EVENT_H | ||
16 | #define _ASM_TILE_PERF_EVENT_H | ||
17 | |||
18 | #include <linux/percpu.h> | ||
19 | DECLARE_PER_CPU(u64, perf_irqs); | ||
20 | |||
21 | unsigned long handle_syscall_link_address(void); | ||
22 | #endif /* _ASM_TILE_PERF_EVENT_H */ | ||
diff --git a/arch/tile/include/asm/pmc.h b/arch/tile/include/asm/pmc.h new file mode 100644 index 000000000000..7ae3956d9008 --- /dev/null +++ b/arch/tile/include/asm/pmc.h | |||
@@ -0,0 +1,64 @@ | |||
1 | /* | ||
2 | * Copyright 2014 Tilera Corporation. All Rights Reserved. | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or | ||
5 | * modify it under the terms of the GNU General Public License | ||
6 | * as published by the Free Software Foundation, version 2. | ||
7 | * | ||
8 | * This program is distributed in the hope that it will be useful, but | ||
9 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
10 | * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or | ||
11 | * NON INFRINGEMENT. See the GNU General Public License for | ||
12 | * more details. | ||
13 | */ | ||
14 | |||
15 | #ifndef _ASM_TILE_PMC_H | ||
16 | #define _ASM_TILE_PMC_H | ||
17 | |||
18 | #include <linux/ptrace.h> | ||
19 | |||
20 | #define TILE_BASE_COUNTERS 2 | ||
21 | |||
22 | /* Bitfields below are derived from SPR PERF_COUNT_CTL*/ | ||
23 | #ifndef __tilegx__ | ||
24 | /* PERF_COUNT_CTL on TILEPro */ | ||
25 | #define TILE_CTL_EXCL_USER (1 << 7) /* exclude user level */ | ||
26 | #define TILE_CTL_EXCL_KERNEL (1 << 8) /* exclude kernel level */ | ||
27 | #define TILE_CTL_EXCL_HV (1 << 9) /* exclude hypervisor level */ | ||
28 | |||
29 | #define TILE_SEL_MASK 0x7f /* 7 bits for event SEL, | ||
30 | COUNT_0_SEL */ | ||
31 | #define TILE_PLM_MASK 0x780 /* 4 bits priv level msks, | ||
32 | COUNT_0_MASK*/ | ||
33 | #define TILE_EVENT_MASK (TILE_SEL_MASK | TILE_PLM_MASK) | ||
34 | |||
35 | #else /* __tilegx__*/ | ||
36 | /* PERF_COUNT_CTL on TILEGx*/ | ||
37 | #define TILE_CTL_EXCL_USER (1 << 10) /* exclude user level */ | ||
38 | #define TILE_CTL_EXCL_KERNEL (1 << 11) /* exclude kernel level */ | ||
39 | #define TILE_CTL_EXCL_HV (1 << 12) /* exclude hypervisor level */ | ||
40 | |||
41 | #define TILE_SEL_MASK 0x3f /* 6 bits for event SEL, | ||
42 | COUNT_0_SEL*/ | ||
43 | #define TILE_BOX_MASK 0x1c0 /* 3 bits box msks, | ||
44 | COUNT_0_BOX */ | ||
45 | #define TILE_PLM_MASK 0x3c00 /* 4 bits priv level msks, | ||
46 | COUNT_0_MASK */ | ||
47 | #define TILE_EVENT_MASK (TILE_SEL_MASK | TILE_BOX_MASK | TILE_PLM_MASK) | ||
48 | #endif /* __tilegx__*/ | ||
49 | |||
50 | /* Takes register and fault number. Returns error to disable the interrupt. */ | ||
51 | typedef int (*perf_irq_t)(struct pt_regs *, int); | ||
52 | |||
53 | int userspace_perf_handler(struct pt_regs *regs, int fault); | ||
54 | |||
55 | perf_irq_t reserve_pmc_hardware(perf_irq_t new_perf_irq); | ||
56 | void release_pmc_hardware(void); | ||
57 | |||
58 | unsigned long pmc_get_overflow(void); | ||
59 | void pmc_ack_overflow(unsigned long status); | ||
60 | |||
61 | void unmask_pmc_interrupts(void); | ||
62 | void mask_pmc_interrupts(void); | ||
63 | |||
64 | #endif /* _ASM_TILE_PMC_H */ | ||