Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

perf_cpum_cf: Add support for counters available with IBM zEC12

Increase the maximum number of available counters and check if
the hardware supports the counter. Support is indicated by the
version of the CPU-measurement counter facility.

Signed-off-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>

authored by

Hendrik Brueckner and committed by
Martin Schwidefsky
f47586b2 cec85466

+6 -2
+1 -1
arch/s390/include/asm/perf_event.h
··· 9 9 #include <asm/cpu_mf.h> 10 10 11 11 /* CPU-measurement counter facility */ 12 - #define PERF_CPUM_CF_MAX_CTR 160 12 + #define PERF_CPUM_CF_MAX_CTR 256 13 13 14 14 /* Per-CPU flags for PMU states */ 15 15 #define PMU_F_RESERVED 0x1000
+5 -1
arch/s390/kernel/perf_cpum_cf.c
··· 94 94 set = CPUMF_CTR_SET_USER; 95 95 else if (event < 128) 96 96 set = CPUMF_CTR_SET_CRYPTO; 97 - else if (event < 160) 97 + else if (event < 256) 98 98 set = CPUMF_CTR_SET_EXT; 99 99 100 100 return set; ··· 137 137 case CPUMF_CTR_SET_CRYPTO: 138 138 case CPUMF_CTR_SET_EXT: 139 139 if (cpuhw->info.csvn < 1) 140 + err = -EOPNOTSUPP; 141 + if ((cpuhw->info.csvn == 1 && hwc->config > 159) || 142 + (cpuhw->info.csvn == 2 && hwc->config > 175) || 143 + (cpuhw->info.csvn > 2 && hwc->config > 255)) 140 144 err = -EOPNOTSUPP; 141 145 break; 142 146 }