[SRU][B][D][Patch 0/2] Enhanced CPU-MF hardware counters - kernel part (LP: 1836860)

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

[SRU][B][D][Patch 0/2] Enhanced CPU-MF hardware counters - kernel part (LP: 1836860)

frank.heimes
Buglink: https://bugs.launchpad.net/bugs/1836860

SRU Justification:

[Impact]

* Enhanced CPU-MF hardware counters - fix lack of support of new hardware

[Fix]

* 46a984ffb86c8542fa510656fa8cb33befe8ee8f 46a984ff "s390/cpum_cf: Add support for CPU-MF SVN 6"

* 820bace734722715c643dcb5f74b502cb912d4eb 820bace "s390/cpumf: Add extended counter set definitions for model 8561 and 8562"

[Test Case]

* try CPU-Measurement Facility counter on z14 and next generation hardware - only IBM can do that now

[Regression Potential]

* The regression potential can be considered as low since these changes are limited to arch/s390

* do only touch perf_* code

* and mainly add code (rather than modify or remove)

[Other Info]

* first commit is taken from 5.2, second from 5.3-rc1

Thomas Richter (2):
  From: Thomas Richter <[hidden email]>
  From: Thomas Richter <[hidden email]>

 arch/s390/kernel/perf_cpum_cf.c        |  15 +++--
 arch/s390/kernel/perf_cpum_cf_events.c | 109 +++++++++++++++++++++++----------
 2 files changed, 86 insertions(+), 38 deletions(-)

--
2.7.4


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

[SRU][B][D][Patch 1/2] s390/cpum_cf: Add support for CPU-MF SVN 6

frank.heimes
From: Thomas Richter <[hidden email]>

BugLink: https://bugs.launchpad.net/bugs/1836860

Add support for the CPU-Measurement Facility counter
second version number 6. This number is used to detect some
more counters in the crypto counter set and the extended
counter set.

Signed-off-by: Thomas Richter <[hidden email]>
Reviewed-by: Hendrik Brueckner <[hidden email]>
Signed-off-by: Martin Schwidefsky <[hidden email]>
(cherry picked from commit 46a984ffb86c8542fa510656fa8cb33befe8ee8f)
Signed-off-by: Frank Heimes <[hidden email]>
---
 arch/s390/kernel/perf_cpum_cf.c        |  15 +++--
 arch/s390/kernel/perf_cpum_cf_events.c | 107 ++++++++++++++++++++++-----------
 2 files changed, 84 insertions(+), 38 deletions(-)

diff --git a/arch/s390/kernel/perf_cpum_cf.c b/arch/s390/kernel/perf_cpum_cf.c
index d5523ad..22506c5 100644
--- a/arch/s390/kernel/perf_cpum_cf.c
+++ b/arch/s390/kernel/perf_cpum_cf.c
@@ -2,8 +2,8 @@
 /*
  * Performance event support for s390x - CPU-measurement Counter Facility
  *
- *  Copyright IBM Corp. 2012, 2017
- *  Author(s): Hendrik Brueckner <[hidden email]>
+ *  Copyright IBM Corp. 2012, 2019
+ *  Author(s): Hendrik Brueckner <[hidden email]>
  */
 #define KMSG_COMPONENT "cpum_cf"
 #define pr_fmt(fmt) KMSG_COMPONENT ": " fmt
@@ -88,7 +88,7 @@ static enum cpumf_ctr_set get_counter_set(u64 event)
  set = CPUMF_CTR_SET_USER;
  else if (event < 128)
  set = CPUMF_CTR_SET_CRYPTO;
- else if (event < 256)
+ else if (event < 288)
  set = CPUMF_CTR_SET_EXT;
  else if (event >= 448 && event < 496)
  set = CPUMF_CTR_SET_MT_DIAG;
@@ -112,12 +112,19 @@ static int validate_ctr_version(const struct hw_perf_event *hwc)
  err = -EOPNOTSUPP;
  break;
  case CPUMF_CTR_SET_CRYPTO:
