diff options
author | Hendrik Brueckner <brueckner@linux.vnet.ibm.com> | 2012-10-15 12:31:29 (GMT) |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2012-10-18 15:50:09 (GMT) |
commit | f47586b24c43adadd19c7e3f532a601d6eed728d (patch) | |
tree | 673cd36fc6198d3d4f3a9bd0383b171974d94ad7 /arch/s390/kernel | |
parent | cec8546638dc634824b629e33968d6c68f8b07d6 (diff) | |
download | linux-fsl-qoriq-f47586b24c43adadd19c7e3f532a601d6eed728d.tar.xz |
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>
Diffstat (limited to 'arch/s390/kernel')
-rw-r--r-- | arch/s390/kernel/perf_cpum_cf.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/arch/s390/kernel/perf_cpum_cf.c b/arch/s390/kernel/perf_cpum_cf.c index 9871b19..c4e7269 100644 --- a/arch/s390/kernel/perf_cpum_cf.c +++ b/arch/s390/kernel/perf_cpum_cf.c @@ -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; @@ -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; } |