Commit Graph

2310 Commits

Author SHA1 Message Date
Ingo Franzki
5ece6a3373 etc/modules-load.d/s390-pkey.conf: Add pkey sub-modules and paes_s390
Ensure that the pkey sub-modules are also loaded, as well as the paes
cipher.

Signed-off-by: Ingo Franzki <ifranzki@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-06-11 12:38:45 +02:00
Ingo Franzki
14c977768e zkey/dracut: Add a dracut config file for zkey
Provide a dracut config file that ensures that the required drivers and
executables, as well as the zkey repository is included into the initramfs.

Signed-off-by: Ingo Franzki <ifranzki@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-06-11 12:38:45 +02:00
Ingo Franzki
5bedcff65c zkey/initramfs: Update initramfs hook to correct drivers and include zkey plugins
The zkey tool might be configured to use plugins. Include the plugins also
into the initramfs, otherwise zkey might not be usable at early boot time,
when it is configure to use a plugin.

Update the list of driver to include, pkey_sysfs does not exist, its built
into the pkey base driver.

Signed-off-by: Ingo Franzki <ifranzki@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-06-11 12:38:45 +02:00
Jörn Siglen
479820528c dbginfo.sh: Reworking the container section
Adding podman commands to dbginfo.sh, which is a successor for docker.
We reduce standard details for docker (it can be collected on demand).
Inlcuding /etc/containers for registry and container engine configuration.

Suggested-by: Hendrik Brueckner <brueckner@linux.ibm.com>
Reviewed-by: Mario Held <mario.held@de.ibm.com>
Signed-off-by: Jörn Siglen <SIGLEN@de.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-05-21 15:50:31 +02:00
Ingo Franzki
486882a4df libkmipclient: Fix findings from static code checker
The Coverity static code checker found a few bugs in the libkmipclient
code, fix those.

Signed-off-by: Ingo Franzki <ifranzki@linux.ibm.com>
Reviewed-by: Joerg Schmidbauer <jschmidb@de.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-05-21 15:50:31 +02:00
Marc Hartmayer
ce997c6d01 rust/Makefile: Create a symbolic link to the manpage 'pvimg-create' for genprotimg
Create a symbolic link to the 'pvimg-create' manpage of for 'genprotimg'
during the manpage installation. This helps the users to migrate to
'pvimg create'.

Suggested-by: Jan Höppner <hoeppner@linux.ibm.com>
Reviewed-by: Jan Höppner <hoeppner@linux.ibm.com>
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-05-21 15:50:31 +02:00
Marc Hartmayer
b9d1c86613 CHANGELOG.md: Describe the 'genprotimg' changes in v2.36.0
This helps the users and distro-partners to understand what has changed.

Acked-by: Jan Höppner <hoeppner@linux.ibm.com>
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-05-21 15:50:31 +02:00
Marc Hartmayer
f9337f0576 genprotimg: manpage: Describe the 'genprotimg' changes in v2.36.0
Describe the breaking changes to genprotimg in the notes section. This
helps the users to adapt to the new behavior.

Fixes: f4cf4ae6eb (rust: Add a new tool called 'pvimg')
Acked-by: Jan Höppner <hoeppner@linux.ibm.com>
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-05-21 15:50:31 +02:00
Thomas Richter
a06302e7f0 cpumf/lspai: Add output format option
Add formatted output triggered with command line option --format XXX.
Sort included header files.

Signed-off-by: Thomas Richter <tmricht@linux.ibm.com>
Reviewed-by: Sumanth Korikkar <sumanthk@linux.ibm.com>
Reviewed-by: Maria Eisenhaendler <maria1@de.ibm.com>
Reviewed-by: Jan Höppner <hoeppner@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-05-21 15:50:31 +02:00
Jan Höppner
7bc0fb809d zpcictl: Fix command line parsing for invalid options
Currently zpcictl silently accepts incorrect command line options while
it should be displaying an error message for invalid ones. There is a
check for the case when no arguments are supplied, but invalid arguments
or only specifying a device without an action does not display an error
nor give a failure exit code.

Fix this by changing parse_cmdline() to return a boolean indicating if
any arguments were supplied while exiting with an error and message when
invalid options are detected.

Reviewed-by: Niklas Schnelle <schnelle@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-05-21 15:50:31 +02:00
Thomas Richter
bc511f84fe cpumf/lshwc: Update man page for lshwc command line option time
Improve man page entry for lshwc command line option -t and --time.

