Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package powerpc-utils for openSUSE:Factory checked in at 2024-02-15 20:58:34 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/powerpc-utils (Old) and /work/SRC/openSUSE:Factory/.powerpc-utils.new.1815 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "powerpc-utils" Thu Feb 15 20:58:34 2024 rev:142 rq:1146170 version:1.3.12 Changes: -------- --- /work/SRC/openSUSE:Factory/powerpc-utils/powerpc-utils.changes 2024-02-06 16:33:12.444129660 +0100 +++ /work/SRC/openSUSE:Factory/.powerpc-utils.new.1815/powerpc-utils.changes 2024-02-15 20:58:36.788166681 +0100 @@ -1,0 +2,25 @@ +Fri Feb 9 12:21:41 UTC 2024 - Michal Suchanek <msucha...@suse.com> + +- Do not print an error when the kernel does not support sysfs smt interface + * ppc64_cpu-Clean-up-sysfs-smt-control-error-handling.patch + +------------------------------------------------------------------- +Thu Feb 8 09:43:47 UTC 2024 - Michal Suchanek <msucha...@suse.com> + +- Update to version 1.3.12 + * Add drmgr CPU DLPAR hooks + * Fix lsslot output (bsc#1219716 ltc#204541) +- Drop upstreamed patches + * lparstat-Fix-negative-values-seen-while-running-lpar.patch + * lparstat-report-mixed-SMT-state.patch + * lparstat-Fix-offline-threads-uninitialized-entries.patch + * powerpc-utils-scripts-ofpathname-handle-nsid-of-nvme.patch + * bootlist-Support-multiple-dev-paths-for-a-nvme-boot-.patch + * rtas_dbg-Fix-the-large-negative-values-in-rtas_dbg.patch + * powerpc-nvram-fix-segmentation-fault-issue-in-print-.patch + * powerpc-nvram-Fix-Segmentation-fault-issue-in-nvram-.patch + * nvram-man-page-and-help-output-are-not-in-sync.patch + * ppc64_cpu-info-fix-bad-report-when-non-continuous-CP.patch + * hcn-init-Split-services-per-connection-manager.patch + +------------------------------------------------------------------- Old: ---- bootlist-Support-multiple-dev-paths-for-a-nvme-boot-.patch hcn-init-Split-services-per-connection-manager.patch lparstat-Fix-negative-values-seen-while-running-lpar.patch lparstat-Fix-offline-threads-uninitialized-entries.patch lparstat-report-mixed-SMT-state.patch nvram-man-page-and-help-output-are-not-in-sync.patch powerpc-nvram-Fix-Segmentation-fault-issue-in-nvram-.patch powerpc-nvram-fix-segmentation-fault-issue-in-print-.patch powerpc-utils-1.3.11.tar.gz powerpc-utils-scripts-ofpathname-handle-nsid-of-nvme.patch ppc64_cpu-info-fix-bad-report-when-non-continuous-CP.patch rtas_dbg-Fix-the-large-negative-values-in-rtas_dbg.patch New: ---- powerpc-utils-1.3.12.tar.gz ppc64_cpu-Clean-up-sysfs-smt-control-error-handling.patch BETA DEBUG BEGIN: Old: * powerpc-utils-scripts-ofpathname-handle-nsid-of-nvme.patch * bootlist-Support-multiple-dev-paths-for-a-nvme-boot-.patch * rtas_dbg-Fix-the-large-negative-values-in-rtas_dbg.patch Old: * ppc64_cpu-info-fix-bad-report-when-non-continuous-CP.patch * hcn-init-Split-services-per-connection-manager.patch Old:- Drop upstreamed patches * lparstat-Fix-negative-values-seen-while-running-lpar.patch * lparstat-report-mixed-SMT-state.patch Old: * lparstat-report-mixed-SMT-state.patch * lparstat-Fix-offline-threads-uninitialized-entries.patch * powerpc-utils-scripts-ofpathname-handle-nsid-of-nvme.patch Old: * lparstat-Fix-negative-values-seen-while-running-lpar.patch * lparstat-report-mixed-SMT-state.patch * lparstat-Fix-offline-threads-uninitialized-entries.patch Old: * powerpc-nvram-Fix-Segmentation-fault-issue-in-nvram-.patch * nvram-man-page-and-help-output-are-not-in-sync.patch * ppc64_cpu-info-fix-bad-report-when-non-continuous-CP.patch Old: * powerpc-nvram-fix-segmentation-fault-issue-in-print-.patch * powerpc-nvram-Fix-Segmentation-fault-issue-in-nvram-.patch * nvram-man-page-and-help-output-are-not-in-sync.patch Old: * rtas_dbg-Fix-the-large-negative-values-in-rtas_dbg.patch * powerpc-nvram-fix-segmentation-fault-issue-in-print-.patch * powerpc-nvram-Fix-Segmentation-fault-issue-in-nvram-.patch Old: * lparstat-Fix-offline-threads-uninitialized-entries.patch * powerpc-utils-scripts-ofpathname-handle-nsid-of-nvme.patch * bootlist-Support-multiple-dev-paths-for-a-nvme-boot-.patch Old: * nvram-man-page-and-help-output-are-not-in-sync.patch * ppc64_cpu-info-fix-bad-report-when-non-continuous-CP.patch * hcn-init-Split-services-per-connection-manager.patch Old: * bootlist-Support-multiple-dev-paths-for-a-nvme-boot-.patch * rtas_dbg-Fix-the-large-negative-values-in-rtas_dbg.patch * powerpc-nvram-fix-segmentation-fault-issue-in-print-.patch BETA DEBUG END: BETA DEBUG BEGIN: New:- Do not print an error when the kernel does not support sysfs smt interface * ppc64_cpu-Clean-up-sysfs-smt-control-error-handling.patch BETA DEBUG END: ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ powerpc-utils.spec ++++++ --- /var/tmp/diff_new_pack.9AKxwr/_old 2024-02-15 20:58:37.560194561 +0100 +++ /var/tmp/diff_new_pack.9AKxwr/_new 2024-02-15 20:58:37.560194561 +0100 @@ -17,7 +17,7 @@ Name: powerpc-utils -Version: 1.3.11 +Version: 1.3.12 Release: 0 Summary: Utilities for PowerPC Hardware License: GPL-2.0-or-later @@ -29,18 +29,8 @@ Patch2: ofpathname_powernv.patch Patch3: fix_kexec_service_name_for_suse.patch Patch4: libvirt-service-dep.patch -Patch5: lparstat-Fix-negative-values-seen-while-running-lpar.patch -Patch6: lparstat-report-mixed-SMT-state.patch -Patch7: lparstat-Fix-offline-threads-uninitialized-entries.patch Patch8: ppc64_cpu-Support-partial-SMT-level-through-SYS-FS-s.patch -Patch9: powerpc-utils-scripts-ofpathname-handle-nsid-of-nvme.patch -Patch10: bootlist-Support-multiple-dev-paths-for-a-nvme-boot-.patch -Patch11: rtas_dbg-Fix-the-large-negative-values-in-rtas_dbg.patch -Patch12: powerpc-nvram-fix-segmentation-fault-issue-in-print-.patch -Patch13: powerpc-nvram-Fix-Segmentation-fault-issue-in-nvram-.patch -Patch14: nvram-man-page-and-help-output-are-not-in-sync.patch -Patch15: ppc64_cpu-info-fix-bad-report-when-non-continuous-CP.patch -Patch16: hcn-init-Split-services-per-connection-manager.patch +Patch9: ppc64_cpu-Clean-up-sysfs-smt-control-error-handling.patch BuildRequires: autoconf BuildRequires: automake BuildRequires: libnuma-devel ++++++ powerpc-utils-1.3.11.tar.gz -> powerpc-utils-1.3.12.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/powerpc-utils-1.3.11/.gitignore new/powerpc-utils-1.3.12/.gitignore --- old/powerpc-utils-1.3.11/.gitignore 2023-01-24 19:20:23.000000000 +0100 +++ new/powerpc-utils-1.3.12/.gitignore 2024-02-07 20:10:37.000000000 +0100 @@ -49,7 +49,9 @@ /src/drmgr/Makefile.in /systemd/smt_off.service /systemd/smtstate.service -/systemd/hcn-init.service +/systemd/hcn-init.service.in +/systemd/hcn-init-NetworkManager.service +/systemd/hcn-init-wicked.service # # git files that we don't want to ignore even it they are dot-files diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/powerpc-utils-1.3.11/Changelog new/powerpc-utils-1.3.12/Changelog --- old/powerpc-utils-1.3.11/Changelog 2023-01-24 19:20:23.000000000 +0100 +++ new/powerpc-utils-1.3.12/Changelog 2024-02-07 20:10:37.000000000 +0100 @@ -1,3 +1,572 @@ +powerpc-utils-1.3.12 +===================================================================== +commit 2f0bdb051fe70fbd6cb608ea1b63a75223dc44a4 +Author: Tyrel Datwyler <tyr...@linux.ibm.com> +Date: Tue Feb 6 16:58:12 2024 -0800 + + lsslot: fix reporting of L3 caches with -b option + + Currently if a L2 cache has an associated dependent L3 cache the lsslot + command for cpu connector types will fail to report the L3 cache when + using the -b option. This is due to a typo such that the check is made + between the the L2 caches l2-cache property value and its own + ibm,phandle property. The check should be against the L3 caches + ibm,phandle property as the l2-cache property contains the phandle of + the dependent cache. + + Without patch: + ./src/drmgr/lsslot -c cpu -b + drc-name OFDT-node drc_index thread id(s) l2-cache l3-cache + CPU 1 PowerPC,POWER8@0 10000000 0 1 2 3 4 5 6 7 l2-cache@200a N/A + + With patch: + ./src/drmgr/lsslot -c cpu -b + drc-name OFDT-node drc_index thread id(s) l2-cache l3-cache + CPU 1 PowerPC,POWER8@0 10000000 0 1 2 3 4 5 6 7 l2-cache@200a l3-cache@310a + + Signed-off-by: Tyrel Datwyler <tyr...@linux.ibm.com> + +commit a63f08289611e3c76814a3b9fbb7ef7c56d13ff5 +Author: Tyrel Datwyler <tyr...@linux.ibm.com> +Date: Thu Feb 1 07:19:58 2024 +0530 + + lsslot: fix and unify formatting of cpu slots + + When listing cpu slots with and without the -b option the formatting is + inconsistent and some column headers and associated data are not aligned. + + Adjusted format strings accordingly. + + Without patch: + localhost:~/powerpc-utils # ./src/drmgr/lsslot -c cpu + drc-name OFDT-node drc_index thread id(s) + CPU 41 PowerPC,POWER10@28 10000028 28 29 2a 2b 2c 2d 2e 2f + CPU 33 PowerPC,POWER10@20 10000020 20 21 22 23 24 25 26 27 + CPU 25 PowerPC,POWER10@18 10000018 18 19 1a 1b 1c 1d 1e 1f + CPU 17 PowerPC,POWER10@10 10000010 10 11 12 13 14 15 16 17 + CPU 9 PowerPC,POWER10@8 10000008 8 9 a b c d e f + CPU 1 PowerPC,POWER10@0 10000000 0 1 2 3 4 5 6 7 + + localhost:~/powerpc-utils # ./src/drmgr/lsslot -c cpu -b + drc-name OFDT-node drc_index thread id(s) l2-cache l3-cache + CPU 41 PowerPC,POWER10@28 10000028 28 29 2a 2b 2c 2d 2e 2f N/A N/A + CPU 33 PowerPC,POWER10@20 10000020 20 21 22 23 24 25 26 27 N/A N/A + CPU 25 PowerPC,POWER10@18 10000018 18 19 1a 1b 1c 1d 1e 1f N/A N/A + CPU 17 PowerPC,POWER10@10 10000010 10 11 12 13 14 15 16 17 N/A N/A + CPU 9 PowerPC,POWER10@8 10000008 8 9 a b c d e f N/A N/A + CPU 1 PowerPC,POWER10@0 10000000 0 1 2 3 4 5 6 7 N/A N/A + + With patch: + localhost:~/powerpc-utils # ./src/drmgr/lsslot -c cpu + drc-name OFDT-node drc_index thread id(s) + CPU 41 PowerPC,POWER10@28 10000028 28 29 2a 2b 2c 2d 2e 2f + CPU 33 PowerPC,POWER10@20 10000020 20 21 22 23 24 25 26 27 + CPU 25 PowerPC,POWER10@18 10000018 18 19 1a 1b 1c 1d 1e 1f + CPU 17 PowerPC,POWER10@10 10000010 10 11 12 13 14 15 16 17 + CPU 9 PowerPC,POWER10@8 10000008 8 9 a b c d e f + CPU 1 PowerPC,POWER10@0 10000000 0 1 2 3 4 5 6 7 + + localhost:~/powerpc-utils # ./src/drmgr/lsslot -c cpu -b + drc-name OFDT-node drc_index thread id(s) l2-cache l3-cache + CPU 41 PowerPC,POWER10@28 10000028 28 29 2a 2b 2c 2d 2e 2f N/A N/A + CPU 33 PowerPC,POWER10@20 10000020 20 21 22 23 24 25 26 27 N/A N/A + CPU 25 PowerPC,POWER10@18 10000018 18 19 1a 1b 1c 1d 1e 1f N/A N/A + CPU 17 PowerPC,POWER10@10 10000010 10 11 12 13 14 15 16 17 N/A N/A + CPU 9 PowerPC,POWER10@8 10000008 8 9 a b c d e f N/A N/A + CPU 1 PowerPC,POWER10@0 10000000 0 1 2 3 4 5 6 7 N/A N/A + + Signed-off-by: Tyrel Datwyler <tyr...@linux.ibm.com> + +commit 01bc16de40385467cd32440da43ff02b0f0e856c +Author: Tyrel Datwyler <tyr...@linux.ibm.com> +Date: Thu Feb 1 07:02:49 2024 +0530 + + lsslot: fix displaying cpu slots and caches with -b option + + The format string for printing the drc-name, OFDT-node, and drc-index in + list_cpus_and_caches() contains a spurious '%' qualifier at the end of + the string. Historically, this was ignored by compilers and the string + populated anyways. However, we since observed lsslot built on SLES 15 + SP6 where the string is not populated. + + Removing the spurious '%' fixes the issue. + + Without patch: + localhost:~ # lsslot -c cpu -b + drc-name OFDT-node drc_index thread id(s) l2-cache l3-cache + 28 29 2a 2b 2c 2d 2e 2f N/A N/A + 20 21 22 23 24 25 26 27 N/A N/A + 18 19 1a 1b 1c 1d 1e 1f N/A N/A + 10 11 12 13 14 15 16 17 N/A N/A + 8 9 a b c d e f N/A N/A + 0 1 2 3 4 5 6 7 N/A N/A + + With patch: + localhost:~/powerpc-utils # ./src/drmgr/lsslot -c cpu -b + drc-name OFDT-node drc_index thread id(s) l2-cache l3-cache + CPU 41 PowerPC,POWER10@28 10000028 28 29 2a 2b 2c 2d 2e 2f N/A N/A + CPU 33 PowerPC,POWER10@20 10000020 20 21 22 23 24 25 26 27 N/A N/A + CPU 25 PowerPC,POWER10@18 10000018 18 19 1a 1b 1c 1d 1e 1f N/A N/A + CPU 17 PowerPC,POWER10@10 10000010 10 11 12 13 14 15 16 17 N/A N/A + CPU 9 PowerPC,POWER10@8 10000008 8 9 a b c d e f N/A N/A + CPU 1 PowerPC,POWER10@0 10000000 0 1 2 3 4 5 6 7 N/A N/A + + Signed-off-by: Tyrel Datwyler <tyr...@linux.ibm.com> + +commit 5f825c75c6dfc2a95af1eebb6e364587d178deee +Author: Michal Suchanek <msucha...@suse.de> +Date: Thu Jul 21 12:38:16 2022 +0200 + + hcn-init: Split services per connection manager. + + The universal service using network.service alias does not work + reliably. + + Use one service per supported connection manager. + + Signed-off-by: Michal Suchanek <msucha...@suse.de> + Signed-off-by: Tyrel Datwyler <tyr...@linux.ibm.com> + +commit f1a8ed892e18b83cb0483e8f8f8cbc512fa8510c +Author: Laurent Dufour <lduf...@linux.ibm.com> +Date: Thu Aug 10 11:47:07 2023 +0200 + + ppc64_cpu/info: fix bad report when non continuous CPU ids + + When CPU ids are not continuous, let say that the kernel didn't reuse a set + of CPU ids already used on a different nodes, the output of ppc64_cpu + --info is not correct. + + For instance, in the example below the CPU id 48 to 55 haven't been reused + by the kernel when a CPU has been added after a LPM operation. + Note that the system is running in SMT=4. + + The numactl -H command is providing the correct set of CPU: + ltczep3-lp4:~ # numactl -H + available: 2 nodes (0-1) + node 0 cpus: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 64 65 66 67 68 69 70 71 + node 0 size: 7177 MB + node 0 free: 4235 MB + node 1 cpus: 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 + node 1 size: 24508 MB + node 1 free: 23539 MB + node distances: + node 0 1 + 0: 10 40 + 1: 40 10 + + But ppc64_cpu --info is reporting the CPUs 48 to 55 offlined while not + reporting at all the CPU 65 to 71: + ltczep3-lp4:~ # ppc64_cpu --info + Core 0: 0* 1* 2* 3* 4* 5* 6* 7* + Core 1: 8* 9* 10* 11* 12* 13* 14* 15* + Core 2: 16* 17* 18* 19* 20* 21* 22* 23* + Core 3: 24* 25* 26* 27* 28* 29* 30* 31* + Core 4: 32* 33* 34* 35* 36* 37* 38* 39* + Core 5: 40* 41* 42* 43* 44* 45* 46* 47* + Core 6: 48 49 50 51 52 53 54 55 + + This is because it is considering that the CPU id are continuous which is + not the case here. + + To prevent that, when looking for a core, it is now first checking that the + physical_id of the first thread in that core is defined (not -1). If that + the case this means that CPU/core is present. + + With that patch applied, ppc64_cpu --info is reporting: + ltczep3-lp4:~ # pc64_cpu --info + Core 0: 0* 1* 2* 3* 4 5 6 7 + Core 1: 8* 9* 10* 11* 12 13 14 15 + Core 2: 16* 17* 18* 19* 20 21 22 23 + Core 3: 24* 25* 26* 27* 28 29 30 31 + Core 4: 32* 33* 34* 35* 36 37 38 39 + Core 5: 40* 41* 42* 43* 44 45 46 47 + Core 6: 64* 65* 66* 67* 68 69 70 71 + + Signed-off-by: Laurent Dufour <lduf...@linux.ibm.com> + Signed-off-by: Tyrel Datwyler <tyr...@linux.ibm.com> + +commit d604cc779741c29cbdc8da97cbfc1512fd21fc1b +Author: Likhitha Korrapati <likhi...@linux.ibm.com> +Date: Fri Aug 11 00:41:14 2023 -0500 + + nvram man page and --help output are not in sync + + The nvram man page and the output from --help option are not in + sync and few of the options are missing in man page. + + The options that are missing are ascii, dump, nvram-size, zero. + These options are added through the commit ids [1], [2]. + + This patch adds the above missing options to the nvram. + + [1] https://github.com/ibm-power-utilities/powerpc-utils/commit/0e09f4e2898e7dea556479b018a7f4bf12108099 + [2] https://github.com/ibm-power-utilities/powerpc-utils/commit/976dbe9bb7b01b135cac3e7bbd1dce0cdc88636a + + Signed-off-by: Likhitha Korrapati <likhi...@linux.ibm.com> + Signed-off-by: Tyrel Datwyler <tyr...@linux.ibm.com> + +commit 882335a30d04032d2684e165f70646b368a788b4 +Author: Wen Xiong <wenxi...@linux.ibm.com> +Date: Tue Jan 30 10:49:13 2024 -0600 + + bootlist: Support multiple dev paths for a nvme boot device + + Multipath splitter drawer is going to support two physical paths for + each nvme device. + This patch adds the support for multiple device/of paths for a nvme boot + device. + + For example, + #lsslot -c pci + U50EE.001.WZS000E-P3-C1-R1 U.2 PCI-E capable, Rev 4, 4x lanes with 2x + lanes connected 0581:10:00.0 + U50EE.001.WZS000E-P3-C1-R2 U.2 PCI-E capable, Rev 4, 4x lanes with 2x + lanes connected 0521:10:00.0 + + #nvme list-subsys + nvme-subsys1 - + NQN=nqn.1994-11.com.samsung:nvme:PM1735a:2.5-inch:S6RUNE0R900042 + hostnqn=nqn.2014-08.org.nvmexpress:uuid:3c6c1ace-e9b1-4a17-8ff0-6a84d3dd15f4 + iopolicy=numa + \ + +- nvme1 pcie 0523:20:00.0 live + +- nvme0 pcie 0583:20:00.0 live + + # bootlist -m normal nvme1n1 + # bootlist -m normal -o + nvme0 + nvme1n1 + #bootlist -m normal -r + /pci@800000020000583/pci1014,6bc@0/namespace@1 + /pci@800000020000523/pci1014,6bc@0/namespace@1 + + Signed-off-by: Wen Xiong <wenxi...@linux.ibm.com> + [tyreld: fixup whitespace errors] + Signed-off-by: Tyrel Datwyler <tyr...@linux.ibm.com> + +commit a6d31caf4eaa453d3ec879f02163b3a515789b85 +Author: Likhitha Korrapati <likhi...@linux.ibm.com> +Date: Mon Sep 11 05:23:37 2023 -0500 + + powerpc/nvram: Fix Segmentation fault issue in nvram-size. + + nvram-size option results in segmentation fault when the user + specifies value larger than the default nvram size + + Without the patch: + [root@xxx ~]# nvram --nvram-size 1048592 + nvram: WARNING: expected 1048592 bytes, but only read 15360! + Segmentation fault (core dumped) + + Segmentation fault is caused because the phead->length is becoming 0. + And because of this the p_start doesn't get updated which makes the + while loop run infinitely resulting in segmentation fault. + This patch adds a condition check for phead->length to avoid infinite + while loop. + + With the patch: + [root@xxx src]# ./nvram --nvram-size 1048592 + ./nvram: WARNING: expected 1048592 bytes, but only read 15360! + [root@xxx src]# ./nvram --nvram-size 268435456 + ./nvram: WARNING: expected 268435456 bytes, but only read 15360! + [root@xxx src]# + + Reported-by: Shirisha Ganta <shiri...@linux.ibm.com> + Signed-off-by: Likhitha Korrapati <likhi...@linux.ibm.com> + [tyreld: fixed up else block] + Signed-off-by: Tyrel Datwyler <tyr...@linux.ibm.com> + +commit 3f72b8326a2fc9a9dffb4b31d0ce3abf12e24751 +Author: Likhitha Korrapati <likhi...@linux.ibm.com> +Date: Thu Jan 25 15:44:02 2024 +0530 + + powerpc/nvram: fix segmentation fault issue in print-config + + print-config option in nvram results in segmentation fault when the + user provides a very large value. + + without the patch: + [root@xxx powerpc-utils]# nvram --print-config=real-mode? + true + [root@xxx powerpc-utils]# nvram --print-config=$(perl -e 'p + rint "A"x1000000') + Segmentation fault (core dumped) + + The Segmentation fault occurs because the code tries to access memory + beyond the bounds of the data at index varlen. varlen is the length of + the string provided by the user. + + This patch adds a condition to check whether the length of the data is + greater than varlen to prevent accessing out of bounds. + + with the patch: + [root@xxx powerpc-utils]# ./src/nvram --print-config=real-m + ode? + true + [root@xxx powerpc-utils]# ./src/nvram --print-config=$(perl + -e 'print "A"x1000000') + + Reported-by: Shirisha Ganta <shiri...@linux.ibm.com> + Signed-off-by: Likhitha Korrapati <likhi...@linux.ibm.com> + Signed-off-by: Tyrel Datwyler <tyr...@linux.ibm.com> + +commit 8a7aa61c5f520df03e53e6f7e1d63b7d5c432376 +Author: Wen Xiong <wenxi...@linux.ibm.com> +Date: Wed Nov 15 14:37:43 2023 -0600 + + powerpc-utils/scripts/ofpathname: handle nsid of nvme device as hex number + + Installation fails if nsid of nvme device is greater than 10. + + The patch fixes the issue and handle nsid of nvme ad a hex number. + + Signed-off-by: Wen Xiong <wenxi...@linux.ibm.com> + Signed-off-by: Tyrel Datwyler <tyr...@linux.ibm.com> + +commit 9caa77e4477a73064a6deea253fd3faea32648fb +Author: Likhitha Korrapati <likhi...@linux.ibm.com> +Date: Fri Nov 17 01:42:29 2023 -0500 + + rtas_dbg: Fix the large negative values in rtas_dbg + + without the patch: + [root@xxx powerpc-utils]# rtas_dbg -l ibm,rks-hcalls + Could not get rtas token for ibm,indicator-0002 + Could not get rtas token for ibm,integrated-stop-self + Could not get rtas token for ibm,indicator-9005 + Could not get rtas token for ibm,extended-os-term + Could not get rtas token for ibm,indicator-0001 + Could not get rtas token for ibm,sensor-0009 + Could not get rtas token for ibm,recoverable-epow3 + Could not get rtas token for ibm,sensor-9005 + Could not get rtas token for ibm,change-msix-capable + Could not get rtas token for ibm,sensor-0005 + Could not get rtas token for ibm,sensor-0001 + ibm,rks-hcalls -536870912 + + The large negatives values are due to incompatible format(%d). + The data type of the token variable is uint32_t.This patch + modifies the format(%u) to align with its data type(uint32_t). + + with the patch: + [root@xxx powerpc-utils]# ./src/rtas_dbg -l ibm,rks-hcalls + Could not get rtas token for ibm,indicator-0002 + Could not get rtas token for ibm,integrated-stop-self + Could not get rtas token for ibm,indicator-9005 + Could not get rtas token for ibm,extended-os-term + Could not get rtas token for ibm,indicator-0001 + Could not get rtas token for ibm,sensor-0009 + Could not get rtas token for ibm,recoverable-epow3 + Could not get rtas token for ibm,sensor-9005 + Could not get rtas token for ibm,change-msix-capable + Could not get rtas token for ibm,sensor-0005 + Could not get rtas token for ibm,sensor-0001 + ibm,rks-hcalls 3758096384 + + Reported-by: Shirisha Ganta <shiri...@linux.ibm.com> + Signed-off-by: Likhitha Korrapati <likhi...@linux.ibm.com> + Signed-off-by: Tyrel Datwyler <tyr...@linux.ibm.com> + +commit c1d6a1473211e4e470aee8256d613f16a75897d6 +Author: Laurent Dufour <lduf...@linux.ibm.com> +Date: Wed Apr 5 17:49:23 2023 +0200 + + drmgr: Add CPU hook in the man page + + Also fixing few minor typos. + + Signed-off-by: Laurent Dufour <lduf...@linux.ibm.com> + Signed-off-by: Tyrel Datwyler <tyr...@linux.ibm.com> + +commit d23e7ad0ed939dcd33f97839e0551707c78af77a +Author: Laurent Dufour <lduf...@linux.ibm.com> +Date: Wed Apr 5 17:49:22 2023 +0200 + + drmgr/cpu: add CPU add and remove operation's hooks + + Call drmgr's hooks before and after a CPU add or remove operation is done. + + At the PRE phase, the DRC_COUNT hook parameter is set to the desired number + of CPU to add or remove. At the POST phase, it is set to the actual number + of CPU added or removed. + + Signed-off-by: Laurent Dufour <lduf...@linux.ibm.com> + Signed-off-by: Tyrel Datwyler <tyr...@linux.ibm.com> + +commit 24500fe33ceb84423730cb1ed654efbdc43deba8 +Author: Laurent Dufour <lduf...@linux.ibm.com> +Date: Wed Apr 5 17:49:21 2023 +0200 + + drmgr/common: add a DRC_COUNT parameter to the hooks + + The new DRC_COUNT will be set when running operation on countable items, + like adding or removing CPUs. + + For the migration operation, this doesn't make sense and it is set to 0. + + Using a signed integer so we can pass signed values, if needed in the + future. + + Signed-off-by: Laurent Dufour <lduf...@linux.ibm.com> + Signed-off-by: Tyrel Datwyler <tyr...@linux.ibm.com> + +commit 35a7487f0ec039bf8ea9e3c87f3b176ca1580145 +Author: Laurent Dufour <lduf...@linux.ibm.com> +Date: Wed Apr 5 17:49:20 2023 +0200 + + drmgr/common: drmgr: Add action parameter to the hook mechanism + + The user action is now exported to the hook ran by drmgr. + It is exported in the environment variable ACTION. + + Signed-off-by: Laurent Dufour <lduf...@linux.ibm.com> + Signed-off-by: Tyrel Datwyler <tyr...@linux.ibm.com> + +commit c2922361b9bb2647b862056aa40095cdbfefee2f +Author: Laurent Dufour <lduf...@linux.ibm.com> +Date: Wed Apr 5 17:49:19 2023 +0200 + + drmgr/common: make drc_type_str and hook_phase_name const + + The drc_type_str and hook_phase_name should be declared as const. + No functional changes. + + Fixes: 372599ed28d6 ("drmgr: introduce a DRC type name table") + Fixes: e0928dc5e537 ("drmgr: introducing the hook framework") + Suggested-by: Tyrel Datwyler <tyr...@linux.ibm.com> + Signed-off-by: Laurent Dufour <lduf...@linux.ibm.com> + Signed-off-by: Tyrel Datwyler <tyr...@linux.ibm.com> + +commit dee15756bcb287ccf39a904be07c90107b13844b +Author: Laurent Dufour <lduf...@linux.ibm.com> +Date: Wed May 3 10:50:15 2023 +0200 + + lparstat: Fix offline threads uninitialized entries + + When some threads are offline, lparstat -E is failing like that: + + $ ppc64_cpu --info # CPU 20 is offline + Core 0: 0* 1* 2* 3* 4* 5* 6* 7* + Core 1: 8* 9* 10* 11* 12* 13* 14* 15* + Core 2: 16* 17* 18* 19* 20 21* 22* 23* + Core 3: 24* 25* 26* 27* 28* 29* 30* 31* + Core 4: 32* 33* 34* 35* 36* 37* 38* 39* + Core 5: 40* 41* 42* 43* 44* 45* 46* 47* + $ lparstat -E + Failed to read /sys/devices/system/cpu/cpu0/spurr + + The message is complaining about CPU0 but the real issue is that in + parse_sysfs_values() the test cpu_sysfs_fds[i].spurr >= 0 is valid even if + the entry has not been initialized (cpu_sysfs_fds is alloc cleared). So + if the number of threads online seen in assign_cpu_sysfs_fds is lower than + threads_in_system, the loop in parse_sysfs_values() will read uninitialized + entry, where .cpu=0. + + To prevent that, unset entries in the cpu_sysfs_fds should have the spurr + fd set to -1. + + Signed-off-by: Laurent Dufour <lduf...@linux.ibm.com> + Signed-off-by: Tyrel Datwyler <tyr...@linux.ibm.com> + +commit b2672fa3d462217ccd057a2cd307af2448e78757 +Author: Laurent Dufour <lduf...@linux.ibm.com> +Date: Wed May 3 10:50:14 2023 +0200 + + lparstat: report mixed SMT state + + when SMT state is mixed like this one (CPU 4 is offline): + + $ ppc64_cpu --info + Core 0: 0* 1* 2* 3* 4 5* 6* 7* + Core 1: 8* 9* 10* 11* 12* 13* 14* 15* + Core 2: 16* 17* 18* 19* 20* 21* 22* 23* + Core 3: 24* 25* 26* 27* 28* 29* 30* 31* + Core 4: 32* 33* 34* 35* 36* 37* 38* 39* + Core 5: 40* 41* 42* 43* 44* 45* 46* 47* + $ ppc64_cpu --smt + SMT=7: 0 + SMT=8: 1-5 + + ppc64_cpu --smt is handling that nicely but lparstat failed reporting the + SMT state: + $ /usr/sbin/lparstat + Failed to get smt state + + System Configuration + type=Dedicated mode=Capped smt=Capped lcpu=6 mem=65969728 kB cpus=0 ent=6.00 + + %user %sys %wait %idle physc %entc lbusy app vcsw phint + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + 0.02 0.01 0.00 99.97 3.41 56.83 0.02 0.00 4061778 156 + + Makes lparstat reporting "smt=mixed" in that case. + __do_smt is now returning 0 when the SMT state is mixed instead of -1 which + is also reported when an error is detected. + This doesn't change the call made by ppc64_cpu which is using + print_smt_state=true and so is expecting a returned value equal to 0 or -1. + + With that patch applied, lparstat print that in the above case: + $lparstat + + System Configuration + type=Dedicated mode=Capped smt=Mixed lcpu=6 mem=65969728 kB cpus=0 ent=6.00 + + %user %sys %wait %idle physc %entc lbusy app vcsw phint + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + 0.01 0.01 0.00 99.97 3.43 57.17 0.02 0.00 4105654 156 + + Signed-off-by: Laurent Dufour <lduf...@linux.ibm.com> + Signed-off-by: Tyrel Datwyler <tyr...@linux.ibm.com> + +commit 73ba26c1240a25e7699449e82cfc09dad10fed80 +Author: Sathvika Vasireddy <s...@linux.ibm.com> +Date: Fri Dec 9 15:26:46 2022 +0530 + + lparstat: Fix negative values seen while running lparstat with -E option + + Negative values are seen while running lparstat with -E option. + This is because delta_purr value is less than delta_idle_purr. + Given that these values are read from different sources, a + small variation in the values is possible. So, in such cases, + round down delta_idle_purr to delta_purr. + + Without this patch: + ===== + System Configuration + type=Dedicated mode=Capped smt=8 lcpu=240 mem=67033290112 kB cpus=0 + ent=240.00 + + ---Actual--- -Normalized- + %busy %idle Frequency %busy %idle + ------ ------ ------------- ------ ------ + -0.03 100.02 3.93GHz[111%] 0.01 110.97 + 0.00 100.00 3.93GHz[111%] 0.01 110.99 + -0.04 100.03 3.93GHz[111%] 0.01 110.98 + 0.06 99.95 3.93GHz[111%] 0.01 110.99 + 0.02 99.98 3.93GHz[111%] 0.01 110.99 + ===== + + With this patch: + ===== + System Configuration + type=Dedicated mode=Capped smt=8 lcpu=240 mem=67033290112 kB cpus=0 + ent=240.00 + + ---Actual--- -Normalized- + %busy %idle Frequency %busy %idle + ------ ------ ------------- ------ ------ + 0.03 99.96 3.93GHz[111%] 0.01 110.98 + 0.00 100.00 3.93GHz[111%] 0.01 110.99 + 0.03 99.97 3.93GHz[111%] 0.01 110.99 + 0.00 100.00 3.93GHz[111%] 0.01 110.99 + 0.09 99.90 3.93GHz[111%] 0.01 110.99 + ===== + + Reported-by: Shirisha Ganta <shirisha.gan...@ibm.com> + Signed-off-by: Sathvika Vasireddy <s...@linux.ibm.com> + Signed-off-by: Tyrel Datwyler <tyr...@linux.ibm.com> + powerpc-utils-1.3.11 ===================================================================== commit fc3b6044401e5625bc825d594f8b89fda49b6596 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/powerpc-utils-1.3.11/Makefile.am new/powerpc-utils-1.3.12/Makefile.am --- old/powerpc-utils-1.3.11/Makefile.am 2023-01-24 19:20:23.000000000 +0100 +++ new/powerpc-utils-1.3.12/Makefile.am 2024-02-07 20:10:37.000000000 +0100 @@ -63,7 +63,7 @@ man_MANS += man/smtstate.8 EXTRA_DIST += systemd/smt_off.service.in \ systemd/smtstate.service.in \ - systemd/hcn-init.service.in \ + systemd/hcn-init.service.in.in \ scripts/smtstate.in \ var/lib/powerpc-utils/smt.state \ man/smtstate.8 @@ -223,17 +223,22 @@ if WITH_SYSTEMD install-data-hook: + for i in NetworkManager wicked ; do \ + sed -e "s,@CM@,$${i},g" < systemd/hcn-init.service.in > systemd/hcn-init-$${i}.service ;\ + done $(MKDIR_P) $(DESTDIR)${systemd_unit_dir} $(MKDIR_P) $(DESTDIR)/var/lib/@PACKAGE@ $(MKDIR_P) $(DESTDIR)/usr/lib/@PACKAGE@ $(INSTALL_DATA) systemd/smt_off.service $(DESTDIR)${systemd_unit_dir}/ $(INSTALL_DATA) systemd/smtstate.service $(DESTDIR)${systemd_unit_dir}/ - $(INSTALL_DATA) systemd/hcn-init.service $(DESTDIR)${systemd_unit_dir}/ + $(INSTALL_DATA) systemd/hcn-init-NetworkManager.service $(DESTDIR)${systemd_unit_dir}/ + $(INSTALL_DATA) systemd/hcn-init-wicked.service $(DESTDIR)${systemd_unit_dir}/ $(INSTALL_DATA) var/lib/powerpc-utils/smt.state $(DESTDIR)/var/lib/@PACKAGE@/ $(INSTALL_SCRIPT) scripts/functions.suse $(DESTDIR)/usr/lib/@PACKAGE@/ $(INSTALL_SCRIPT) scripts/smtstate $(DESTDIR)@sbindir@ sed -i -e 's,$${exec_prefix},@prefix@,g' $(DESTDIR)${systemd_unit_dir}/smt_off.service sed -i -e 's,$${exec_prefix},@prefix@,g' $(DESTDIR)${systemd_unit_dir}/smtstate.service - sed -i -e 's,$${exec_prefix},@prefix@,g' $(DESTDIR)${systemd_unit_dir}/hcn-init.service + sed -i -e 's,$${exec_prefix},@prefix@,g' $(DESTDIR)${systemd_unit_dir}/hcn-init-NetworkManager.service + sed -i -e 's,$${exec_prefix},@prefix@,g' $(DESTDIR)${systemd_unit_dir}/hcn-init-wicked.service sed -i -e 's,$${exec_prefix},@prefix@,g' $(DESTDIR)@sbindir@/smtstate endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/powerpc-utils-1.3.11/configure.ac new/powerpc-utils-1.3.12/configure.ac --- old/powerpc-utils-1.3.11/configure.ac 2023-01-24 19:20:23.000000000 +0100 +++ new/powerpc-utils-1.3.12/configure.ac 2024-02-07 20:10:37.000000000 +0100 @@ -1,6 +1,6 @@ # -*- Autoconf -*- # Process this file with autoconf to produce a configure script. -m4_define([ppu_version], 1.3.11) +m4_define([ppu_version], 1.3.12) AC_PREREQ([2.63]) AC_INIT([powerpc-utils], ppu_version, [tyr...@linux.ibm.com]) @@ -117,5 +117,5 @@ AC_CONFIG_FILES([Makefile powerpc-utils.spec systemd/smt_off.service]) AC_CONFIG_FILES([systemd/smtstate.service scripts/smtstate]) -AC_CONFIG_FILES([systemd/hcn-init.service systemd/hcn-init.service.suse]) +AC_CONFIG_FILES([systemd/hcn-init.service.in]) AC_OUTPUT diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/powerpc-utils-1.3.11/man/drmgr-hooks.8 new/powerpc-utils-1.3.12/man/drmgr-hooks.8 --- old/powerpc-utils-1.3.11/man/drmgr-hooks.8 2023-01-24 19:20:23.000000000 +0100 +++ new/powerpc-utils-1.3.12/man/drmgr-hooks.8 2024-02-07 20:10:37.000000000 +0100 @@ -23,7 +23,7 @@ and linked into multiple directories to provide multiple DRC type's hooks. .SH ARGUMENTS .P -Hooks are called without any arguments but with at least these 2 environment variable set: +Hooks are called without any arguments but with these environment variables set: .TP .BI "DRC_TYPE" The Dynamic reconfiguration connector type to act upon from the following list: @@ -32,6 +32,13 @@ .BI "PHASE" The phase of the operation from the following list: .BR check ", " undocheck ", " pre ", " post "." +.TP +.BI "ACTION" +The action in progress from the following list: +.BR add ", " remove ", " migrate "." +.TP +.BI "DRC_COUNT" +The number of impacted items. .SH LPAR MIGRATION .P When a LPAR migration is initiated the @@ -57,6 +64,41 @@ phases are triggered. Returned values for these 2 phases are ignored, and the .B post phase is triggered even if the LPM operation has failed. +.P +The +.B ACTION +variable is set always to +.B migrate +.P +The DRC_COUNT variable is set to 0. +.SH CPU +When a CPU DLPAR add or remove operation is initiated, the +.B pre +and then +.B post +phases are triggered with the +.B ACTION +variable set to either +.B add +or +.B remove +value. +.P +When the +.B pre +phase is called, the +.B DRC_COUNT +variable contains the desired number of CPU to add or remove. When the +.B post +phase is called, +.B DRC_COUNT +contains the number of CPU effectively added or removed. +.P +Return values for these 2 phases are ignored. +.P +The +.B post +phase is triggered even if the operation has failed. .SH ENVIRONMENT .P The drmgr's hooks are called while holding the DLPAR lock, so any other @@ -66,16 +108,20 @@ .B STDIN is redirected to .I /dev/null -while STDOUT and STDERR are redirected to pipes. +while +.BR STDOUT " and " STDERR +are redirected to pipes. The outputs done in these pipes are reported to the end user when a hook has returned an error value and that error value is not ignored (e.g in the LPM, the .B check phase but not the -.BR pre "or " post +.BR pre " or " post phase) .P Except the variables specified in the ARGUMENTS section, all the environment variables are unset before calling the hook. .SH FILES .IR /etc/drmgr.d/pmig/ +.P +.IR /etc/drmgr.d/cpu/ .SH AUTHOR Laurent Dufour <lduf...@linux.ibm.com> .SH SEE ALSO diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/powerpc-utils-1.3.11/man/nvram.8 new/powerpc-utils-1.3.12/man/nvram.8 --- old/powerpc-utils-1.3.11/man/nvram.8 2023-01-24 19:20:23.000000000 +0100 +++ new/powerpc-utils-1.3.12/man/nvram.8 2024-02-07 20:10:37.000000000 +0100 @@ -67,6 +67,22 @@ \fB\--help print usage information including other low level options useful for debugging nvram. +.TP +\fB\--ascii \fIname +print partition contents as ASCII text +.TP +\fB\--dump \fIname +raw dump of partition (use --partitions to see names) +.TP +\fB\--nvram-size +specify size of nvram data, must in multiples of 16 Bytes (for repair +operations) +.TP +\fB\--unzip \fIname +decompress and print compressed data from partition +.TP +\fB\--zero | 0 \fR +terminate config pairs with a NULL character .SH FILES /dev/nvram .SH AUTHOR diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/powerpc-utils-1.3.11/powerpc-utils.spec.in new/powerpc-utils-1.3.12/powerpc-utils.spec.in --- old/powerpc-utils-1.3.11/powerpc-utils.spec.in 2023-01-24 19:20:23.000000000 +0100 +++ new/powerpc-utils-1.3.12/powerpc-utils.spec.in 2024-02-07 20:10:37.000000000 +0100 @@ -89,7 +89,8 @@ /var/lib/powerpc-utils/smt.state /lib/systemd/system/smtstate.service /lib/systemd/system/smt_off.service -/lib/systemd/system/hcn-init.service +/lib/systemd/system/hcn-init-NetworkManager.service +/lib/systemd/system/hcn-init-wicked.service /usr/share/man/man8/smtstate.8.gz %endif @@ -124,8 +125,10 @@ %if %{with systemd} systemctl daemon-reload -systemctl start hcn-init.service -systemctl enable hcn-init.service +for i in NetworkManager wicked ; do + systemctl start hcn-init-${i}.service + systemctl enable hcn-init-${i}.service +done # update the smt.state file with current SMT /usr/sbin/smtstate --save %endif @@ -138,10 +141,12 @@ systemctl stop smtstate.service systemctl disable smtstate.service fi -if systemctl is-enabled hcn-init.service |grep -q "enabled"; then - systemctl stop hcn-init.service - systemctl disable hcn-init.service -fi +for i in NetworkManager wicked ; do + if systemctl is-enabled hcn-init-${i}.service |grep -q "enabled"; then + systemctl stop hcn-init-${i}.service + systemctl disable hcn-init-${i}.service + fi +done %endif %postun diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/powerpc-utils-1.3.11/scripts/bootlist new/powerpc-utils-1.3.12/scripts/bootlist --- old/powerpc-utils-1.3.11/scripts/bootlist 2023-01-24 19:20:23.000000000 +0100 +++ new/powerpc-utils-1.3.12/scripts/bootlist 2024-02-07 20:10:37.000000000 +0100 @@ -304,6 +304,21 @@ fi } +# is_multipath_nvme_device +# Check to see if this is a multipath nvme device +# +is_multipath_nvme_device() +{ + local res + + res=`$FIND /sys/devices/virtual/nvme-subsystem -name $1 2>/dev/null` + if [[ ${#res} = 0 ]]; then + echo "no" + else + echo "yes" + fi +} + # get_link # return the directory path that a link points to. # The only parameter is the link name. @@ -340,6 +355,32 @@ fi } +add_multipath_nvme() +{ + local DEVNAME=$1 + + ctrl_name=$DEVNAME + local startctr=$ctr + + local dir + for dir in `$FIND /sys/devices/virtual/nvme-subsystem -name "$ctrl_name"`; do + cd $dir + cd .. + for slave in `ls -d $PWD/nvme*`; do + slavedev=${slave##*/} + if [[ "$slavedev" != *nvme*n* ]] ; then + LOGICAL_NAMES[$ctr]=${slavedev} + ctr=$[$ctr + 1] + fi + done + done + + if [[ "$startctr" = "$ctr" ]] ; then + LOGICAL_NAMES[$ctr]=$1 + ctr=$[$ctr + 1] + fi +} + add_logical() { local DEVNAME=$1 @@ -487,31 +528,40 @@ if [[ "$1" == *"dm-"* ]] ; then add_logical $1 else - if [[ "$1" == *"nvme-of"* ]]; then + if [[ "$1" == *"nvme-of"* ]] || [[ "$1" == *"namespace"* ]]; then ctrl_name=`get_logical_device_name $1` + master_of_path=$1 else ctrl_name=$1 ctrl_name=${ctrl_name##*/} + master_of_path=`get_of_device_name $1` + fi + + if [[ -z $master_of_path ]]; then + echo "Device $1 does not appear to be valid." >&2 + exit 1 fi + ctrl_name="${ctrl_name%n[0-9]*}" is_nvmf=$(is_nvmf_device $ctrl_name) if [[ $is_nvmf = "yes" ]]; then - if [[ "$1" == *"nvme-of"* ]]; then - master_of_path=$1 - else - master_of_path=`get_of_device_name $1` - fi - - if [[ -z $master_of_path ]]; then - echo "Device $1 does not appear to be valid." >&2 - exit 1 - fi - namespace_base=${master_of_path##*/} DEVTYPE="nvme-of" add_nvmf $ctrl_name else - add_logical $1 + is_multipath_nvme=$(is_multipath_nvme_device $ctrl_name) + if [[ $is_multipath_nvme = "yes" ]]; then + if [[ "$master_of_path" == *namespace* ]] ; then + namespace_base=${master_of_path##*/} + else + echo "Device $1 does not appear to be valid." >&2 + exit 1 + fi + DEVTYPE="multi-nvme" + add_multipath_nvme $ctrl_name + else + add_logical $1 + fi fi fi fi @@ -534,8 +584,10 @@ if [[ -z ${OF_DEVPATH[$ctr]} ]]; then # See if this is an OF pathname OF_DEVPATH[$ctr]=`get_of_device_name ${LOGICAL_NAMES[$ctr]}` - if [[ $DEVTYPE = "nvme-of" ]]; then + if [[ $DEVTYPE = "nvme-of" ]] || [[ $DEVTYPE = "multi-nvme" ]]; then OF_DEVPATH[$ctr]=${OF_DEVPATH[$ctr]}/$namespace_base + else + OF_DEVPATH[$ctr]=${OF_DEVPATH[$ctr]} fi else OF_DEVPATH[$ctr]=${LOGICAL_NAMES[$ctr]} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/powerpc-utils-1.3.11/scripts/ofpathname new/powerpc-utils-1.3.12/scripts/ofpathname --- old/powerpc-utils-1.3.11/scripts/ofpathname 2023-01-24 19:20:23.000000000 +0100 +++ new/powerpc-utils-1.3.12/scripts/ofpathname 2024-02-07 20:10:37.000000000 +0100 @@ -722,6 +722,7 @@ err $ERR_NO_OFPATH fi + devnsid=$(printf "%x" $devnsid) OF_PATH="$OF_PATH/$devtype@$devnsid" # No partition (pZ) specified. @@ -1798,6 +1799,7 @@ cd $dir local devnsid=`$CAT ./nsid 2>/dev/null` + devnsid=$(printf "%x" $devnsid) if [[ $devnsid = $nsid ]]; then LOGICAL_DEVNAME="${dir##*/}" break diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/powerpc-utils-1.3.11/src/common/cpu_info_helpers.c new/powerpc-utils-1.3.12/src/common/cpu_info_helpers.c --- old/powerpc-utils-1.3.11/src/common/cpu_info_helpers.c 2023-01-24 19:20:23.000000000 +0100 +++ new/powerpc-utils-1.3.12/src/common/cpu_info_helpers.c 2024-02-07 20:10:37.000000000 +0100 @@ -83,6 +83,20 @@ return test_sysattr(attribute, W_OK, threads_in_system); } +int cpu_physical_id(int thread) +{ + char path[SYSFS_PATH_MAX]; + int rc, physical_id; + + sprintf(path, SYSFS_CPUDIR"/physical_id", thread); + rc = get_attribute(path, "%d", &physical_id); + + /* This attribute does not exist in kernels without hotplug enabled */ + if (rc && errno == ENOENT) + return -1; + return physical_id; +} + int cpu_online(int thread) { char path[SYSFS_PATH_MAX]; @@ -245,7 +259,7 @@ if (smt_state == 0) smt_state = thread + 1; else if (smt_state > 0) - smt_state = -1; /* mix of SMT modes */ + smt_state = 0; /* mix of SMT modes */ } } @@ -257,7 +271,7 @@ printf("SMT=1\n"); else printf("SMT is off\n"); - } else if (smt_state == -1) { + } else if (smt_state == 0) { for (thread = 0; thread < threads_per_cpu; thread++) { if (CPU_COUNT_S(cpu_state_size, cpu_states[thread])) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/powerpc-utils-1.3.11/src/common/cpu_info_helpers.h new/powerpc-utils-1.3.12/src/common/cpu_info_helpers.h --- old/powerpc-utils-1.3.11/src/common/cpu_info_helpers.h 2023-01-24 19:20:23.000000000 +0100 +++ new/powerpc-utils-1.3.12/src/common/cpu_info_helpers.h 2024-02-07 20:10:37.000000000 +0100 @@ -32,6 +32,7 @@ extern int __sysattr_is_readable(char *attribute, int threads_in_system); extern int __sysattr_is_writeable(char *attribute, int threads_in_system); +extern int cpu_physical_id(int thread); extern int cpu_online(int thread); extern int is_subcore_capable(void); extern int num_subcores(void); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/powerpc-utils-1.3.11/src/drmgr/common.c new/powerpc-utils-1.3.12/src/drmgr/common.c --- old/powerpc-utils-1.3.11/src/drmgr/common.c 2023-01-24 19:20:23.000000000 +0100 +++ new/powerpc-utils-1.3.12/src/drmgr/common.c 2024-02-07 20:10:37.000000000 +0100 @@ -56,7 +56,7 @@ #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) -static char *drc_type_str[] = { +static const char * const drc_type_str[] = { [DRC_TYPE_NONE] = "unknwon", [DRC_TYPE_PCI] = "pci", [DRC_TYPE_SLOT] = "slot", @@ -69,13 +69,24 @@ [DRC_TYPE_ACC] = "acc", }; -static char *hook_phase_name[] = { +static const char * const hook_phase_name[] = { [HOOK_CHECK] = "check", [HOOK_UNDOCHECK] = "undocheck", [HOOK_PRE] = "pre", [HOOK_POST] = "post", }; +static const char * const hook_action_name[] = { + [NONE] = "none", + [ADD] = "add", + [REMOVE] = "remove", + [QUERY] = "query", + [REPLACE] = "replace", + [IDENTIFY] = "identify", + [MIGRATE] = "migrate", + [HIBERNATE] = "hibernate", +}; + /** * set_output level * @brief Common routine to set the output level @@ -1555,7 +1566,8 @@ return DRC_TYPE_NONE; } -static int run_one_hook(enum drc_type drc_type, enum hook_phase phase, +static int run_one_hook(enum drc_type drc_type, enum drmgr_action action, + enum hook_phase phase, const char *drc_count_str, const char *name) { int rc; @@ -1602,6 +1614,8 @@ if (clearenv() || setenv("DRC_TYPE", drc_type_str[drc_type], 1) || + setenv("DRC_COUNT", drc_count_str, 1) || + setenv("ACTION", hook_action_name[action], 1) || setenv("PHASE", hook_phase_name[phase], 1)) { say(ERROR, "Can't set environment variables: %s\n", strerror(errno)); @@ -1624,11 +1638,13 @@ * Run all executable hooks found in a given directory. * Return 0 if all run script have returned 0 status. */ -int run_hooks(enum drc_type drc_type, enum hook_phase phase) +int run_hooks(enum drc_type drc_type, enum drmgr_action action, + enum hook_phase phase, int drc_count) { int rc = 0, fdd, num, i; DIR *dir; struct dirent **entries = NULL; + char *drc_count_str; /* Sanity check */ if (drc_type <= DRC_TYPE_NONE || drc_type >= ARRAY_SIZE(drc_type_str)) { @@ -1655,6 +1671,12 @@ is_file_or_link, versionsort); closedir(dir); + if (asprintf(&drc_count_str, "%d", drc_count) == -1) { + say(ERROR, "Can't allocate new string : %s", strerror(errno)); + free(entries); + return -1; + } + for (i = 0; i < num; i++) { struct stat st; struct dirent *entry = entries[i]; @@ -1680,13 +1702,15 @@ say(WARN, "Can't stat file %s: %s\n", name, strerror(errno)); else if (S_ISREG(st.st_mode) && (st.st_mode & S_IXUSR) && - run_one_hook(drc_type, phase, name)) + run_one_hook(drc_type, action, phase, drc_count_str, + name)) rc = 1; free(name); free(entry); } + free(drc_count_str); free(entries); return rc; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/powerpc-utils-1.3.11/src/drmgr/common_cpu.c new/powerpc-utils-1.3.12/src/drmgr/common_cpu.c --- old/powerpc-utils-1.3.11/src/drmgr/common_cpu.c 2023-01-24 19:20:23.000000000 +0100 +++ new/powerpc-utils-1.3.12/src/drmgr/common_cpu.c 2024-02-07 20:10:37.000000000 +0100 @@ -414,7 +414,7 @@ if (cache->removed) continue; - if (cache->phandle == cache->l2cache) { + if (c->phandle == cache->l2cache) { say(EXTRA_DEBUG, "found cache %s for cache %s\n", c->name, cache->name); return c; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/powerpc-utils-1.3.11/src/drmgr/dr.h new/powerpc-utils-1.3.12/src/drmgr/dr.h --- old/powerpc-utils-1.3.11/src/drmgr/dr.h 2023-01-24 19:20:23.000000000 +0100 +++ new/powerpc-utils-1.3.12/src/drmgr/dr.h 2024-02-07 20:10:37.000000000 +0100 @@ -135,7 +135,8 @@ void set_output_level(int); -int run_hooks(enum drc_type drc_type, enum hook_phase phase); +int run_hooks(enum drc_type drc_type, enum drmgr_action, enum hook_phase phase, + int drc_count); #define DR_BUF_SZ 256 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/powerpc-utils-1.3.11/src/drmgr/drmig_chrp_pmig.c new/powerpc-utils-1.3.12/src/drmgr/drmig_chrp_pmig.c --- old/powerpc-utils-1.3.11/src/drmgr/drmig_chrp_pmig.c 2023-01-24 19:20:23.000000000 +0100 +++ new/powerpc-utils-1.3.12/src/drmgr/drmig_chrp_pmig.c 2024-02-07 20:10:37.000000000 +0100 @@ -709,9 +709,9 @@ } if (usr_action == MIGRATE && (strcmp(usr_p_option, "check") == 0)) { - rc = run_hooks(drc_type, HOOK_CHECK); + rc = run_hooks(drc_type, usr_action, HOOK_CHECK, 0); if (rc) - run_hooks(drc_type, HOOK_UNDOCHECK); + run_hooks(drc_type, usr_action, HOOK_UNDOCHECK, 0); return rc; } @@ -736,7 +736,7 @@ /* Now do the actual migration */ do { if (usr_action == MIGRATE) - run_hooks(drc_type, HOOK_PRE); + run_hooks(drc_type, usr_action, HOOK_PRE, 0); if (usr_action == MIGRATE) rc = do_migration(stream_val); @@ -758,6 +758,6 @@ /* Post hook is called even if the migration has failed */ if (usr_action == MIGRATE) - run_hooks(drc_type, HOOK_POST); + run_hooks(drc_type, usr_action, HOOK_POST, 0); return rc; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/powerpc-utils-1.3.11/src/drmgr/drslot_chrp_cpu.c new/powerpc-utils-1.3.12/src/drmgr/drslot_chrp_cpu.c --- old/powerpc-utils-1.3.11/src/drmgr/drslot_chrp_cpu.c 2023-01-24 19:20:23.000000000 +0100 +++ new/powerpc-utils-1.3.12/src/drmgr/drslot_chrp_cpu.c 2024-02-07 20:10:37.000000000 +0100 @@ -231,14 +231,13 @@ * @param nr_cpus * @returns 0 on success, !0 otherwise */ -static int add_cpus(struct dr_info *dr_info) +static int add_cpus(struct dr_info *dr_info, int *count) { int rc = -1; - uint count; struct dr_node *cpu = NULL; - count = 0; - while (count < usr_drc_count) { + *count = 0; + while (*count < usr_drc_count) { if (drmgr_timed_out()) break; @@ -255,10 +254,10 @@ } fprintf(stdout, "%s\n", cpu->drc_name); - count++; + (*count)++; } - say(DEBUG, "Acquired %d of %d requested cpu(s).\n", count, + say(DEBUG, "Acquired %d of %d requested cpu(s).\n", *count, usr_drc_count); return rc ? 1 : 0; } @@ -286,13 +285,13 @@ * @param nr_cpus * @returns 0 on success, !0 otherwise */ -static int remove_cpus(struct dr_info *dr_info) +static int remove_cpus(struct dr_info *dr_info, int *count) { int rc = 0; - uint count = 0; struct dr_node *cpu; - while (count < usr_drc_count) { + *count = 0; + while (*count < usr_drc_count) { if (drmgr_timed_out()) break; @@ -318,10 +317,10 @@ } fprintf(stdout, "%s\n", cpu->drc_name); - count++; + (*count)++; } - say(DEBUG, "Removed %d of %d requested cpu(s)\n", count, + say(DEBUG, "Removed %d of %d requested cpu(s)\n", *count, usr_drc_count); return rc; } @@ -406,7 +405,7 @@ int drslot_chrp_cpu(void) { struct dr_info dr_info; - int rc; + int rc, count = 0; if (! cpu_dlpar_capable()) { say(ERROR, "CPU DLPAR capability is not enabled on this " @@ -442,18 +441,24 @@ return rc; } + if (usr_action == ADD || usr_action == REMOVE) + run_hooks(DRC_TYPE_CPU, usr_action, HOOK_PRE, usr_drc_count); + switch (usr_action) { case ADD: - rc = add_cpus(&dr_info); + rc = add_cpus(&dr_info, &count); break; case REMOVE: - rc = remove_cpus(&dr_info); + rc = remove_cpus(&dr_info, &count); break; default: rc = -1; break; } + if (usr_action == ADD || usr_action == REMOVE) + run_hooks(DRC_TYPE_CPU, usr_action, HOOK_POST, count); + free_cpu_drc_info(&dr_info); return rc; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/powerpc-utils-1.3.11/src/drmgr/lsslot_chrp_cpu.c new/powerpc-utils-1.3.12/src/drmgr/lsslot_chrp_cpu.c --- old/powerpc-utils-1.3.11/src/drmgr/lsslot_chrp_cpu.c 2023-01-24 19:20:23.000000000 +0100 +++ new/powerpc-utils-1.3.12/src/drmgr/lsslot_chrp_cpu.c 2024-02-07 20:10:37.000000000 +0100 @@ -38,8 +38,8 @@ { struct dr_node *cpu; struct thread *t; - char *fmt_s = "%-11s%-20s%-13s%-13s\n"; - char *fmt = "%-11s%-20s%-12x"; + char *fmt_s = "%-10s%-20s%-11s%-13s\n"; + char *fmt = "%-10s%-20s%-11x"; printf(fmt_s, "drc-name", "OFDT-node", "drc_index", "thread id(s)"); @@ -48,7 +48,7 @@ printf(fmt, cpu->drc_name, cpu->name ? cpu->name : "--", cpu->drc_index); for (t = cpu->cpu_threads; t; t = t->sibling) - printf(" %x", t->id); + printf("%-2x ", t->id); printf("\n"); } } @@ -84,9 +84,9 @@ { struct dr_node *cpu = NULL; struct thread *t; - int thread_id_field_sz = 17; - char *fmt_s = "%-10s%-18s%-11s%-17s%-15s%-15s\n"; - char *fmt = "%-10s%-18s%-11x%"; + int thread_id_field_sz = 25; + char *fmt_s = "%-10s%-20s%-11s%-25s%-15s%-15s\n"; + char *fmt = "%-10s%-20s%-11x"; char *fmt_caches = "%-15s%-15s\n"; printf(fmt_s, "drc-name", "OFDT-node", "drc_index", "thread id(s)", @@ -101,8 +101,8 @@ cpu->drc_index); for (t = cpu->cpu_threads; t; t = t->sibling) { - printf("%x ", t->id); - count += 2; + printf("%-2x ", t->id); + count += 3; } /* pad out the thread ids field */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/powerpc-utils-1.3.11/src/lparstat.c new/powerpc-utils-1.3.12/src/lparstat.c --- old/powerpc-utils-1.3.11/src/lparstat.c 2023-01-24 19:20:23.000000000 +0100 +++ new/powerpc-utils-1.3.12/src/lparstat.c 2024-02-07 20:10:37.000000000 +0100 @@ -163,6 +163,10 @@ cpu_idx++; } + /* Mark extra slots for offline threads unset, see parse_sysfs_values */ + for (; cpu_idx < threads_in_system; cpu_idx++) + cpu_sysfs_fds[cpu_idx].spurr = -1; + return 0; error: fprintf(stderr, "Failed to open %s: %s\n", @@ -492,6 +496,15 @@ delta_purr = get_delta_value("purr"); delta_idle_purr = get_delta_value("idle_purr"); + /* + * Given that these values are read from different + * sources (purr from lparcfg and idle_purr from sysfs), + * a small variation in the values is possible. + * In such cases, round down delta_idle_purr to delta_purr. + */ + if (delta_idle_purr > delta_purr) + delta_idle_purr = delta_purr; + physc = (delta_purr - delta_idle_purr) / delta_tb; physc *= 100.00; @@ -507,6 +520,15 @@ delta_purr = get_delta_value("purr"); delta_idle_purr = get_delta_value("idle_purr"); + /* + * Given that these values are read from different + * sources (purr from lparcfg and idle_purr from sysfs), + * a small variation in the values is possible. + * In such cases, round down delta_idle_purr to delta_purr. + */ + if (delta_idle_purr > delta_purr) + delta_idle_purr = delta_purr; + physc = (delta_purr - delta_idle_purr) / delta_tb; idle = (delta_purr / delta_tb) - physc; idle *= 100.00; @@ -866,13 +888,15 @@ } smt_state = parse_smt_state(); - if (smt_state < 0) { + if (smt_state == -1) { fprintf(stderr, "Failed to get smt state\n"); return; } if (smt_state == 1) sprintf(buf, "Off"); + else if (smt_state == 0) + sprintf(buf, "Mixed"); else sprintf(buf, "%d", smt_state); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/powerpc-utils-1.3.11/src/nvram.c new/powerpc-utils-1.3.12/src/nvram.c --- old/powerpc-utils-1.3.11/src/nvram.c 2023-01-24 19:20:23.000000000 +0100 +++ new/powerpc-utils-1.3.12/src/nvram.c 2024-02-07 20:10:37.000000000 +0100 @@ -460,8 +460,12 @@ c_sum = checksum(phead); if (c_sum != phead->checksum) warn_msg("this partition checksum should be %02x!\n", c_sum); - phead->length = be16toh(phead->length); - p_start += phead->length * NVRAM_BLOCK_SIZE; + if (phead->length != 0) { + phead->length = be16toh(phead->length); + p_start += phead->length * NVRAM_BLOCK_SIZE; + } else { + break; + } } if (verbose) @@ -1280,7 +1284,7 @@ data = (char *)phead + sizeof(*phead); while (*data != '\0') { - if ((data[varlen] == '=') && + if (strlen(data) > varlen && (data[varlen] == '=') && strncmp(config_var, data, varlen) == 0) { printf("%s%c", data + varlen + 1, terminator); rc = 0; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/powerpc-utils-1.3.11/src/ppc64_cpu.c new/powerpc-utils-1.3.12/src/ppc64_cpu.c --- old/powerpc-utils-1.3.11/src/ppc64_cpu.c 2023-01-24 19:20:23.000000000 +0100 +++ new/powerpc-utils-1.3.12/src/ppc64_cpu.c 2024-02-07 20:10:37.000000000 +0100 @@ -1251,31 +1251,40 @@ return 0; } +static bool core_is_online(int core) +{ + return cpu_physical_id(core * threads_per_cpu) != -1; +} + static int do_info(void) { int i, j, thread_num; char online; - int subcores = 0; + int core, subcores = 0; if (is_subcore_capable()) subcores = num_subcores(); - for (i = 0; i < cpus_in_system; i++) { + for (i = 0, core = 0; core < cpus_in_system; i++) { + + if (!core_is_online(i)) + continue; if (subcores > 1) { - if (i % subcores == 0) - printf("Core %3d:\n", i/subcores); - printf(" Subcore %3d: ", i); + if (core % subcores == 0) + printf("Core %3d:\n", core/subcores); + printf(" Subcore %3d: ", core); } else { - printf("Core %3d: ", i); + printf("Core %3d: ", core); } - for (j = 0; j < threads_per_cpu; j++) { - thread_num = i*threads_per_cpu + j; + thread_num = i * threads_per_cpu; + for (j = 0; j < threads_per_cpu; j++, thread_num++) { online = cpu_online(thread_num) ? '*' : ' '; printf("%4d%c ", thread_num, online); } printf("\n"); + core++; } return 0; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/powerpc-utils-1.3.11/src/rtas_dbg.c new/powerpc-utils-1.3.12/src/rtas_dbg.c --- old/powerpc-utils-1.3.11/src/rtas_dbg.c 2023-01-24 19:20:23.000000000 +0100 +++ new/powerpc-utils-1.3.12/src/rtas_dbg.c 2024-02-07 20:10:37.000000000 +0100 @@ -200,10 +200,10 @@ struct rtas_token *t; if (tok) - printf("%-40s%d\n", tok->name, tok->token); + printf("%-40s%u\n", tok->name, tok->token); else { for (t = tok_list; t; t = t->next) - printf("%-40s%d\n", t->name, t->token); + printf("%-40s%u\n", t->name, t->token); } } @@ -217,7 +217,7 @@ args.nret = htobe32(1); args.args[0] = htobe32(tok->token); - printf("Enabling rtas debug for %s (%d)\n", tok->name, tok->token); + printf("Enabling rtas debug for %s (%u)\n", tok->name, tok->token); rc = rtas(&args); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/powerpc-utils-1.3.11/systemd/hcn-init.service.in new/powerpc-utils-1.3.12/systemd/hcn-init.service.in --- old/powerpc-utils-1.3.11/systemd/hcn-init.service.in 2023-01-24 19:20:23.000000000 +0100 +++ new/powerpc-utils-1.3.12/systemd/hcn-init.service.in 1970-01-01 01:00:00.000000000 +0100 @@ -1,13 +0,0 @@ -[Unit] -Description=hybrid virtual network scan and config -After=NetworkManager.service -Requisite=NetworkManager.service -PartOf=NetworkManager.service - -[Service] -Type=oneshot -RemainAfterExit=yes -ExecStart=@sbindir@/hcnmgr -s - -[Install] -WantedBy=NetworkManager.service diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/powerpc-utils-1.3.11/systemd/hcn-init.service.in.in new/powerpc-utils-1.3.12/systemd/hcn-init.service.in.in --- old/powerpc-utils-1.3.11/systemd/hcn-init.service.in.in 1970-01-01 01:00:00.000000000 +0100 +++ new/powerpc-utils-1.3.12/systemd/hcn-init.service.in.in 2024-02-07 20:10:37.000000000 +0100 @@ -0,0 +1,13 @@ +[Unit] +Description=hybrid virtual network scan and config for @CM@ +After=@CM@.service +Requisite=@CM@.service +PartOf=@CM@.service + +[Service] +Type=oneshot +RemainAfterExit=yes +ExecStart=@sbindir@/hcnmgr -s + +[Install] +WantedBy=@CM@.service diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/powerpc-utils-1.3.11/systemd/hcn-init.service.suse.in new/powerpc-utils-1.3.12/systemd/hcn-init.service.suse.in --- old/powerpc-utils-1.3.11/systemd/hcn-init.service.suse.in 2023-01-24 19:20:23.000000000 +0100 +++ new/powerpc-utils-1.3.12/systemd/hcn-init.service.suse.in 1970-01-01 01:00:00.000000000 +0100 @@ -1,14 +0,0 @@ -[Unit] -Description=hybrid virtual network scan and config -After=network-pre.target NetworkManager.service -Before=wicked.service -Requisite=network.service -PartOf=network.service - -[Service] -Type=oneshot -RemainAfterExit=yes -ExecStart=@sbindir@/hcnmgr -s - -[Install] -WantedBy=multi-user.target network.target ++++++ ppc64_cpu-Clean-up-sysfs-smt-control-error-handling.patch ++++++ >From 916a239f518e96c77c35a58db7f1dcc00e5fb5f0 Mon Sep 17 00:00:00 2001 From: Michal Suchanek <msucha...@suse.de> Date: Fri, 9 Feb 2024 13:12:33 +0100 Subject: [PATCH] ppc64_cpu: Clean up sysfs smt/control error handling When the kernel does not support the sysfs intercface do not report and arror, fall back to the old method silently. Suggested-by: Nathan Lynch<nath...@linux.ibm.com> Signed-off-by: Michal Suchanek <msucha...@suse.de> --- It has been suggested to also not try the old iterface in case of unknown error because it's unlikely to work but that would needlessly complicate the code. --- src/ppc64_cpu.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/ppc64_cpu.c b/src/ppc64_cpu.c index c318928..759ceff 100644 --- a/src/ppc64_cpu.c +++ b/src/ppc64_cpu.c @@ -368,10 +368,20 @@ static int is_dscr_capable(void) static int set_smt_control(int smt_state) { if (set_attribute(SYS_SMT_CONTROL, "%d", smt_state)) { - /* Silently ignore kernel not supporting this feature */ - if (errno != ENODEV) - perror(SYS_SMT_CONTROL); - return -1; + switch (errno) { + case ENOENT: + /* + * The kernel does not have the interface. + * Try the old method. + */ + return -1; + case ENODEV: + /* Setting SMT state not supported on the system. */ + return 0; + default: + perror(SYS_SMT_CONTROL); + return -1; + } } return 0; } -- 2.43.0