[22.04 FEAT] Add new CPU-MF Counters for new IBM Z Hardware - s390-tools part

Bug #1960119 reported by bugproxy
22
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ubuntu on IBM z Systems
Fix Released
High
Skipper Bug Screeners
s390-tools (Ubuntu)
Fix Released
High
Unassigned
Focal
Fix Released
Undecided
Unassigned
Impish
Won't Fix
Undecided
Unassigned
Jammy
Fix Released
High
Unassigned
Kinetic
Fix Released
High
Unassigned
s390-tools-signed (Ubuntu)
Fix Released
High
Unassigned
Focal
Fix Released
Undecided
Unassigned
Impish
Won't Fix
Undecided
Unassigned
Jammy
Fix Released
High
Unassigned
Kinetic
Fix Released
High
Unassigned

Bug Description

SRU Justification:
==================

[Impact]

 * This in a hardware enablement SRU,

 * and adds support for (new) IBM z16 counters

 * to the s390-tools package.

[Test Plan]

 * Prepare an IBM z16 LPAR with Ubuntu 20.04, 21.10 or 22.04 (incl. this patch).

 * At LPARs activation profile, navigate to the Security page
   and within the counter facility options, select each counter set you want to use.
   (One may just select all for testing purposes.)

 * Use 'perf list' to determine if the new counters are listed.
   For comparing the new counters see:
   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git\
   /commit/?id=c9311de71635d3eaa158df8516b9b99a92d60a0c

 * Use 'perf stat -e' to enable and make use of these counters.

[Where problems could occur]

 * The machine type, model or name could be mixed up,
   which may lead to wrong counters for the machines identified.

 * Initialization of the new struct cpumcf_z16_counters could be wrong.

 * The hex code for the counters could be wrong or mixed up,
   or the names might be wrong or mixed up,
   in which case one will get wrong or unexpected results.

 * The expansion of the case statement to determine the correct (z16) hardware
   might be wrong, which would lead to potentially counters,
   that may not match to the underlying hardware.

 * The new code may have syntactical errors,
   which would become visible during a test compile.

 * Only new code is added by this commit - none is changed nor removed.

[Other Info]

 * The new IBM z16 was announced after jammy feature freeze,
   hence the name and details need to be added now, after the 22.04 release.
__________

Add new CPU-MF Counters for new IBM Z Hardware - s390-tools part

Description:
Add new CPU-MF Counters for new IBM Z Hardware.

Has a kernel, s390utils/s390-tools and libpfm part.

Request Type: Package - Update Version
Upstream Acceptance: In Progress

bugproxy (bugproxy)
tags: added: architecture-s39064 bugnameltc-196342 severity-high targetmilestone-inin2204
Changed in ubuntu:
assignee: nobody → Skipper Bug Screeners (skipper-screen-team)
affects: ubuntu → linux (Ubuntu)
Frank Heimes (fheimes)
affects: linux (Ubuntu) → s390-tools (Ubuntu)
Changed in ubuntu-z-systems:
assignee: nobody → Skipper Bug Screeners (skipper-screen-team)
Changed in s390-tools (Ubuntu):
importance: Undecided → High
Changed in ubuntu-z-systems:
importance: Undecided → High
Changed in s390-tools (Ubuntu):
status: New → Incomplete
Changed in ubuntu-z-systems:
status: New → Incomplete
Revision history for this message
bugproxy (bugproxy) wrote : Adds support for the CPU Measurement Counter Facility second version number 7.

------- Comment (attachment only) From <email address hidden> 2022-02-15 04:39 EDT-------

Revision history for this message
bugproxy (bugproxy) wrote : s390/cpumf: Support for CPU Measurement Sampling Facility LS bit

------- Comment (attachment only) From <email address hidden> 2022-02-15 04:40 EDT-------

Revision history for this message
Frank Heimes (fheimes) wrote : Re: [22.04 FEAT} Add new CPU-MF Counters for new IBM Z Hardware - s390-tools part

Hi Thomas, I'm a bit confused, this ticket is about "s390-tools part" of "new CPU-MF Counters for new IBM Z Hardware", but the attached patches are kernel backports.

So I think these belong to LP#1960117 / BZ#196341 "[22.04 FEAT] Add new CPU-MF Counters for new IBM Z Hardware - kernel part".

Frank Heimes (fheimes)
summary: - [22.04 FEAT} Add new CPU-MF Counters for new IBM Z Hardware - s390-tools
+ [22.04 FEAT] Add new CPU-MF Counters for new IBM Z Hardware - s390-tools
part
Revision history for this message
bugproxy (bugproxy) wrote : Comment bridged from LTC Bugzilla