+ if ((cpuhw->info.csvn >= 1 && cpuhw->info.csvn <= 5 &&
+     hwc->config > 79) ||
+    (cpuhw->info.csvn >= 6 && hwc->config > 83))
+ err = -EOPNOTSUPP;
+ break;
  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))
+    (cpuhw->info.csvn >= 3 && cpuhw->info.csvn <= 5
+     && hwc->config > 255) ||
+    (cpuhw->info.csvn >= 6 && hwc->config > 287))
  err = -EOPNOTSUPP;
  break;
  case CPUMF_CTR_SET_MT_DIAG:
diff --git a/arch/s390/kernel/perf_cpum_cf_events.c b/arch/s390/kernel/perf_cpum_cf_events.c
index 1081a15..8692a53 100644
--- a/arch/s390/kernel/perf_cpum_cf_events.c
+++ b/arch/s390/kernel/perf_cpum_cf_events.c
@@ -30,22 +30,26 @@ CPUMF_EVENT_ATTR(cf_fvn3, PROBLEM_STATE_CPU_CYCLES, 0x0020);
 CPUMF_EVENT_ATTR(cf_fvn3, PROBLEM_STATE_INSTRUCTIONS, 0x0021);
 CPUMF_EVENT_ATTR(cf_fvn3, L1D_DIR_WRITES, 0x0004);
 CPUMF_EVENT_ATTR(cf_fvn3, L1D_PENALTY_CYCLES, 0x0005);
