Commit Graph

2370 Commits

Author SHA1 Message Date
Jan Polensky
3f7b459606 dump2tar: Remove unused header file
Drop idcache.h as it is not used in this file.

Reviewed-by: Jan Höppner <hoeppner@linux.ibm.com>
Signed-off-by: Jan Polensky <japo@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-12-01 13:45:37 +01:00
Jan Polensky
14830b1ead zdev: Remove unused header files
Remove unused header files from these sources.
This simplifies maintenance and slightly reduces compile time.

Reviewed-by: Jan Höppner <hoeppner@linux.ibm.com>
Signed-off-by: Jan Polensky <japo@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-12-01 13:45:37 +01:00
Jan Polensky
1dae9b4f49 zconf/lsqeth: Remove unused internal headers
Drop unused headers from the internal s390-tools library. These headers
were only indirectly pulling in stdlib.h, which is now included
explicitly to support memory deallocation via free().

Reviewed-by: Jan Höppner <hoeppner@linux.ibm.com>
Signed-off-by: Jan Polensky <japo@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-12-01 13:45:37 +01:00
Jan Polensky
b58414d7dc zconf/lscss: Remove unused header
Drop lib/util_base.h and lib/zt_common.h as they are not used in this
file.

Reviewed-by: Jan Höppner <hoeppner@linux.ibm.com>
Signed-off-by: Jan Polensky <japo@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-12-01 13:45:37 +01:00
Jan Polensky
64524f17fa libutil/util_path: Remove unused headers
Drop lib/util_base.h and lib/util_prg.h as they are not used in this
file.

Reviewed-by: Jan Höppner <hoeppner@linux.ibm.com>
Signed-off-by: Jan Polensky <japo@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-12-01 13:45:37 +01:00
Jan Polensky
1b87b016d4 libutil/util_list: Remove unused header stdio.h
Drop stdio.h as it is not used in this file.

Reviewed-by: Jan Höppner <hoeppner@linux.ibm.com>
Signed-off-by: Jan Polensky <japo@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-12-01 13:45:37 +01:00
Jan Polensky
94bdb17d01 cpumf/lscpumf: Remove unused header
Remove ctype.h and errno.h since they are not referenced in this
file.
Add err.h to explicitly declare the dependency on warnx().

Reviewed-by: Jan Höppner <hoeppner@linux.ibm.com>
Signed-off-by: Jan Polensky <japo@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-12-01 13:45:37 +01:00
Jan Polensky
2625cd704f cpumf/chcpumf: Remove unused header
Remove lib/util_base.h and errno.h since they are not referenced in this
file.
Add err.h to explicitly declare the dependency on err() and warn().

Reviewed-by: Jan Höppner <hoeppner@linux.ibm.com>
Signed-off-by: Jan Polensky <japo@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-12-01 13:45:37 +01:00
Jan Polensky
59df2c6d02 util_libc: Fix typo
Reviewed-by: Jan Höppner <hoeppner@linux.ibm.com>
Signed-off-by: Jan Polensky <japo@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-12-01 13:45:36 +01:00
Jan Polensky
8ba03642b7 libvtoc: Fix typos
Reviewed-by: Jan Höppner <hoeppner@linux.ibm.com>
Signed-off-by: Jan Polensky <japo@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-12-01 13:45:36 +01:00
Jan Polensky
1956e7abc5 zdsfs: Fix typos
Reviewed-by: Jan Höppner <hoeppner@linux.ibm.com>
Signed-off-by: Jan Polensky <japo@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-12-01 13:45:36 +01:00
Jan Polensky
d76cb1d53a fdasd: Fix typos
Reviewed-by: Jan Höppner <hoeppner@linux.ibm.com>
Signed-off-by: Jan Polensky <japo@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-12-01 13:45:36 +01:00
Jan Polensky
7d5f2ba038 zconf/lscss: Fix typos
Reviewed-by: Jan Höppner <hoeppner@linux.ibm.com>
Signed-off-by: Jan Polensky <japo@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-12-01 13:45:36 +01:00
Jan Polensky
8bbf1d5bea checkpatch: Ignore STRNCPY warning for userspace code
For s390-tools util_strlcpy() would be a safer replacement. However,
no code is changed, only .checkpatch.conf is updated to avoid false
positives in userspace.