Signed-off-by: Thomas Richter <tmricht@linux.ibm.com>
Reviewed-by: Maria Eisenhaendler <maria1@de.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-05-21 15:50:30 +02:00
Ingo Franzki
3a3cea0061 zkey: Fix EP11 secure key reencipher function
Re-enciphering an EP11 secure key may fail with an error message like:
  "zkey-cryptsetup: Failed to re-encipher the secure volume key for device
  '<device>'"
or
  "zkey: Failed to re-encipher '<key>' from CURRENT to NEW master key"
or similar.

The verbose messages show the following debug message:
  "Command XCP_ADM_REENCRYPT failed. rc = 0x20"

This is due to uninitialized variables, which might cause the EP11 admin
request to contain garbage data, causing it to fail with CKR_DATA_INVALID
(0x20).

Fixes: 0be7efc956 ("zkey: Add support for re-enciphering EP11 secure keys")
Fixes: 4e2ebe0370 ("libseckey: Fix re-enciphering of EP11 secure key")
Signed-off-by: Ingo Franzki <ifranzki@linux.ibm.com>
Reviewed-by: Joerg Schmidbauer <jschmidb@de.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-05-21 15:50:18 +02:00
Marc Hartmayer
616d2f52f9 rust/Makefile: Install Bash and Zsh completions by default
The Bash and Zsh completion files are useful, therefore install them by
default.

Reviewed-by: Jan Höppner <hoeppner@linux.ibm.com>
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-05-21 15:50:18 +02:00
Peter Oberparleiter
6dd671f24e zdev: Make initramfs root configuration more robust
zdev's initramfs hook does not add directives for enabling the root
device to the initrd if the root device is only configured in the
active configuration. As a result, a reboot using the new initrd fails
because the root device cannot be found.

This situation can occur for example when the zdev initramfs hook is
called from within an installer, where devices are only enabled in the
active configuration.

Address this situation by considering both the active and persistent
configuration of the root device during initramfs configuration. In case
the device is configured in both configurations, the persistent
configuration takes precedence.

Reviewed-by: Vineeth Vijayan <vneethv@linux.ibm.com>
Signed-off-by: Peter Oberparleiter <oberpar@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-05-06 13:40:36 +02:00
Jakob Naucke
443652dcd2 rust/pv*: Add support for CCK update
The ultravisor supports a new secret type in `add-secret` to update
the customer communication key (CCK). Support this new secret
type (0x16).

[seiden@linux.ibm.com: Constify CCK Header struct usage]
Acked-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
Signed-off-by: Jakob Naucke <naucke@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-05-05 17:20:37 +02:00
Jakob Naucke
b11bb64732 rust/pvimg: Add secret flag to allow CCK update
The CCK will be able to be updated by an ultravisor call. For security
reasons, this feature must be enabled at Secure Execution header
creation time.

Because this makes it possible to dump without having set a CCK
earlier, the requirement to specify a CCK when creating an image with
guest dump support is extended to also allow for CCK update instead.

Change a CLI test for this that was a duplicate anyway.

[seiden@linux.ibm.com: Allow --cck & --enable-cck-update simultaneously]
Reviewed-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
Signed-off-by: Jakob Naucke <naucke@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-05-05 17:20:37 +02:00
Steffen Eiden
2cd7c7a875 pv: Refactor Null secret
With the recent upgrade to zerocopy 0.8 it is now possible to create
those structs at compile time. This removes the use of a magic array
constant.

Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-05-05 17:20:37 +02:00
Steffen Eiden
8929d21948 rust: Upgrade zerocopy dependency to 0.8.X
This enables some const constructors, Dataful Enums,
Dynamically Sized Types and much more.

v0.8 introduces breaking changes including, but not limited to:
  - Rename AsBytes to IntoBytes
  - Fine-grain (derive) Traits that need to be implemented on top.
  - Rename FromZeroes to FromZeros
for which this patch takes care of as well.

Also a direct FromZeros derive is no longer necessary. As it is touched
anyways, remove it where appropriate.

See: https://github.com/google/zerocopy/discussions/1680

Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-05-05 17:20:37 +02:00
Steffen Eiden
f7bba3a687 pvsecret: Deny adding secrets with preexisting IDs
Denies the addition of secrets with an ID that is already stored in the
secret store. This can be overruled by using the force option.

This is considered a breaking change as adding duplicated IDs was
possible without the '--force' option before.