-CPUMF_EVENT_ATTR(cf_svn_generic, PRNG_FUNCTIONS, 0x0040);
-CPUMF_EVENT_ATTR(cf_svn_generic, PRNG_CYCLES, 0x0041);
-CPUMF_EVENT_ATTR(cf_svn_generic, PRNG_BLOCKED_FUNCTIONS, 0x0042);
-CPUMF_EVENT_ATTR(cf_svn_generic, PRNG_BLOCKED_CYCLES, 0x0043);
-CPUMF_EVENT_ATTR(cf_svn_generic, SHA_FUNCTIONS, 0x0044);
-CPUMF_EVENT_ATTR(cf_svn_generic, SHA_CYCLES, 0x0045);
-CPUMF_EVENT_ATTR(cf_svn_generic, SHA_BLOCKED_FUNCTIONS, 0x0046);
-CPUMF_EVENT_ATTR(cf_svn_generic, SHA_BLOCKED_CYCLES, 0x0047);
-CPUMF_EVENT_ATTR(cf_svn_generic, DEA_FUNCTIONS, 0x0048);
-CPUMF_EVENT_ATTR(cf_svn_generic, DEA_CYCLES, 0x0049);
-CPUMF_EVENT_ATTR(cf_svn_generic, DEA_BLOCKED_FUNCTIONS, 0x004a);
-CPUMF_EVENT_ATTR(cf_svn_generic, DEA_BLOCKED_CYCLES, 0x004b);
-CPUMF_EVENT_ATTR(cf_svn_generic, AES_FUNCTIONS, 0x004c);
-CPUMF_EVENT_ATTR(cf_svn_generic, AES_CYCLES, 0x004d);
-CPUMF_EVENT_ATTR(cf_svn_generic, AES_BLOCKED_FUNCTIONS, 0x004e);
-CPUMF_EVENT_ATTR(cf_svn_generic, AES_BLOCKED_CYCLES, 0x004f);
+CPUMF_EVENT_ATTR(cf_svn_12345, PRNG_FUNCTIONS, 0x0040);
+CPUMF_EVENT_ATTR(cf_svn_12345, PRNG_CYCLES, 0x0041);
+CPUMF_EVENT_ATTR(cf_svn_12345, PRNG_BLOCKED_FUNCTIONS, 0x0042);
+CPUMF_EVENT_ATTR(cf_svn_12345, PRNG_BLOCKED_CYCLES, 0x0043);
+CPUMF_EVENT_ATTR(cf_svn_12345, SHA_FUNCTIONS, 0x0044);
+CPUMF_EVENT_ATTR(cf_svn_12345, SHA_CYCLES, 0x0045);
+CPUMF_EVENT_ATTR(cf_svn_12345, SHA_BLOCKED_FUNCTIONS, 0x0046);
+CPUMF_EVENT_ATTR(cf_svn_12345, SHA_BLOCKED_CYCLES, 0x0047);
+CPUMF_EVENT_ATTR(cf_svn_12345, DEA_FUNCTIONS, 0x0048);
+CPUMF_EVENT_ATTR(cf_svn_12345, DEA_CYCLES, 0x0049);
+CPUMF_EVENT_ATTR(cf_svn_12345, DEA_BLOCKED_FUNCTIONS, 0x004a);
+CPUMF_EVENT_ATTR(cf_svn_12345, DEA_BLOCKED_CYCLES, 0x004b);
+CPUMF_EVENT_ATTR(cf_svn_12345, AES_FUNCTIONS, 0x004c);
+CPUMF_EVENT_ATTR(cf_svn_12345, AES_CYCLES, 0x004d);
+CPUMF_EVENT_ATTR(cf_svn_12345, AES_BLOCKED_FUNCTIONS, 0x004e);
+CPUMF_EVENT_ATTR(cf_svn_12345, AES_BLOCKED_CYCLES, 0x004f);
+CPUMF_EVENT_ATTR(cf_svn_6, ECC_FUNCTION_COUNT, 0x0050);
+CPUMF_EVENT_ATTR(cf_svn_6, ECC_CYCLES_COUNT, 0x0051);
+CPUMF_EVENT_ATTR(cf_svn_6, ECC_BLOCKED_FUNCTION_COUNT, 0x0052);
+CPUMF_EVENT_ATTR(cf_svn_6, ECC_BLOCKED_CYCLES_COUNT, 0x0053);
 CPUMF_EVENT_ATTR(cf_z10, L1I_L2_SOURCED_WRITES, 0x0080);
 CPUMF_EVENT_ATTR(cf_z10, L1D_L2_SOURCED_WRITES, 0x0081);
 CPUMF_EVENT_ATTR(cf_z10, L1I_L3_LOCAL_WRITES, 0x0082);
@@ -261,23 +265,47 @@ static struct attribute *cpumcf_fvn3_pmu_event_attr[] __initdata = {
  NULL,
 };
 
