s390/cpum_cf: update counter numbers to ecctr limits
authorHendrik Brueckner <brueckner@linux.vnet.ibm.com>
Mon, 13 Feb 2017 11:30:09 +0000 (12:30 +0100)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Fri, 31 Mar 2017 05:53:26 +0000 (07:53 +0200)
Use the highest counter number that can be specified for the
ecctr (extract CPU counter) instruction for perf.

Signed-off-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
arch/s390/include/asm/perf_event.h
arch/s390/kernel/perf_cpum_cf.c

index c64c0befd3f3e11b5f77d2d9e6a59e55d81df291..dd32beb9d30c02cd627729d8e307cabd6a4fa65d 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Performance event support - s390 specific definitions.
  *
- * Copyright IBM Corp. 2009, 2013
+ * Copyright IBM Corp. 2009, 2017
  * Author(s): Martin Schwidefsky <schwidefsky@de.ibm.com>
  *           Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
  */
@@ -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
index 1aba10e9090632ad7e644f2f066c4c405f1ce530..1c3f93812817ee7c079c4f5c20f32f654bd30bb7 100644 (file)
@@ -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