From: Hendrik Brueckner Date: Mon, 13 Feb 2017 11:30:09 +0000 (+0100) Subject: s390/cpum_cf: update counter numbers to ecctr limits X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=20ba46da369e239aa454cc57d0c7e33d51a8de51;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git s390/cpum_cf: update counter numbers to ecctr limits Use the highest counter number that can be specified for the ecctr (extract CPU counter) instruction for perf. Signed-off-by: Hendrik Brueckner Signed-off-by: Martin Schwidefsky --- diff --git a/arch/s390/include/asm/perf_event.h b/arch/s390/include/asm/perf_event.h index c64c0befd3f3..dd32beb9d30c 100644 --- a/arch/s390/include/asm/perf_event.h +++ b/arch/s390/include/asm/perf_event.h @@ -1,7 +1,7 @@ /* * Performance event support - s390 specific definitions. * - * Copyright IBM Corp. 2009, 2013 + * Copyright IBM Corp. 2009, 2017 * Author(s): Martin Schwidefsky * Hendrik Brueckner */ @@ -47,7 +47,7 @@ struct perf_sf_sde_regs { }; /* Perf PMU definitions for the counter facility */ -#define PERF_CPUM_CF_MAX_CTR 256 +#define PERF_CPUM_CF_MAX_CTR 0xffffUL /* Max ctr for ECCTR */ /* Perf PMU definitions for the sampling facility */ #define PERF_CPUM_SF_MAX_CTR 2 diff --git a/arch/s390/kernel/perf_cpum_cf.c b/arch/s390/kernel/perf_cpum_cf.c index 1aba10e90906..1c3f93812817 100644 --- a/arch/s390/kernel/perf_cpum_cf.c +++ b/arch/s390/kernel/perf_cpum_cf.c @@ -370,7 +370,7 @@ static int __hw_perf_event_init(struct perf_event *event) if (ev == -1) return -ENOENT; - if (ev >= PERF_CPUM_CF_MAX_CTR) + if (ev > PERF_CPUM_CF_MAX_CTR) return -EINVAL; /* Use the hardware perf event structure to store the counter number