-static struct attribute *cpumcf_svn_generic_pmu_event_attr[] __initdata = {
- CPUMF_EVENT_PTR(cf_svn_generic, PRNG_FUNCTIONS),
- CPUMF_EVENT_PTR(cf_svn_generic, PRNG_CYCLES),
- CPUMF_EVENT_PTR(cf_svn_generic, PRNG_BLOCKED_FUNCTIONS),
- CPUMF_EVENT_PTR(cf_svn_generic, PRNG_BLOCKED_CYCLES),
- CPUMF_EVENT_PTR(cf_svn_generic, SHA_FUNCTIONS),
- CPUMF_EVENT_PTR(cf_svn_generic, SHA_CYCLES),
- CPUMF_EVENT_PTR(cf_svn_generic, SHA_BLOCKED_FUNCTIONS),
- CPUMF_EVENT_PTR(cf_svn_generic, SHA_BLOCKED_CYCLES),
- CPUMF_EVENT_PTR(cf_svn_generic, DEA_FUNCTIONS),
- CPUMF_EVENT_PTR(cf_svn_generic, DEA_CYCLES),
- CPUMF_EVENT_PTR(cf_svn_generic, DEA_BLOCKED_FUNCTIONS),
- CPUMF_EVENT_PTR(cf_svn_generic, DEA_BLOCKED_CYCLES),
- CPUMF_EVENT_PTR(cf_svn_generic, AES_FUNCTIONS),
- CPUMF_EVENT_PTR(cf_svn_generic, AES_CYCLES),
- CPUMF_EVENT_PTR(cf_svn_generic, AES_BLOCKED_FUNCTIONS),
- CPUMF_EVENT_PTR(cf_svn_generic, AES_BLOCKED_CYCLES),
+static struct attribute *cpumcf_svn_12345_pmu_event_attr[] __initdata = {
+ CPUMF_EVENT_PTR(cf_svn_12345, PRNG_FUNCTIONS),
+ CPUMF_EVENT_PTR(cf_svn_12345, PRNG_CYCLES),
+ CPUMF_EVENT_PTR(cf_svn_12345, PRNG_BLOCKED_FUNCTIONS),
+ CPUMF_EVENT_PTR(cf_svn_12345, PRNG_BLOCKED_CYCLES),
+ CPUMF_EVENT_PTR(cf_svn_12345, SHA_FUNCTIONS),
+ CPUMF_EVENT_PTR(cf_svn_12345, SHA_CYCLES),
+ CPUMF_EVENT_PTR(cf_svn_12345, SHA_BLOCKED_FUNCTIONS),
+ CPUMF_EVENT_PTR(cf_svn_12345, SHA_BLOCKED_CYCLES),
+ CPUMF_EVENT_PTR(cf_svn_12345, DEA_FUNCTIONS),
+ CPUMF_EVENT_PTR(cf_svn_12345, DEA_CYCLES),
+ CPUMF_EVENT_PTR(cf_svn_12345, DEA_BLOCKED_FUNCTIONS),
+ CPUMF_EVENT_PTR(cf_svn_12345, DEA_BLOCKED_CYCLES),
+ CPUMF_EVENT_PTR(cf_svn_12345, AES_FUNCTIONS),
+ CPUMF_EVENT_PTR(cf_svn_12345, AES_CYCLES),
+ CPUMF_EVENT_PTR(cf_svn_12345, AES_BLOCKED_FUNCTIONS),
+ CPUMF_EVENT_PTR(cf_svn_12345, AES_BLOCKED_CYCLES),
+ NULL,
+};
+
+static struct attribute *cpumcf_svn_6_pmu_event_attr[] __initdata = {
+ CPUMF_EVENT_PTR(cf_svn_12345, PRNG_FUNCTIONS),
+ CPUMF_EVENT_PTR(cf_svn_12345, PRNG_CYCLES),
+ CPUMF_EVENT_PTR(cf_svn_12345, PRNG_BLOCKED_FUNCTIONS),
+ CPUMF_EVENT_PTR(cf_svn_12345, PRNG_BLOCKED_CYCLES),
+ CPUMF_EVENT_PTR(cf_svn_12345, SHA_FUNCTIONS),
+ CPUMF_EVENT_PTR(cf_svn_12345, SHA_CYCLES),
+ CPUMF_EVENT_PTR(cf_svn_12345, SHA_BLOCKED_FUNCTIONS),
+ CPUMF_EVENT_PTR(cf_svn_12345, SHA_BLOCKED_CYCLES),
+ CPUMF_EVENT_PTR(cf_svn_12345, DEA_FUNCTIONS),
+ CPUMF_EVENT_PTR(cf_svn_12345, DEA_CYCLES),
+ CPUMF_EVENT_PTR(cf_svn_12345, DEA_BLOCKED_FUNCTIONS),
+ CPUMF_EVENT_PTR(cf_svn_12345, DEA_BLOCKED_CYCLES),
+ CPUMF_EVENT_PTR(cf_svn_12345, AES_FUNCTIONS),
+ CPUMF_EVENT_PTR(cf_svn_12345, AES_CYCLES),
+ CPUMF_EVENT_PTR(cf_svn_12345, AES_BLOCKED_FUNCTIONS),
+ CPUMF_EVENT_PTR(cf_svn_12345, AES_BLOCKED_CYCLES),
+ CPUMF_EVENT_PTR(cf_svn_6, ECC_FUNCTION_COUNT),
+ CPUMF_EVENT_PTR(cf_svn_6, ECC_CYCLES_COUNT),
+ CPUMF_EVENT_PTR(cf_svn_6, ECC_BLOCKED_FUNCTION_COUNT),
+ CPUMF_EVENT_PTR(cf_svn_6, ECC_BLOCKED_CYCLES_COUNT),
  NULL,
 };
 
@@ -561,7 +589,18 @@ __init const struct attribute_group **cpumf_cf_event_group(void)
  default:
  cfvn = none;
  }
