提交 f47586b2 编写于 作者: H Hendrik Brueckner 提交者: Martin Schwidefsky

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: NHendrik Brueckner <brueckner@linux.vnet.ibm.com>
Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
上级 cec85466
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
#include <asm/cpu_mf.h> #include <asm/cpu_mf.h>
/* CPU-measurement counter facility */ /* CPU-measurement counter facility */
#define PERF_CPUM_CF_MAX_CTR 160 #define PERF_CPUM_CF_MAX_CTR 256
/* Per-CPU flags for PMU states */ /* Per-CPU flags for PMU states */
#define PMU_F_RESERVED 0x1000 #define PMU_F_RESERVED 0x1000
......
...@@ -94,7 +94,7 @@ static int get_counter_set(u64 event) ...@@ -94,7 +94,7 @@ static int get_counter_set(u64 event)
set = CPUMF_CTR_SET_USER; set = CPUMF_CTR_SET_USER;
else if (event < 128) else if (event < 128)
set = CPUMF_CTR_SET_CRYPTO; set = CPUMF_CTR_SET_CRYPTO;
else if (event < 160) else if (event < 256)
set = CPUMF_CTR_SET_EXT; set = CPUMF_CTR_SET_EXT;
return set; return set;
...@@ -138,6 +138,10 @@ static int validate_ctr_version(const struct hw_perf_event *hwc) ...@@ -138,6 +138,10 @@ static int validate_ctr_version(const struct hw_perf_event *hwc)
case CPUMF_CTR_SET_EXT: case CPUMF_CTR_SET_EXT:
if (cpuhw->info.csvn < 1) if (cpuhw->info.csvn < 1)
err = -EOPNOTSUPP; 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; break;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册