Reviewed-by: Finn Callies <fcallies@linux.ibm.com>
Tested-by: Finn Callies <fcallies@linux.ibm.com>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-05-05 17:20:37 +02:00
Mikhail Zaslonko
5d2c93bc7a zdump/dfi: Get online cpu count based on lowcore_ptr array
In case of missing dfi_cpu_info in the dump, obtain the number of online
cpus of the dumped system based on the number of present entries in the
lowcore_ptr array (if vmcoreinfo is available).

Reviewed-by: Alexander Egorenkov <egorenar@linux.ibm.com>
Signed-off-by: Mikhail Zaslonko <zaslonko@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-05-05 17:20:37 +02:00
Mikhail Zaslonko
f1055a62e3 zdump: Remove unused structures and prototypes from dfi.h
Reviewed-by: Alexander Egorenkov <egorenar@linux.ibm.com>
Signed-off-by: Mikhail Zaslonko <zaslonko@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-05-05 17:20:37 +02:00
Eduard Shishkin
4c4ab4fd70 zipl_helper.device-mapper: Support mirrors over NVMe devices
\# lsblk
...
nvme0n1     259:0    0   7.3T  0 disk
\_nvme0n1p1 259:4    0     2G  0 part
  \_md0       9:0    0     2G  0 raid1 /mnt
nvme1n1     259:2    0 931.5G  0 disk
\_nvme1n1p1 259:1    0     2G  0 part
  \_md0       9:0    0     2G  0 raid1 /mnt

\# ./zipl_helper.md 9:0

Expected results:

targetbase=259:0
targettype=SCSI
targetblocksize=512
targetoffset=8192
targetbase=259:2
targettype=SCSI
targetblocksize=512
targetoffset=8192

Actual results:

targetbase=259:0
targettype=SCSI
targetblocksize=512
targetoffset=8192
targetbase=259:0   <--- Incorrect!
targettype=SCSI
targetblocksize=512
targetoffset=8192

Make zipl helpers be aware of NVMe devices;
Fix the procedure of partition resolution by including the NVMe case.

Reviewed-by: Stefan Haberland <sth@linux.ibm.com>
Signed-off-by: Eduard Shishkin <edward6@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-05-05 17:20:37 +02:00
Eduard Shishkin
34a5e47508 zipl_helper.device-mapper: Fix imprecise is_device_mapper() predicate
Fix is_device_mapper() predicate to not base on checking a hardcoded
major number (253), which not always correct, since on some systems
dm-devices have different majors".

Reviewed-by: Stefan Haberland <sth@linux.ibm.com>
Signed-off-by: Eduard Shishkin <edward6@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-05-05 17:20:35 +02:00
Steffen Eiden
6d7cdb9e10 pvsecret: Improve documentation for duplicated secret IDs
Reviewed-by: Finn Callies <fcallies@linux.ibm.com>
Tested-by: Finn Callies <fcallies@linux.ibm.com>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-05-05 17:15:01 +02:00
Steffen Eiden
1fefdecbe7 pvsecret: Support retrieving a secret by index
Allow users to retrieve a secret by its index. This allows users to
extract a specific secret in case of multiple ids.

Reviewed-by: Finn Callies <fcallies@linux.ibm.com>
Tested-by: Finn Callies <fcallies@linux.ibm.com>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-05-05 17:15:01 +02:00
Steffen Eiden
e62cdf9a6e pvsecret: Warn during retrieve if a secret-id is stored multiple times
Warn a user that there are multiple secrets in the secret store with the
same secret id, but retrieve one of them anyways.

This helps users to notice issues before they happen, as retrieve may
not retrieve the expected secret due to duplicated IDs.

Reviewed-by: Finn Callies <fcallies@linux.ibm.com>
Tested-by: Finn Callies <fcallies@linux.ibm.com>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-05-05 17:15:01 +02:00
Steffen Eiden
fa00d1eac1 pvsecret: Warn during add if a secret-id is already in the store
Warn a user that the secret-id to be added is already in the secret
store, but add it anyways.

This helps users to notice issues before they happen, as retrieve may
not retrieve the expected secret due to duplicated IDs.

Reviewed-by: Finn Callies <fcallies@linux.ibm.com>
Tested-by: Finn Callies <fcallies@linux.ibm.com>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-05-05 17:15:01 +02:00
Jan Höppner
0eac97542d libutil/util_file: Handle over-read in util_file_read_fd()
In certain situations util_file_read_fd_buf() might return a larger
buffer than printable characters were read (e.g. a file was padded with
zeros). This can lead to util_file_read_fd() returning NULL with a freed
buffer even though a certain amount of printable characters were read.