------- Comment From <email address hidden> 2022-02-20 16:49 EDT-------
(In reply to comment #11)
>
> Hi Thomas, I'm a bit confused, this ticket is about "s390-tools part" of
> "new CPU-MF Counters for new IBM Z Hardware", but the attached patches are
> kernel backports.
>
> So I think these belong to LP#1960117 / BZ#196341 "[22.04 FEAT] Add new
> CPU-MF Counters for new IBM Z Hardware - kernel part".

Hi Frank, you are right: those attached patches do belong to the kernel part of this feature. Thanks for moving them to the correct bugzilla / LP entry.

Revision history for this message
bugproxy (bugproxy) wrote :

------- Comment From <email address hidden> 2022-02-20 17:02 EDT-------
The patches covering the new CPU-MF counters for the s390-tools part cannot be provided before the documentation for the new IBM Z Hardware is available which is usually after the GA date.
Therefore, we will not make the jammy feature freeze date and will have to apply these hardware enablement patches at a later point in time

Frank Heimes (fheimes)
information type: Private → Public
Frank Heimes (fheimes)
Changed in s390-tools-signed (Ubuntu):
status: New → Incomplete
Revision history for this message
bugproxy (bugproxy) wrote : Add IBM z16 as known machine to the architecture definitions

------- Comment (attachment only) From <email address hidden> 2022-05-20 03:49 EDT-------

Revision history for this message
bugproxy (bugproxy) wrote : cpumf/lscpumf: Add IBM z16 extended counter set definitions

------- Comment (attachment only) From <email address hidden> 2022-05-20 03:50 EDT-------

Frank Heimes (fheimes)
Changed in ubuntu-z-systems:
status: Incomplete → New
Changed in s390-tools (Ubuntu):
status: Incomplete → New
Changed in s390-tools-signed (Ubuntu):
status: Incomplete → New
Frank Heimes (fheimes)
description: updated
Revision history for this message
Frank Heimes (fheimes) wrote :

A test build in PPA was done and is available here: https://launchpad.net/~fheimes/+archive/ubuntu/lp1960119

Changed in ubuntu-z-systems:
status: New → In Progress
Changed in s390-tools (Ubuntu):
status: New → In Progress
Frank Heimes (fheimes)
Changed in s390-tools-signed (Ubuntu):
status: New → In Progress
importance: Undecided → High
assignee: nobody → Frank Heimes (fheimes)
Changed in s390-tools (Ubuntu):
assignee: Skipper Bug Screeners (skipper-screen-team) → Frank Heimes (fheimes)
Frank Heimes (fheimes)
Changed in s390-tools-signed (Ubuntu Kinetic):
assignee: Frank Heimes (fheimes) → nobody
Changed in s390-tools (Ubuntu Kinetic):
assignee: Frank Heimes (fheimes) → nobody
Changed in s390-tools-signed (Ubuntu Kinetic):
status: In Progress → Fix Committed
Changed in s390-tools-signed (Ubuntu Jammy):
status: New → In Progress
Changed in s390-tools (Ubuntu Kinetic):
status: In Progress → Fix Committed
Changed in s390-tools (Ubuntu Jammy):
status: New → In Progress
Changed in ubuntu-z-systems:
status: In Progress → Fix Committed
Revision history for this message
Simon Chopin (schopin) wrote :

The fix for this bug has been uploaded to Kinetic and the SRU queue for Jammy.

Frank Heimes (fheimes)
Changed in s390-tools (Ubuntu Jammy):
importance: Undecided → High
Changed in s390-tools-signed (Ubuntu Jammy):
importance: Undecided → High
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package s390-tools - 2.20.0-0ubuntu4

---------------
s390-tools (2.20.0-0ubuntu4) kinetic; urgency=medium

  * Fix chreipl-fcp-mpath (LP: #1971993)
    - Move chreipl-fcp-mpath* from /lib/udev/rules.d to /lib/udev.
    - d/control:
      + Build-Depend on bsdextrautils for hexdump
      + Add multiple explicit Depends on udev
      + s390-tools-chreipl-fcp-mpath: drop unnecessary Depends on lvm2
    - No longer change attributes of chreipl-fcp-mpath-common.sh to 755,
      since only the input script '.in' has a she-bang, but not the '.sh'
      anymore (was done with commit c2f8988).
    - Add d/p/0d15a07-chreipl-fcp-mpath-bundle-a-pre-cooked-man-page.patch
      to bundle a pre-cooked version of the man page for chreipl-fcp-mpath
      Required minor context adjustment for CHANGELOG.md hunk
      and changes in d/rules.
    - Add missing README.md to s390-tools-chreipl-fcp-mpath.doc
      (and with that also the README.md for genprotimg to s390-tools.docs).
  * Add new CPU-MF Counters for new IBM Z hardware (LP: #1960119) by:
    - d/p/2515832-util_arch-Add-IBM-z16-as-known-machine.patch and
    - d/p/cce5f51-cpumf-lscpumf-Add-IBM-z16-extended-counter-set-def.patch
  * Add exploitation support of new IBM Z crypto hardware (LP: #1959548) with:
    - d/p/b16a6d4f-lszcrypt-add-CEX8S-support.patch
    - d/p/bcbb6fca-zcryptstats-add-CEX8-support.patch
    - d/p/4382901d-lszcrypt-show-AP-bus-msg-size-limit-capability.patch
    - d/p/27dce331-lszcrypt-add-support-for-checkstop-state.patch
    - d/p/a29b3c89-lszcrypt-new-options-to-show-only-accel-cca-or-ep11-.patch
    - d/p/a8b0d7ac-lszcrypt-new-options-to-filter-cards-queues-only.patch
    - d/p/46fd42af-lszcrypt-new-option-to-show-the-serial-numbers-of-CC.patch
  * Stabilization of data collection in dbginfo.sh script (LP: #1971959)
    by adding several upstream patches:
    - d/p/*-dbginfo.sh-*.patch
    - whereas one needed minor context adjutment for the CHANGELOG.md hunk:
      d/p/50a4740-dbginfo.sh-replace-which-by-builtin-command-type-for.patch
  * Fix cmsfs-fuse mount failure due to unknown option '-o hard_remove'
    (LP: #1978323) with:
    d/p/0981df6-cmsfs-fuse-fix-enabling-of-hard_remove-option.patch

 -- Frank Heimes <email address hidden> Fri, 20 May 2022 13:48:34 +0200

Changed in s390-tools (Ubuntu Kinetic):
status: Fix Committed → Fix Released
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Please test proposed package

Hello bugproxy, or anyone else affected,

Accepted s390-tools into jammy-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/s390-tools/2.20.0-0ubuntu3.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-jammy to verification-done-jammy. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-jammy. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in s390-tools (Ubuntu Jammy):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-jammy
Frank Heimes (fheimes)
Changed in s390-tools-signed (Ubuntu Jammy):
status: In Progress → Fix Committed
Revision history for this message
bugproxy (bugproxy) wrote : Comment bridged from LTC Bugzilla

------- Comment From <email address hidden> 2022-06-24 04:25 EDT-------
I have installed Ubuntu 22 (jammy) and then updated to the latest s390-tools
version
# apt list -a s390-tools
Listing... Done
s390-tools/jammy-proposed,now 2.20.0-0ubuntu3.1 s390x [installed]
s390-tools/jammy 2.20.0-0ubuntu3 s390x

#
I can verify that the s390-tools package contains the extended counter set for
the z16 machine:
# lscpumf -c
perf event counter list for IBM z16
==============================================================================

Raw
...
8:128 L1D_RO_EXCL_WRITES

A directory write to the Level-1 Data cache where
the line was originally in a Read-Only state in the
cache but has been updated to be in the Exclusive
state that allows stores to the cache line.
Counter 128 / Extended Counter Set.

8:129 DTLB2_WRITES

A translation has been written into The Translation
Lookaside Buffer 2 (TLB2) and the request was made
by the Level-1 Data cache. This is a replacement
for what was provided for the DTLB on z13 and prior
machines.
Counter 129 / Extended Counter Set.
....
many more lines to follow.

Verification successful for s390-tools package

Revision history for this message
Frank Heimes (fheimes) wrote :

Many thx Thomas for the verification!
(I'm adjusting the tags accordingly ...)

Changed in s390-tools-signed (Ubuntu Kinetic):
status: Fix Committed → Fix Released
tags: added: verification-done-jammy
removed: verification-needed-jammy
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package s390-tools - 2.20.0-0ubuntu3.1

---------------
s390-tools (2.20.0-0ubuntu3.1) jammy; urgency=medium

  * Fix chreipl-fcp-mpath (LP: #1971993)
    - Move chreipl-fcp-mpath* from /lib/udev/rules.d to /lib/udev.
    - d/control:
      + Build-Depend on bsdextrautils for hexdump
      + Add multiple explicit Depends on udev
      + s390-tools-chreipl-fcp-mpath: drop unnecessary Depends on lvm2
    - No longer change attributes of chreipl-fcp-mpath-common.sh to 755,
      since only the input script '.in' has a she-bang, but not the '.sh'
      anymore (was done with commit c2f8988).
    - Add d/p/0d15a07-chreipl-fcp-mpath-bundle-a-pre-cooked-man-page.patch
      to bundle a pre-cooked version of the man page for chreipl-fcp-mpath
      Required minor context adjustment for CHANGELOG.md hunk
      and changes in d/rules.
    - Add missing README.md to s390-tools-chreipl-fcp-mpath.doc
      (and with that also the README.md for genprotimg to s390-tools.docs).
  * Add new CPU-MF Counters for new IBM Z hardware (LP: #1960119) by:
    - d/p/2515832-util_arch-Add-IBM-z16-as-known-machine.patch and
    - d/p/cce5f51-cpumf-lscpumf-Add-IBM-z16-extended-counter-set-def.patch
  * Add exploitation support of new IBM Z crypto hardware (LP: #1959548) with:
    - d/p/b16a6d4f-lszcrypt-add-CEX8S-support.patch
    - d/p/bcbb6fca-zcryptstats-add-CEX8-support.patch
    - d/p/4382901d-lszcrypt-show-AP-bus-msg-size-limit-capability.patch
    - d/p/27dce331-lszcrypt-add-support-for-checkstop-state.patch
    - d/p/a29b3c89-lszcrypt-new-options-to-show-only-accel-cca-or-ep11-.patch
    - d/p/a8b0d7ac-lszcrypt-new-options-to-filter-cards-queues-only.patch
    - d/p/46fd42af-lszcrypt-new-option-to-show-the-serial-numbers-of-CC.patch
  * Stabilization of data collection in dbginfo.sh script (LP: #1971959)
    by adding several upstream patches:
    - d/p/*-dbginfo.sh-*.patch
    - whereas one needed minor context adjutment for the CHANGELOG.md hunk:
      d/p/50a4740-dbginfo.sh-replace-which-by-builtin-command-type-for.patch
  * Fix cmsfs-fuse mount failure due to unknown option '-o hard_remove'
    (LP: #1978323) with:
    d/p/0981df6-cmsfs-fuse-fix-enabling-of-hard_remove-option.patch

 -- Frank Heimes <email address hidden> Fri, 20 May 2022 13:48:34 +0200

Changed in s390-tools (Ubuntu Jammy):
status: Fix Committed → Fix Released
Revision history for this message
Brian Murray (brian-murray) wrote : Update Released

The verification of the Stable Release Update for s390-tools has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Frank Heimes (fheimes)
Changed in s390-tools-signed (Ubuntu Jammy):
status: Fix Committed → Fix Released
Changed in ubuntu-z-systems:
status: Fix Committed → Fix Released
Revision history for this message
bugproxy (bugproxy) wrote : Comment bridged from LTC Bugzilla

------- Comment From <email address hidden> 2022-07-06 20:59 EDT-------
Fix was verified and released to -updates, therefore we can close the bug.
Thanks everybody for your work.
Changing status to: CLOSED

Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello bugproxy, or anyone else affected,

Accepted s390-tools into focal-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/s390-tools/2.12.0-0ubuntu3.6 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-focal to verification-done-focal. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-focal. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in s390-tools (Ubuntu Focal):
status: New → Fix Committed
tags: added: verification-needed-focal
Revision history for this message
Frank Heimes (fheimes) wrote :

Setting Impish entries to 'Won't Fix' since it meanwhile reached it's EOL.

Changed in s390-tools-signed (Ubuntu Impish):
status: New → Won't Fix
Changed in s390-tools (Ubuntu Impish):
status: New → Won't Fix
Revision history for this message
Frank Heimes (fheimes) wrote :

This SRU got now verified for focal - I'm adjusting the tags accordingly.

tags: added: verification-done verification-done-focal
removed: verification-needed verification-needed-focal
Revision history for this message
bugproxy (bugproxy) wrote : Comment bridged from LTC Bugzilla

------- Comment From <email address hidden> 2022-08-26 06:18 EDT-------
I have installed U20.04 to this level:
# uname -a
Linux a35lp67 5.4.0-125-generic #141-Ubuntu SMP Wed Aug 10 14:00:33 UTC 2022 s390x s390x s390x GNU/Linux
r# sb_release -cs
focal
~#

I have this installed the latest s390-tools package from focal-proposed:
# apt list --installed| fgrep s390-tools

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

s390-tools-signed/focal-proposed,now 2.12.0-0ubuntu3.6 s390x [installed,automatic]
s390-tools/focal-proposed,now 2.12.0-0ubuntu3.6 s390x [installed]
#

I can confirm that the s390-tools program lscpumf -c list all z16 extended counters from the extended counter set correctly.

Verification done and successful.

Revision history for this message
Frank Heimes (fheimes) wrote :

Thank you!

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package s390-tools - 2.12.0-0ubuntu3.6

---------------
s390-tools (2.12.0-0ubuntu3.6) focal; urgency=medium

  * d/p/lp1974437-s390-tools-lscpumf-Add-support-for-IBM-z16-extended.patch
    CPU-MF: Add extended counter set definitions for new IBM z16 (LP: #1960119)

 -- Frank Heimes <email address hidden> Mon, 13 Jun 2022 15:03:34 +0200

Changed in s390-tools (Ubuntu Focal):
status: Fix Committed → Fix Released
Frank Heimes (fheimes)
Changed in s390-tools-signed (Ubuntu Focal):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.