** Description changed:

+ SRU Justification:
+ 
+ [ Impact ]
+ 
+  * A new IBM Z hardware generation (z17) was introduced. libutil
+    needs to become aware of its machine types (9175/9176) to map
+    type <-> name and CPU-MF counters correctly.
+ 
+  * Without patching, z17 hardware is reported as "Unknown machine
+    type", and lscpumf does not list the z17-specific extended
+    counter sets.
+ 
+  * This is the Jammy counterpart of LP: #2103414
+    this is already incl. in noble and above.
+ 
+  * Required commits:
+    - b3db52fd ("libutil: Add machine type definition for machines
+      9175 and 9176")
+    - 120ad30f ("cpumf/lscpumf: Add support for IBM z17 counter sets")
+    - ef1799f3 ("s390-tools/libutil: Add machine type 3932"),
+      pre-requisite for b3db52fd, as already done for Noble.
+    - 7d855acd ("util_arch: Fix max HSA size for Z16 machine")
+ 
+  * The last commit is only req. for jammy, because jammy's
+    s390-tools v2.20.0 is still based on the pre-7d855acd numeric
+    comparison in util_arch_hsa_maxsize(), which ef1799f3 assumes
+    is already a switch statement.
+    This 'old' numeric comparison also under-reports the max HSA size
+    for IBM z16 (32 MiB instead of 512 MiB, since z16's type number
+    is numerically lower than z15's).
+    This additional potential issue is the reason why I haven't
+    backported ef1799f3 to the 'old' implementation, since it would
+    not solve the under-reporting.
+    And adding a fix for the under-reporting to a potential
+    ef1799f3 backport, would req. a similar amount of changes
+    compared to the additional commit, but would (unnecessarily)
+    diverge the backport significantly from the upstream commit,
+    which again would harm further maintenance.
+ 
+ [ Test Plan ]
+ 
+  * On an IBM z17 LPAR running Ubuntu 22.04 with this update (and
+    matching kernel CPU-MF support), enable the relevant counter sets
+    in the LPAR activation profile and confirm via 'perf list' /
+    'perf stat' that the new counters are usable.
+ 
+  * Check machine identification directly via lscpumf (uses libutil):
+      # lscpumf -C | head -1
+      perf event counter list for IBM z17
+    i.e. explicitly confirm it does NOT report "Unknown machine
+    type" (this exact check was flagged as missing during LP:
+    #2103414's review and had to be added there too).
+ 
+  * Confirm 'lscpumf -C' lists the full z17 extended counter set (see
+    upstream commit 120ad30f), using the same command IBM used to
+    verify LP: #2103414 on real z17 hardware:
+      # lscpumf -C | grep '^10:' | wc -l
+    Expected: 105 (confirmed by upstream on both Plucky and Noble).
+    Without commit 120ad30f, this reports only 28 (extended counter
+    set missing).
+ 
+  * Regression check: 'lscpumf -v' still correctly identifies existing
+    hardware (z13/z14/z15/z16). On a z16 (or z16 A02, type 3932)
+    system, confirm any util_arch_hsa_maxsize() consumer (e.g.
+    zgetdump's HSA dump size) now uses 512 MiB, not 32 MiB.
+ 
+ [ Where problems could occur ]
+ 
+  * As always with such table/enum extensions: a typo in a name or
+    type number, or an incorrectly placed/terminated case statement,
+    could cause wrong identification or reintroduce "Unknown machine
+    type" - leading to wrong event exposure, invalid perf
+    measurements, or sysfs inconsistencies.
+ 
+  * The extra 7d855acd patch changes the *implementation* of
+    util_arch_hsa_maxsize() (comparison -> switch), not just adds
+    cases. A logic error there could misreport max HSA size for an
+    already-supported machine type. Risk is mitigated by using the
+    verbatim upstream commit, already in production since s390-tools
+    2.31.0/Ubuntu 24.04.
+ 
+  * All of this is s390x-only code; no other architectures affected.
+    Patches 2-4 only add new code/cases; patch 1 only corrects the
+    Z16/Z16_A02 handling of one existing function.
+ 
+ [ Other Info ]
+ 
+  * The CPU-MF counters kernel work was already done.
+ 
+  * Already Fix Released for Noble/24.04 (2.31.0-0ubuntu5.2) via
+    LP: #2103414 and newer releases.
+ 
+  * This bug was previously marked "Won't Fix", partner requested
+    this as z17 enablement for jammy.
+ __________
+ 
  Description:
  Support for CPU-MF counters of new IBM z17 in s390-tools for Jammy (22.04) 
and Noble (24.04)
  
  This item covers the s390-tools part of the z17 support, i.e. changes to
  lscpumf and libutil.
  
  Required commit for s390-tools:
  
  
https://github.com/ibm-s390-linux/s390-tools/commit/b3db52fd165e6a26d9c73e51bd5322b55017ef94
  libutil: Add machine type definition for machines 9175 and 9176

** Changed in: s390-tools (Ubuntu Jammy)
       Status: Won't Fix => In Progress

** Changed in: s390-tools-signed (Ubuntu Jammy)
       Status: Won't Fix => In Progress

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2121810

Title:
  [UBUNTU 22.04] Support CPU-MF Counters for new IBM z17 - s390-tools
  part

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu-z-systems/+bug/2121810/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to