This behaviour causes a regression introduced with commit 9efd1df31d
("ipl_tools: Refactor read helper using util_file_read_text_file()") in
ipl_tools were the scp_data sysfs attribute is padded with 0 to fit an 8
byte alignment required by the architecture.

Fix this by comparing the size read with the actual string length and
use the smaller value for further processing.

Fixes: 9efd1df31d ("ipl_tools: Refactor read helper using util_file_read_text_file()")
Tested-by: Jan Polensky <japo@linux.ibm.com>
Reviewed-by: Jan Polensky <japo@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-05-05 17:15:01 +02:00
Thomas Richter
b3db52fd16 libutil: Add machine type definition for machines 9175 and 9176
Add machine type definition for machines 9175 and 9176.

Signed-off-by: Thomas Richter <tmricht@linux.ibm.com>
Reviewed-by: Sumanth Korikkar <sumanthk@linux.ibm.com>
Suggested-by: Christian Borntraeger <borntraeger@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-05-05 17:15:01 +02:00
Steffen Eiden
a9eb80b1a2 pvattest: Fix successful 'check' evaluation
Invert the polarization of the successful state. The checks are
considered to be successful if there are no issues. Therefore, test for
an empty issue list and not for a non-empty.

Fixes: 697dcc0f6b ("rust/pvattest: Add check command")
Reported-by: Reinhard Buendgen <buendgen@de.ibm.com>
Reviewed-by: Jan Höppner <hoeppner@linux.ibm.com>
Reviewed-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-05-05 17:15:01 +02:00
Marc Hartmayer
e93668ae5b rust/Makefile: Fix file permissions for shell completion files
While at it, preserve the timestamps as well because it's recommended.

See https://docs.fedoraproject.org/en-US/packaging-guidelines/ShellCompletions/.

Fixes: b3055154db ("rust/Makefile: Add 'install-(bash|zsh)-completion' targets")
Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-04-16 12:36:56 +02:00
Eduard Shishkin
c68c3cb8b2 ipl_tools/chreipl: Use S390TOOLS_LIBDIR variable
Use S390TOOLS_LIBDIR environment variable to locate the helper
script.

Reviewed-by: Stefan Haberland <sth@linux.ibm.com>
Signed-off-by: Eduard Shishkin <edward6@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-04-16 12:36:50 +02:00
Eduard Shishkin
f63c548c2a ipl_tools/chreipl: Support md partitions
Fix the helper name construction procedure to support also the case
when the node is over a regular md-partition:

\# lsblk
dasda                             94:0    0 20.6G  0 disk
`-dasda1                          94:1    0 20.6G  0 part
  `-md0                            9:0    0 20.6G  0 raid1
    |-md0p1                      259:0    0    1M  0 md    /mnt
    `-md0p2                      259:1    0 20.6G  0 md
dasdb                             94:4    0 20.6G  0 disk
`-dasdb1                          94:5    0 20.6G  0 part
  `-md0                            9:0    0 20.6G  0 raid1
    |-md0p1                      259:0    0    1M  0 md    /mnt
    `-md0p2                      259:1    0 20.6G  0 md

\# chreipl /mnt

Actual result:

chreipl: Unsupported device node "/mnt" specified

Expected result:

Re-IPL type: ccw
Device:      0.0.6569
Loadparm:    ""
Bootparms:   ""
clear:       0

Reviewed-by: Stefan Haberland <sth@linux.ibm.com>
Signed-off-by: Eduard Shishkin <edward6@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-04-16 12:36:40 +02:00
Eduard Shishkin
1ab2fbb482 zipl_helper.device-mapper: Support dm- over md-devices
Add support for complex dm- over md-devices.
It includes an important particular use case in distro installation
process, when a linear dm-target is built on the top of software
RAID1:

dasda                      94:0    0  20.6G  0 disk
\_dasda1                   94:1    0    20G  0 part
  \_md127                   9:127  0    20G  0 raid1
    \_rhel_a46lp05-root00 253:5    0    20G  0 lvm   /
dasdb                      94:4    0  20.6G  0 disk
\_dasdb1                   94:5    0    20G  0 part
  \_md127                   9:127  0    20G  0 raid1
    \_rhel_a46lp05-root00 253:5    0    20G  0 lvm   /