- csvn = cpumcf_svn_generic_pmu_event_attr;
+
+ /* Determine version specific crypto set */
+ switch (ci.csvn) {
+ case 1 ... 5:
+ csvn = cpumcf_svn_12345_pmu_event_attr;
+ break;
+ case 6:
+ csvn = cpumcf_svn_6_pmu_event_attr;
+ break;
+ default:
+ csvn = none;
+ }
 
  /* Determine model-specific counter set(s) */
  get_cpu_id(&cpu_id);
--
2.7.4


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

[SRU][B][D][Patch 2/2] s390/cpumf: Add extended counter set definitions for model 8561 and 8562

frank.heimes
In reply to this post by frank.heimes
From: Thomas Richter <[hidden email]>

BugLink: https://bugs.launchpad.net/bugs/1836860

Add the extended counter set definitions for s390 machine types
8561 and  8262. They are identical with machine types 3906 and
3907.

Signed-off-by: Thomas Richter <[hidden email]>
Signed-off-by: Vasily Gorbik <[hidden email]>
(cherry picked from commit 820bace734722715c643dcb5f74b502cb912d4eb)
Signed-off-by: Frank Heimes <[hidden email]>
---
 arch/s390/kernel/perf_cpum_cf_events.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/s390/kernel/perf_cpum_cf_events.c b/arch/s390/kernel/perf_cpum_cf_events.c
index 8692a53..d54b097 100644
--- a/arch/s390/kernel/perf_cpum_cf_events.c
+++ b/arch/s390/kernel/perf_cpum_cf_events.c
@@ -623,6 +623,8 @@ __init const struct attribute_group **cpumf_cf_event_group(void)
  break;
  case 0x3906:
  case 0x3907:
+ case 0x8561:
+ case 0x8562:
  model = cpumcf_z14_pmu_event_attr;
  break;
  default:
--
2.7.4


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

ACK: [SRU][B][D][Patch 0/2] Enhanced CPU-MF hardware counters - kernel part (LP: 1836860)

Connor Kuehl
In reply to this post by frank.heimes
On 7/24/19 9:30 AM, [hidden email] wrote:

> Buglink: https://bugs.launchpad.net/bugs/1836860
>
> SRU Justification:
>
> [Impact]
>
> * Enhanced CPU-MF hardware counters - fix lack of support of new hardware
>
> [Fix]
>
> * 46a984ffb86c8542fa510656fa8cb33befe8ee8f 46a984ff "s390/cpum_cf: Add support for CPU-MF SVN 6"
>
> * 820bace734722715c643dcb5f74b502cb912d4eb 820bace "s390/cpumf: Add extended counter set definitions for model 8561 and 8562"
>
> [Test Case]
>
> * try CPU-Measurement Facility counter on z14 and next generation hardware - only IBM can do that now
>
> [Regression Potential]
>
> * The regression potential can be considered as low since these changes are limited to arch/s390
>
> * do only touch perf_* code
>
> * and mainly add code (rather than modify or remove)
>
> [Other Info]
>
> * first commit is taken from 5.2, second from 5.3-rc1
>
> Thomas Richter (2):
>   From: Thomas Richter <[hidden email]>
>   From: Thomas Richter <[hidden email]>
>
>  arch/s390/kernel/perf_cpum_cf.c        |  15 +++--
>  arch/s390/kernel/perf_cpum_cf_events.c | 109 +++++++++++++++++++++++----------
>  2 files changed, 86 insertions(+), 38 deletions(-)
>