Reviewed-by: Jan Höppner <hoeppner@linux.ibm.com>
Signed-off-by: Jan Polensky <japo@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-12-01 13:45:36 +01:00
Jan Polensky
b2fcb608d5 Add project-wide .clang-tidy configuration
Introduce a .clang-tidy file to provide consistent code quality checks
across the project.

The configuration is not integrated into .pre-commit-config.yaml because
it depends on a recently generated compile_commands.json file.

Example usage:

	clang-tidy --fix-errors **/*.[ch]

Note: Running clang-tidy should be considered optional, not enforced.

Reviewed-by: Jan Höppner <hoeppner@linux.ibm.com>
Signed-off-by: Jan Polensky <japo@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-12-01 13:45:36 +01:00
Marc Hartmayer
76b7928592 netboot: Format mk-s390image
Command line used:

  $ shfmt --space-redirects --case-indent --simplify --func-next-line --write mk-s390image

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-12-01 13:45:36 +01:00
Marc Hartmayer
339b69cf3b netboot: Ignore the removal of nonexistent file in mk-s390image
Ignore the removal of nonexistent $image file. This removes the
following error message:

$ mk-s390image /var/lib/libvirt/images/hades/vmlinux-s390x out.img
...
rm: cannot remove 'out.img': No such file or directory

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-12-01 13:45:36 +01:00
Marc Hartmayer
419f042f55 netboot: Improve error reporting in mk-s390image
If an input file is not readable return a proper error message indicating
this.

Before:

$ mk-s390image /var/lib/libvirt/images/hades/vmlinux-s390x out.img
mk-s390image: Unrecognized file format for /var/lib/libvirt/images/hades/vmlinux-s390x

After:

$ mk-s390image /var/lib/libvirt/images/hades/vmlinux-s390x out.img
mk-s390image: File /var/lib/libvirt/images/hades/vmlinux-s390x cannot be read, no read permission

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-12-01 13:45:36 +01:00
Marc Hartmayer
128e5f86fe netboot: Add longer kernel command lines support
Since Linux commit 5ecb2da660ab ("s390: support command lines longer
than 896 bytes") the s390x kernel supports longer command lines than 896
bytes. The indication of the maximum size is stored in a new field at
address 0x10430, older kernels without the support store a value of 0
there so in that case fallback to the old maximum length of 896.

In addition, use the checked size as limit to copy in the 'dd' call.
This prevents Linux kernel corruption in case the parmline has changed
in between.

Fixes: https://github.com/ibm-s390-linux/s390-tools/issues/194
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-12-01 13:45:36 +01:00
Marc Hartmayer
b29e824923 netboot: Fix shellcheck findings in mk-s390image and make the script more robust
Most of the fixes were auto-generated using the following command:

     $ shellcheck --format=diff mk-s390image | git apply -

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-12-01 13:45:36 +01:00
Ajaykumar Rajappa
3175d52ce7 ziomon: Add support to sample device symlinks
Enhance 'ziomon' utility to support persistent SCSI device symlinks,
including regular, multipath and partitioned devices. Supports /dev/disk/
subdirectories (by-id, by-path, by-uuid, by-label, etc.), resolving the
symlinks to their SCSI block devices.

Signed-off-by: Ajaykumar Rajappa <ajaykr@linux.ibm.com>
Reviewed-by: Chinmaya Kajagar <chinmayk@linux.ibm.com>
Tested-by: Chinmaya Kajagar <chinmayk@linux.ibm.com>
Reviewed-by: Nihar Panda <niharp@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-12-01 13:45:33 +01:00
Jörn Siglen
17024c02af dbginfo.sh: Adding stp time information
Calling lsstp to get the status on STP time sync.

Suggested-by: Michael Storzer <MSTORZER@de.ibm.com>
Reviewed-by: Michael Storzer <MSTORZER@de.ibm.com>
Signed-off-by: Jörn Siglen <siglen@de.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-12-01 13:45:32 +01:00
Jörn Siglen
5cd680c0be dbginfo.sh: Simplify procfs collection
Using the base dir only, will ensure to get all needed info independent of
configuration and future changes.

├── dasd
│   ├── devices
│   └── statistics

├── net
│   ├── anycast6
│   ├── arp

│   ├── bonding

│   ├── dev
│   ├── dev_mcast
│   ├── dev_snmp6
│   │   ├── encbdf0
│   │   └── lo

│   ├── sockstat
│   ├── sockstat6
│   ├── softnet_stat
│   ├── stat
│   │   ├── arp_cache
│   │   ├── ndisc_cache
│   │   ├── nf_conntrack
│   │   └── rt_cache

│   ├── vlan

The change in size and collection speed can be ignored.

Reviewed-by: Michael Storzer <MSTORZER@de.ibm.com>
Signed-off-by: Jörn Siglen <siglen@de.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-12-01 13:45:32 +01:00
Ajaykumar Rajappa
c333f91d4c ziomon/ziorep_config: Add fcp-lun to -M option output
Update the ‘ziorep_config’ utility to print FCP-LUN details
when the ‘-M’ option is used.

Now, ‘ziorep_config -M' option prints FCP LUN(fcp-lun) ID along with the
existing FCP device bus-id and WWPN. This addition helps correlate the
output with command 'multipathd -k', subcommand 'show topo' output,
aiding in better visibility and mapping of FCP devices to their respective
LUNs in multipath environments.

$ ziorep_config -t -M
adapter  remote_port        LUN                scsi_dev multipath_device
========================================================================
0.0.1967 0x500507630704572c 0x405240f500000000 /dev/sda /dev/mapper/mpatha
0.0.1967 0x500507630704572c 0x405340f500000000 /dev/sdb /dev/mapper/mpathb
0.0.1927 0x500507630700572c 0x405240f500000000 /dev/sdc /dev/mapper/mpatha
0.0.1967 0x500507630704572c 0x405440f500000000 /dev/sdd /dev/mapper/mpathc
0.0.1927 0x500507630700572c 0x405340f500000000 /dev/sde /dev/mapper/mpathb
0.0.1927 0x500507630700572c 0x405440f500000000 /dev/sdf /dev/mapper/mpathc
0.0.1967 0x500507630704572c 0x405540f500000000 /dev/sdg /dev/mapper/mpathd
0.0.1927 0x500507630700572c 0x405540f500000000 /dev/sdh /dev/mapper/mpathd

The LUN IDs from the above output can be correlated with multipath's
H-C-T-L(LUN ID in decimal) of each FCP devices as shown below,
$ multipathd -k
multipathd > show topo
create: mpatha (36005076307ffd72c00000000000052f5) dm-0 IBM,2107900
size=40G features='1 queue_if_no_path' hwhandler='1 alua' wp=rw
`-+- policy='service-time 0' prio=50 status=active
  |- 0:0:0:1089814610 sdc 8:32  active ready running
  `- 1:0:0:1089814610 sda 8:0   active ready running
create: mpathb (36005076307ffd72c00000000000053f5) dm-1 IBM,2107900
size=40G features='1 queue_if_no_path' hwhandler='1 alua' wp=rw
`-+- policy='service-time 0' prio=50 status=active
  |- 0:0:0:1089814611 sde 8:64  active ready running
  `- 1:0:0:1089814611 sdb 8:16  active ready running
create: mpathc (36005076307ffd72c00000000000054f5) dm-4 IBM,2107900
size=20G features='1 queue_if_no_path' hwhandler='1 alua' wp=rw
`-+- policy='service-time 0' prio=50 status=active
  |- 0:0:0:1089814612 sdf 8:80  active ready running
  `- 1:0:0:1089814612 sdd 8:48  active ready running
create: mpathd (36005076307ffd72c00000000000055f5) dm-5 IBM,2107900
size=20G features='1 queue_if_no_path' hwhandler='1 alua' wp=rw
`-+- policy='service-time 0' prio=50 status=active
  |- 0:0:0:1089814613 sdh 8:112 active ready running
  `- 1:0:0:1089814613 sdg 8:96  active ready running

Signed-off-by: Ajaykumar Rajappa <ajaykr@linux.ibm.com>
Reviewed-by: Chinmaya Kajagar <chinmayk@linux.ibm.com>
Reviewed-by: Nihar Panda <niharp@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-11-10 10:30:08 +01:00
Ajaykumar Rajappa
095e5ee226 ziomon/ziorep_config: Add port_id and failed attributes to -A option output
Update ziorep_config utility to extract and display the local fc_host
port_id and failed /sysfs attributes when -A(adapter) option is used.

$ ziorep_config -A
Host:    host0
PCHID:   0308
CHPID:   60
Adapter: 0.0.1927
Sub-Ch.: 0.0.0004
Name:    0xc05076fff38075d4
Port-Id: 0x33c016
P-Name:  0xc05076fff3803081
Version: 0x000b
LIC:     0x24500103
Type:    NPIV VPORT
Speed:   32 Gbit
State:   Online
Failed:  No

Signed-off-by: Ajaykumar Rajappa <ajaykr@linux.ibm.com>
Reviewed-by: Chinmaya Kajagar <chinmayk@linux.ibm.com>
Reviewed-by: Nihar Panda <niharp@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-11-10 10:29:57 +01:00
Peter Jin
6ee5ffef91 udev/rules.d: Set default io scheduler to 'none' for virtio-blk
Use 'none' as default io scheduler for virtio-blk devices. Performance
improvements for multi-queue setups and to reduce CPU consumption.

Signed-off-by: Peter Jin <pjin@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-11-10 10:29:52 +01:00
Peter Jin
82f8c137e1 udev/rules.d: make virtio-blk devices non-rotational
Performance measurements turned out that in certain situations the
paging/swap logic turns on the rotational feature for block devices. In the
past, this feature has been disabled for DASD devices. FCP and NVMe devices
are considered non-rotational by default (or exposed by the storage server).
Because those are the backing devices on Linux on Z/LinuxONE instances,
ensure that virtio-blk devices are always non-rotational.

Signed-off-by: Peter Jin <pjin@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-11-10 10:29:46 +01:00
Marc Hartmayer
b21a824fda cpacfinfo and pv: Fix comment style
Reviewed-by: Finn Callies <fcallies@linux.ibm.com>
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-11-07 14:34:48 +01:00
Marc Hartmayer
f74b8d7d6f cpacfinfo: Remove commented-out code
Reviewed-by: Finn Callies <fcallies@linux.ibm.com>
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-11-07 14:34:48 +01:00
Marc Hartmayer
b766d4a53c rust: Apply clippy fixes to format strings
Makes the code easier to read.

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-11-07 14:34:48 +01:00
Marc Hartmayer
a1126352ec zipl/boot: Improve linker scripts
Output all text input sections into one text section and map all input
sections .bss.* .text.*, .rodata.*, and .data.* as it's done by the
default linker script [1]. In addition, make the linker script easier to
read by replacing the magic value of 32 with 'SIZEOF(.sb.trailer)'.

[1] Check the output of 'ld --verbose'.

Reviewed-by: Mikhail Zaslonko <zaslonko@linux.ibm.com>
Reviewed-by: Stefan Haberland <sth@linux.ibm.com>
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-11-07 14:34:48 +01:00
Marc Hartmayer
35e539a428 zipl/boot: Declare 'magic' variable as static
Reviewed-by: Mikhail Zaslonko <zaslonko@linux.ibm.com>
Reviewed-by: Stefan Haberland <sth@linux.ibm.com>
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-11-07 14:34:48 +01:00
Marc Hartmayer
99100b3f99 zipl/boot: Explicitly declare stage2.head as used
Although stage2.head is not directly used in stage2, it is required by
other stages. To ensure it is retained during link-time
optimization (LTO), explicitly mark it as used. This improves code
readability and prevents LTO from mistakenly removing it.

Reviewed-by: Mikhail Zaslonko <zaslonko@linux.ibm.com>
Reviewed-by: Stefan Haberland <sth@linux.ibm.com>
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-11-07 14:34:48 +01:00
Marc Hartmayer
49faa1d7fd lib/zt_common.h: Add '__used' macro
The macro will be used in the next patch and makes checkpatch happy.

Reviewed-by: Mikhail Zaslonko <zaslonko@linux.ibm.com>
Reviewed-by: Stefan Haberland <sth@linux.ibm.com>
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-11-07 14:34:48 +01:00
Marc Hartmayer
86ce85b3a6 zipl/boot: Fix typos
Reviewed-by: Mikhail Zaslonko <zaslonko@linux.ibm.com>
Reviewed-by: Stefan Haberland <sth@linux.ibm.com>
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-11-07 14:34:48 +01:00
Marc Hartmayer
b1c1bea4e2 zipl/boot: Rename *.exec into *.elf
Rename .exec into .elf because they are ELF files, no reason to use a
different file extension.

This change improves the shell's autocompletion of tools such as
'readelf'.

Acked-by: Mikhail Zaslonko <zaslonko@linux.ibm.com>
Reviewed-by: Stefan Haberland <sth@linux.ibm.com>
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-11-07 14:34:48 +01:00
Ingo Franzki
e68547f06f libkmipclient: Fix return code passing
Function kmip_connection_tls_verify_server() erroneously always returns
zero, even if an error is detected inside the function. Fix this by
returning the return code value at the end of the function.

Found by clang static code analyzer.

Fixes: 56fecf1832 ("libkmipclient: Add KMIP client shared library")
Reviewed-by: Jan Höppner <hoeppner@linux.ibm.com>
Signed-off-by: Ingo Franzki <ifranzki@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-11-07 14:34:48 +01:00
Ajaykumar Rajappa
95d784d866 ziomon/ziomon_fcpconf: Set mode to 755 to match install
No functional changes to the file content.

Signed-off-by: Ajaykumar Rajappa <ajaykr@linux.ibm.com>
Reviewed-by: Jan Höppner <hoeppner@linux.ibm.com>
[hoeppner@linux.ibm.com: Adapt commit message]
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-11-07 14:33:26 +01:00
Shalini Chellathurai Saroja
783ae9735e dbginfo: Collect CPI data of the KVM guests
Collect Control-Program Identification (CPI) data of the KVM
guests. The CPI data contains system name, system type,
system level and sysplex name of the guests. It also provides
the timestamp in which these data were colleceted from the
guests.

Note:
CPI information for SEL guests require explicit enablement.

Signed-off-by: Shalini Chellathurai Saroja <shalini@linux.ibm.com>
Suggested-by: Hendrik Brueckner <brueckner@linux.ibm.com>
Reviewed-by: Hendrik Brueckner <brueckner@linux.ibm.com>
Reviewed-by: Jörn Siglen <siglen@de.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-11-07 14:33:26 +01:00
Ingo Franzki
5a78c7f45d zkey: Report the KCV as part of the KMS label for KMS keys
The key check value (KCV) is the first 3 bytes of the ENC-ZERO key
verification pattern of a key. ENC-ZERO encrypts an all zero block with
the key using AES-ECB and returns the result truncated to 3 bytes as
key check value.

Report the KCV of a KMS generated key as part of its label. This is
especially useful for AES-XTS keys, where the KCV is reported on each
of the 2 individual AES keys that an AES-XTS key is built of. It allows
users to compare the KCV displayed by zkey with the KCV displayed by
the key management system where the key was generated on. If the KCV
value is the same, then the key values are the same, too.

The key verification pattern reported by zkey is also an ENC-ZERO
key check value, but for AES-XTS keys it is built by encrypting
the all zero block with AES-XTS, which produces a KCV for the complete
AES-XTS key, but does not allow to check the individual key parts.

Signed-off-by: Ingo Franzki <ifranzki@linux.ibm.com>
Reviewed-by: Finn Callies <fcallies@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-11-07 14:33:26 +01:00
Ingo Franzki
586040a0ad zkey/ekmfweb: Validate the certificate during client registration
When registering a zkey client at the EKMFWeb server, validate the
certificate if it's public key matches with the identity key of
the zkey client.

Only allow registration when the certificate matches. This helps to
prevent users from erroneously registering a wrong or outdated
certificate for a zkey client.

Signed-off-by: Ingo Franzki <ifranzki@linux.ibm.com>
Reviewed-by: Finn Callies <fcallies@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-11-07 14:33:26 +01:00
Ingo Franzki
deb61b5cd9 libekmfweb: Add function to validate a certificate against the identity key
Function ekmf_validate_cert() checks if the public key contained in a x509
certificate matches the public key of the identity key.

Signed-off-by: Ingo Franzki <ifranzki@linux.ibm.com>
Reviewed-by: Finn Callies <fcallies@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-11-07 14:33:26 +01:00
Ingo Franzki
8be51ad454 zkey: Perform KMS login before making any permanent changes to a key
A KMS login may prompt the user for its credentials. Users may abort that
prompt by Cntl-C. Do not make any permanent changes to a key before the
KMS login, because those changes can not be undone when the user has
aborted during KMS login, leaving the key in a potentially inconsistent
state.

Signed-off-by: Ingo Franzki <ifranzki@linux.ibm.com>
Reviewed-by: Finn Callies <fcallies@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-11-07 14:33:26 +01:00
Finn Callies
cef50c2140 cpacfstats: Recommend systemctl to manage daemon
Update manpage to recommend using systemctl to manage the cpacfstatsd.

Reviewed-by: Harald Freudenberger <freude@linux.ibm.com>
Reviewed-by: Ingo Franzki <ifranzki@linux.ibm.com>
Signed-off-by: Finn Callies <fcallies@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-11-07 14:33:17 +01:00
L. E. Segovia
33bd112e2f s390-tools: Fix compilation with musl and gcc 14
lscss.c: In function 'is_sch_vfio':
lscss.c:392:20: error: implicit declaration of function 'basename' [-Wimplicit-function-declaration]
  392 |         if (strcmp(basename(driver_path), "vfio_ccw") == 0)

device.c: In function 'device_read_active_attrib':
device.c:426:45: error: implicit declaration of function 'basename'; did you mean 'rename'? [-Wimplicit-function-declaration]
  426 |                         value = misc_strdup(basename(link));
      |                                             ^~~~~~~~
      |                                             rename

Closes: https://github.com/ibm-s390-linux/s390-tools/pull/192
[hoeppner@linux.ibm.com: Sort includes]
Signed-off-by: L. E. Segovia <amy@amyspark.me>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-11-07 14:33:17 +01:00
Sertonix
2c31ed6f14 lib(ekmfweb|kmipclient): Use ln without -r
The option isn't portable (not in POSIX or busybox) and it easily works
without.

Closes: https://github.com/ibm-s390-linux/s390-tools/pull/191
Signed-off-by: Sertonix <sertonix@posteo.net>
Acked-by: Ingo Franzki <ifranzki@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-11-07 14:33:16 +01:00
Jörn Siglen
771623832b dbginfo.sh: Add NetworkManager and netplan
NetworkManager stores new network profiles in keyfile format in the
/etc/NetworkManager/system-connections/ directory.

/etc/network/interfaces might be replaced by /etc/netplan on some systems

Reviewed-by: Mario Held <mario.held@de.ibm.com>
Reviewed-by: Michael Storzer <MSTORZER@de.ibm.com>
Signed-off-by: Jörn Siglen <siglen@de.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-11-07 14:33:16 +01:00
Jörn Siglen
b8060baf44 dbginfo.sh: Add kvm_stat
Add collecting of KVM kernel module event counters for one second.

Reviewed-by: Hendrik Brueckner <brueckner@linux.ibm.com>
Reviewed-by: Mario Held <mario.held@de.ibm.com>
Reviewed-by: Michael Storzer <MSTORZER@de.ibm.com>
Signed-off-by: Jörn Siglen <siglen@de.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-11-07 14:33:16 +01:00
Jan Höppner
76a0401deb common.mak: Remove NO_PIE_CFLAGS
The definition NO_PIE_CFLAGS has only two users and specifies only a
single compiler flag. There is no point having this definition anymore.

Remove the definition and specify -fno-pie directly for the two users.

Reviewed-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-11-07 14:31:47 +01:00
Jan Höppner
e6ac87d7a2 common.mak: Remove NO_PIE_LDFLAGS
Commit c5a91199e3 ("zipl: Always build and link without PIE.")
introduced -fno-pie (for compilation) and -no-pie (for linking) for
zipl. At the time the linker was still used directly before commit
5e46632767 ("zipl: Use the compiler for linking instead of ld")
eventually switched to calling the compiler for the linking step.

During that adaption -static was introduced to the linker flags. -no-pie
was carried over as well. However -static implies -no-pie and it is
therefore not required. For GCC see also man 1 gcc (-static) [1]. Whilst
not explicitly documented, Clang shows the same behaviour. Clang also
complains when -static and -no-pie are specified in the linker step at
the same time with the following warning:

clang: warning: argument unused during compilation: '-no-pie' [-Wunused-command-line-argument]

Since -no-pie is not required, remove it and get rid of the warning.

[1] https://gcc.gnu.org/onlinedocs/gcc/Link-Options.html#index-static
Reviewed-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-11-07 14:31:47 +01:00