\ # zipl_helper.device-mapper /

Expected result:

targetbase=94:0
targettype=CDL
targetgeometry=30051,15,12
targetblocksize=4096
targetoffset=4632
targetbase=94:4
targettype=CDL
targetgeometry=30051,15,12
targetblocksize=4096
targetoffset=4632

Actual result (incorrect):

targetbase=9:127
targettype=SCSI
targetblocksize=4096
targetoffset=256

Reviewed-by: Stefan Haberland <sth@linux.ibm.com>
Signed-off-by: Eduard Shishkin <edward6@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-04-16 12:35:52 +02:00
Thomas Richter
fed79474e4 cpumf: Convert S390_CPUMF_XXX to util_path_sysfs()
Use util_path_sysfs() to form a fully qualified sysfs file name
for files S390_CPUMF_CF, S390_CPUMF_CFDIAG, S390_CPUMF_SF,
S390_SYSFS_PAI_CRYPTO and S390_SYSFS_PAI_EXT.
No functional change.

Signed-off-by: Thomas Richter <tmricht@linux.ibm.com>
Reviewed-by: Sumanth Korikkar <sumanthk@linux.ibm.com>
Reviewed-by: Jan Höppner <hoeppner@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-04-16 12:12:45 +02:00
Thomas Richter
8c1ffd8989 cpumf: Convert S390_CPUMSF_BUFFERSZ to util_path_sysfs()
Use util_path_sysfs() to form a fully qualified sysfs file name
for file S390_CPUMSF_BUFFERSZ.
No functional change.

Signed-off-by: Thomas Richter <tmricht@linux.ibm.com>
Reviewed-by: Sumanth Korikkar <sumanthk@linux.ibm.com>
Reviewed-by: Jan Höppner <hoeppner@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-04-16 12:12:45 +02:00
Ingo Franzki
33fc534a81 zkey: Adjust CCA host library version detection for newer CCA versions
Newer CCA versions might report the version string with CSUACFV or CSUACFQ
with keyword STATCCA using a different indicator character after the
version information. Ignore the indication character and the remaining
data entirely. Only the version information as such is of interest.

Signed-off-by: Ingo Franzki <ifranzki@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-04-16 12:12:45 +02:00
Thomas Richter
7e832ead9e libcpumf: Convert S390_CPUS_ONLINE to util_path_sysfs()
Use util_path_sysfs() to form a fully qualified sysfs file name
for file S390_CPUS_ONLINE.
No functional change.

Signed-off-by: Thomas Richter <tmricht@linux.ibm.com>
Reviewed-by: Sumanth Korikkar <sumanthk@linux.ibm.com>
Reviewed-by: Jan Höppner <hoeppner@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-04-16 12:12:44 +02:00
Thomas Richter
7f0f765bb4 libcpumf: Remove define S390_CPUS_POSSIBLE
This define S390_CPUS_POSSIBLE is not referenced anymore.
Remove it.
No functional change.

Signed-off-by: Thomas Richter <tmricht@linux.ibm.com>
Reviewed-by: Sumanth Korikkar <sumanthk@linux.ibm.com>
Reviewed-by: Jan Höppner <hoeppner@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-04-16 12:12:44 +02:00
Jan Polensky
69c7f45bb7 ipl_tools/cmd_lsreipl.c: Refactor to reduce code duplication
Eliminated redundant code to improve clarity and maintainability.
Replaced with existing utility functions from the library.

Signed-off-by: Jan Polensky <japo@linux.ibm.com>
Reviewed-by: Jan Höppner <hoeppner@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-04-16 12:12:44 +02:00
Jan Polensky
d843e08828 ipl_tools/ipl_tools.h: Remove redundant extern for functions
Function declarations in header files are implicitly extern, making
the explicit  use of extern unnecessary. Removing it simplifies the
code without changing semantics and behavior.

Signed-off-by: Jan Polensky <japo@linux.ibm.com>
Reviewed-by: Jan Höppner <hoeppner@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-04-16 12:12:44 +02:00
Joern Siglen
055c455571 dbginfo.sh: Update for network commands
New Distros are replacing iptables by nftables.
Collecting data of optical interfaces.

