Skip to content

Commit

Permalink
perf_cpum_cf: Add support for counters available with IBM zEC12
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Hendrik Brueckner authored and Martin Schwidefsky committed Oct 18, 2012
1 parent cec8546 commit f47586b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion arch/s390/include/asm/perf_event.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include <asm/cpu_mf.h>

/* CPU-measurement counter facility */
#define PERF_CPUM_CF_MAX_CTR 160
#define PERF_CPUM_CF_MAX_CTR 256

/* Per-CPU flags for PMU states */
#define PMU_F_RESERVED 0x1000
Expand Down
6 changes: 5 additions & 1 deletion arch/s390/kernel/perf_cpum_cf.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ static int get_counter_set(u64 event)
set = CPUMF_CTR_SET_USER;
else if (event < 128)
set = CPUMF_CTR_SET_CRYPTO;
else if (event < 160)
else if (event < 256)
set = CPUMF_CTR_SET_EXT;

return set;
Expand Down Expand Up @@ -138,6 +138,10 @@ static int validate_ctr_version(const struct hw_perf_event *hwc)
case CPUMF_CTR_SET_EXT:
if (cpuhw->info.csvn < 1)
err = -EOPNOTSUPP;
if ((cpuhw->info.csvn == 1 && hwc->config > 159) ||
(cpuhw->info.csvn == 2 && hwc->config > 175) ||
(cpuhw->info.csvn > 2 && hwc->config > 255))
err = -EOPNOTSUPP;
break;
}

Expand Down

0 comments on commit f47586b

Please sign in to comment.