Acked-by: Connor Kuehl <[hidden email]>

--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

ACK/Cmnt: [SRU][B][D][Patch 0/2] Enhanced CPU-MF hardware counters - kernel part (LP: 1836860)

Stefan Bader-2
In reply to this post by frank.heimes
On 24.07.19 18:30, [hidden email] wrote:

> Buglink: https://bugs.launchpad.net/bugs/1836860
>
> SRU Justification:
>
> [Impact]
>
> * Enhanced CPU-MF hardware counters - fix lack of support of new hardware
>
> [Fix]
>
> * 46a984ffb86c8542fa510656fa8cb33befe8ee8f 46a984ff "s390/cpum_cf: Add support for CPU-MF SVN 6"
>
> * 820bace734722715c643dcb5f74b502cb912d4eb 820bace "s390/cpumf: Add extended counter set definitions for model 8561 and 8562"
>
> [Test Case]
>
> * try CPU-Measurement Facility counter on z14 and next generation hardware - only IBM can do that now
>
> [Regression Potential]
>
> * The regression potential can be considered as low since these changes are limited to arch/s390
>
> * do only touch perf_* code
>
> * and mainly add code (rather than modify or remove)
>
> [Other Info]
>
> * first commit is taken from 5.2, second from 5.3-rc1
>
> Thomas Richter (2):
>   From: Thomas Richter <[hidden email]>
>   From: Thomas Richter <[hidden email]>
>
>  arch/s390/kernel/perf_cpum_cf.c        |  15 +++--
>  arch/s390/kernel/perf_cpum_cf_events.c | 109 +++++++++++++++++++++++----------
>  2 files changed, 86 insertions(+), 38 deletions(-)
>
The series you request, nominate for you should.

Acked-by: Stefan Bader <[hidden email]>


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team

signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

APPLIED: [SRU][B][D][Patch 0/2] Enhanced CPU-MF hardware counters - kernel part (LP: 1836860)

Khaled Elmously
In reply to this post by frank.heimes
On 2019-07-24 18:30:33 , [hidden email] wrote:

> Buglink: https://bugs.launchpad.net/bugs/1836860
>
> SRU Justification:
>
> [Impact]
>
> * Enhanced CPU-MF hardware counters - fix lack of support of new hardware
>
> [Fix]
>
> * 46a984ffb86c8542fa510656fa8cb33befe8ee8f 46a984ff "s390/cpum_cf: Add support for CPU-MF SVN 6"
>
> * 820bace734722715c643dcb5f74b502cb912d4eb 820bace "s390/cpumf: Add extended counter set definitions for model 8561 and 8562"
>
> [Test Case]
>
> * try CPU-Measurement Facility counter on z14 and next generation hardware - only IBM can do that now
>
> [Regression Potential]
>
> * The regression potential can be considered as low since these changes are limited to arch/s390
>
> * do only touch perf_* code
>
> * and mainly add code (rather than modify or remove)
>
> [Other Info]
>
> * first commit is taken from 5.2, second from 5.3-rc1
>
> Thomas Richter (2):
>   From: Thomas Richter <[hidden email]>
>   From: Thomas Richter <[hidden email]>
>
>  arch/s390/kernel/perf_cpum_cf.c        |  15 +++--
>  arch/s390/kernel/perf_cpum_cf_events.c | 109 +++++++++++++++++++++++----------
>  2 files changed, 86 insertions(+), 38 deletions(-)
>
> --
> 2.7.4
>
>
> --
> kernel-team mailing list
> [hidden email]
> https://lists.ubuntu.com/mailman/listinfo/kernel-team

--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team