Suggested-by: Hendrik Brueckner<brueckner@linux.ibm.com>
Suggested-by: Niklas Schnelle <schnelle@linux.ibm.com>
Reviewed-by: Mario Held <mario.held@de.ibm.com>
Reviewed-by: Niklas Schnelle <schnelle@linux.ibm.com>
Signed-off-by: Hendrik Brueckner <brueckner@linux.ibm.com>
Signed-off-by: Joern Siglen <siglen@de.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-04-07 17:42:19 +02:00
Jakob Naucke
ba387af804 rust/pvimg: Macroize flag parsing
Macroize flag parsing to save some repetition and lines.

Reviewed-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Jakob Naucke <naucke@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-04-07 17:42:18 +02:00
Jakob Naucke
8b9960abe9 rust/pvimg: Fix spelling of Enforcement
Fix spelling of CckExtensionSecretEnforcement and adhere to Rust
capitalisation conventions.

Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
Reviewed-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Jakob Naucke <naucke@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-04-07 17:42:18 +02:00
Jakob Naucke
efdadfcdb9 rust/pv*: Unit test flag parsing
Add a unit test for flag parsing.

In order to ease this test, add derive Eq to ControlFlags and
Msb0Flags64. For the same test, add derive Default to
CreateBootImageArgs and the structs used in it. The latter can be
limited to only derive when testing to avoid confusion with any
user-level default.

Acked-by: Steffen Eiden <seiden@linux.ibm.com>
Reviewed-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Jakob Naucke <naucke@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-04-07 17:42:18 +02:00
Jakob Naucke
ec10654c35 rust/pvimg: Make PCKMO plaintext control flags a constant
The PCKMO plaintext control flags are used in several places as is
and are also to be used in an upcoming unit test. Make them a constant.

Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
Reviewed-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Hendrik Brueckner <brueckner@linux.ibm.com>
Signed-off-by: Jakob Naucke <naucke@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-04-07 17:42:18 +02:00
Jakob Naucke
76bddf9715 rust/pvapconfig: Add --unbind option
When the --unbind option is enabled, run with an empty config instead,
effectively unbinding all APQNs.

Reviewed-by: Harald Freudenberger <freude@linux.ibm.com>
Acked-by: Steffen Eiden <seiden@linux.ibm.com>
Signed-off-by: Jakob Naucke <naucke@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-04-07 17:42:18 +02:00
Thomas Richter
b4cc30ac10 cpumf/lshwc: Add command line flag for run time
Add a command line flag to specify run time of lshwc command in
terms of days, hours, minutes and seconds. The command line flag
is named -t and has a number as argument followed by one of the
letters 's' for seconds (default), 'm' for minutes, 'h' for hours
and 'd' for days. Default is seconds when no trailing letter is
detected.

Signed-off-by: Thomas Richter <tmricht@linux.ibm.com>
Reviewed-by: Jan Höppner <hoeppner@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-04-07 17:42:18 +02:00
Mikhail Zaslonko
9f9dddddd4 zdump: Drop build_arch for s390 DASD dumps
The build_arch field in s390 DASD dump header has originally been used to
indicate whether the dump tool has been built on s390 or s390x system.
Since no other architectures but s390x are supported for Linux on z, do
not process build_arch attribute. Bail out if any build architecture other
than ARCH_64 has been detected in s390_ext or s390mv_ext DASD dump header.
Remove build architecture line from 'zgetdump -i' output:
  Build arch.........: s390x (64 bit)
The man file for zgetdump is updated accordingly.

Signed-off-by: Mikhail Zaslonko <zaslonko@linux.ibm.com>
Reviewed-by: Alexander Egorenkov <egorenar@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-04-07 17:42:18 +02:00
Mikhail Zaslonko
f821a3c174 zdump: Drop support of 32-bit dump architecture
- Initialize dump and dump-tool architecture to DFI_ARCH_64 at the start
  of dfi_init() and dt_init() respectively.
- Bail out if any dump architecture other than ARCH_64 has been detected
  in s390_ext or s390mv_ext DASD dump header.
- Remove redundant dfi_arch_set() and dt_arch_set() functions.
- Get rid of l.arch local variables in dfi* and dt* source files and
  drop dfi_arch() function.
- Drop the usage of DFI_ARCH_32 and compeletely remove DFI_ARCH_UNKNOWN.
- Drop special register and lowcore processing functions used
  for DFI_ARCH_32.
- Drop df_s390_from_dfi_arch() and df_s390_to_dfi_arch() funcitons.
- Update the man file for zgetdump.

Signed-off-by: Mikhail Zaslonko <zaslonko@linux.ibm.com>
Reviewed-by: Alexander Egorenkov <egorenar@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-04-07 17:42:18 +02:00