diff options
Diffstat (limited to 'arch/powerpc/kernel/perf_event.c')
-rw-r--r-- | arch/powerpc/kernel/perf_event.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/arch/powerpc/kernel/perf_event.c b/arch/powerpc/kernel/perf_event.c index bbcbae183e92..87f1663584b0 100644 --- a/arch/powerpc/kernel/perf_event.c +++ b/arch/powerpc/kernel/perf_event.c | |||
@@ -116,20 +116,23 @@ static inline void perf_get_data_addr(struct pt_regs *regs, u64 *addrp) | |||
116 | static inline u32 perf_get_misc_flags(struct pt_regs *regs) | 116 | static inline u32 perf_get_misc_flags(struct pt_regs *regs) |
117 | { | 117 | { |
118 | unsigned long mmcra = regs->dsisr; | 118 | unsigned long mmcra = regs->dsisr; |
119 | unsigned long sihv = MMCRA_SIHV; | ||
120 | unsigned long sipr = MMCRA_SIPR; | ||
119 | 121 | ||
120 | if (TRAP(regs) != 0xf00) | 122 | if (TRAP(regs) != 0xf00) |
121 | return 0; /* not a PMU interrupt */ | 123 | return 0; /* not a PMU interrupt */ |
122 | 124 | ||
123 | if (ppmu->flags & PPMU_ALT_SIPR) { | 125 | if (ppmu->flags & PPMU_ALT_SIPR) { |
124 | if (mmcra & POWER6_MMCRA_SIHV) | 126 | sihv = POWER6_MMCRA_SIHV; |
125 | return PERF_RECORD_MISC_HYPERVISOR; | 127 | sipr = POWER6_MMCRA_SIPR; |
126 | return (mmcra & POWER6_MMCRA_SIPR) ? | ||
127 | PERF_RECORD_MISC_USER : PERF_RECORD_MISC_KERNEL; | ||
128 | } | 128 | } |
129 | if (mmcra & MMCRA_SIHV) | 129 | |
130 | /* PR has priority over HV, so order below is important */ | ||
131 | if (mmcra & sipr) | ||
132 | return PERF_RECORD_MISC_USER; | ||
133 | if ((mmcra & sihv) && (freeze_events_kernel != MMCR0_FCHV)) | ||
130 | return PERF_RECORD_MISC_HYPERVISOR; | 134 | return PERF_RECORD_MISC_HYPERVISOR; |
131 | return (mmcra & MMCRA_SIPR) ? PERF_RECORD_MISC_USER : | 135 | return PERF_RECORD_MISC_KERNEL; |
132 | PERF_RECORD_MISC_KERNEL; | ||
133 | } | 136 | } |
134 | 137 | ||
135 | /* | 138 | /* |