Commit Graph

1476 Commits

Author SHA1 Message Date
Marc Hartmayer
4bba1058c6 Declare pkg-config as required
`pkg-config` is a well established tool and all of our required
libraries do provide .pc files. Therefore let's declare `pkg-config` as
required and use it. In addition, remove now useless code.

Reviewed-by: Benjamin Block <bblock@linux.ibm.com>
Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
Reviewed-by: Jan Höppner <hoeppner@linux.ibm.com>
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
2023-05-30 13:31:20 +02:00
Jan Höppner
49937f40a1 zipl: Disable array-bounds warning
Since GCC12 several warnings like the following are produced in
zipl/boot compile targets:

CC      zipl/boot/stage2.o
stage2.c: In function ‘start’:
stage2.c:99:24: warning: array subscript 0 is outside array bounds of ‘struct stage2_descr[0]’ [-Warray-bounds]
   99 |         stage2_descr = *(struct stage2_descr*)STAGE2_DESC;

This is the same issue as reported for the Kernel [1][2]. There is
currently no sane fix available, therefore simply disable the warning
for the zipl/boot/ targets.

[1] https://lore.kernel.org/lkml/yt9dzgkelelc.fsf@linux.ibm.com/
[2] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99578

Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
2023-05-30 13:29:57 +02:00
Jan Höppner
d55818a797 dasdfmt: Fall back to full format if space release fails
In certain storage setups the Release Allocated Space (RAS) command to
free up space on the storage server previously allocated for an ESE DASD
might not work. At the moment dasdfmt will error out if RAS is failing.
This however is not ideal for the default case when a user is expecting
dasdfmt to simply format the disk.

One workaround would be to specify --no-discard to disable RAS
completely. However, a sane default handling that tries to work every
time is more reasonable.

Change the default handling as follows: If an ESE is detected default to
QUICK mode and try RAS. If RAS fails, fall back to the FULL format mode
and display a warning accordingly.

If -M (--mode) QUICK is specified explicitly dasdfmt will still error
out on a failing RAS. A combination with --no-discard will still allow
for a QUICK format on an ESE DASD in that case, if desired.

Reviewed-by: Stefan Haberland <sth@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
2023-05-30 13:29:57 +02:00
Steffen Eiden
96897ee32e pvattest/tools: fix endianness in tools
`od` in contrast to `xxd` uses the system endianness for displying the
hexdump by default which leads to invalid results on little endian
systems.
Use the `--endian=big` option to fix the endianness problem.

Fixes: 3cc0b4cd ("pvattest/tools: remove xxd dependency from scripts")
Reviewed-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
2023-05-26 12:21:04 +02:00
Marc Hartmayer
5522aaedf4 iucvterm/bin/chiucvallow: explicitly use bash
The script uses bashisms (e.g. `local` keyword) therefore make sure that
bash is used by setting the shebang line to `#!/bin/bash`.

Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
2023-05-26 12:21:04 +02:00
Joern Siglen
f3b7f4b14b dbginfo.sh: fix icastats for all users
icastats is accounted by user and does cover root only today
adding the --all will collect stats for all users

Reported-by: Ingo Franzki <ifranzki@de.ibm.com>
Reviewed-by: Ingo Franzki <ifranzki@de.ibm.com>
Signed-off-by: Joern Siglen <siglen@de.ibm.com>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
2023-05-26 12:21:04 +02:00
Sven Schnelle
01f74c75f5 zipl/dump: add dasd device to ngdump parmline
For dasd devices, we need to enable the device before we can use it.
Add the required dasd device to the kernel commandline when installing
ngdump to a dasd device.

Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Acked-by: Stefan Haberland <sth@linux.ibm.com>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
2023-05-26 12:21:04 +02:00
Sven Schnelle
24bcc3141d zipl: add support for ldipl dump from ECKD DASD
Add the required code to install ngdump on DASDs.

Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Acked-by: Stefan Haberland <sth@linux.ibm.com>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
2023-05-26 12:21:04 +02:00
Sven Schnelle
41108c98aa zipl: move mkfs to ngdump prepare script
The current code first assembles the ngdump init ramdisk, and creates
the filesystem on the dump disk afterwards. ngdump uses uuids to mount
the dump device. Because the filesystem uuid is changing with the final
mkfs, ngdump has to use the partuuid of the device. This does work for
nvme, but not for dasds. Another problem is that dryrun likely wouldn't
work if there's no partition table on the dump device. To fix these
issues, move the mkfs to the ngdump helper script so we can use the
filesystem uuid. When --dryrun is specified the script passes /dev/null
as ngdump device to make mkinitramfs happy. As the initramdisk is never
used in this case, this shouldn't be a problem.

Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Acked-by: Stefan Haberland <sth@linux.ibm.com>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
2023-05-26 12:21:04 +02:00
Sven Schnelle
f5aa1d4406 zipl: add ldipl-dump option
CCW and LD-IPL records cannot be used at the same time for dumps because
CCW dump uses the standalone dumper, while LD-IPL uses ngdump. The first
one writes data to the raw disk without any filesystem, while the second
one uses an ext filesystem. Therefore we need a way to tell zipl which
kind of dumper it should install, as both cannot be installed at the
same time. The device given is the same for both types, so we cannot use
this to decide which type to install. Therefore add a '--ldipl-dump' option
so the user can decide which type of dump to use.

Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Acked-by: Eduard Shishkin <edward6@linux.ibm.com>
Acked-by: Stefan Haberland <sth@linux.ibm.com>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
2023-05-26 12:21:04 +02:00
Sven Schnelle
ee4f503ec0 zipl: pass job to is_ngdump_enabled()
No functional change, only preparation for the next patches.

Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Acked-by: Eduard Shishkin <edward6@linux.ibm.com>
Acked-by: Stefan Haberland <sth@linux.ibm.com>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
2023-05-26 12:21:04 +02:00
Sven Schnelle
7095da9f9d dumpconf: add options for ldipl ECKD devices
Add the following options to dumpconf so that LDIPL ECKD devices
can be configured for dumping:

br_chr: (optional) location of boot record
device: ccw device
bootprog: boot program selector

Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Acked-by: Stefan Haberland <sth@linux.ibm.com>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
2023-05-26 12:21:03 +02:00
Eduard Shishkin
7c656faa36 zipl: remove last table / number of tables logic
In order to allow installing only a list-directed ipl entry, remove
the last-table/number-of-tables logic which always required a legacy
program table. With the new code there's no longer a loop in
prepare_bootloader() which requires a certain start index or order
of tables.

Signed-off-by: Eduard Shishkin <edward6@linux.ibm.com>
Acked-by: Stefan Haberland <sth@linux.ibm.com>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
2023-05-26 12:21:03 +02:00
Sven Schnelle
10515380e8 zipl: add print_details flag to struct install_set
Instead of depending on array index, add an explicit print_details
flag to struct install_set.

Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Acked-by: Eduard Shishkin <edward6@linux.ibm.com>
Acked-by: Stefan Haberland <sth@linux.ibm.com>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
2023-05-26 12:21:03 +02:00
Sven Schnelle
7301883e69 zipl: add skip_prepare flag to struct install_set
Instead of depending on array index to decide whether we
did already the preparation work for installing the bootloader,
add an explicit skip_prepare flag to struct install_set.

Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Acked-by: Eduard Shishkin <edward6@linux.ibm.com>
Acked-by: Stefan Haberland <sth@linux.ibm.com>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
2023-05-26 12:21:03 +02:00
Sven Schnelle
555f3782d4 zipl: rename PROGRAM_TABLE_* to {LEGACY}_BLKPTR_FORMAT_ID
In preparation of decoupling the program table position from
the block pointer format, rename:

PROGRAM_TABLE_0 to LEGACY_BLKPTR_FORMAT_ID
PRAGRAM_TABLE_1 to BLKPTR_FORMAT_ID

Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Acked-by: Stefan Haberland <sth@linux.ibm.com>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
2023-05-26 12:21:03 +02:00
Sven Schnelle
7ecad86938 zipl: split up install_bootloader()
To make the code easier to maintain and prepare for ECKD LD-IPL,
split up install_bootloader() into two functions: One which is used
for IPL, and one for dump partitions.

Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Acked-by: Stefan Haberland <sth@linux.ibm.com>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
2023-05-26 12:21:03 +02:00
Sven Schnelle
e496e9862c zipl: show whether we're installed LD ipl or dump
Let the user know whether we're going to install a
list-directed IPL or dump.

Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Acked-by: Eduard Shishkin <edward6@linux.ibm.com>
Acked-by: Stefan Haberland <sth@linux.ibm.com>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
2023-05-26 12:21:03 +02:00
Sven Schnelle
c8e989840f zipl: add disk_is_eckd_ldl()
Add a small helper to check whether a given disk is ECKD
containing a Linux disk label.

Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Acked-by: Eduard Shishkin <edward6@linux.ibm.com>
Acked-by: Stefan Haberland <sth@linux.ibm.com>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
2023-05-26 12:21:03 +02:00
Jan Höppner
908067bdf9 common.mak: Fix slow build
The relative subdirectory path of a build target is determined via a
separate shell command that issues 'cd' and 'pwd'. Spawning a separate
shell is very costly and can lead to extremely slow builds in some
circumstances.

Replace the shell command with the make built-in command 'realpath' to
accomplish the same result more efficiently.

Tested-by: Alexander Egorenkov <egorenar@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
2023-05-26 12:21:03 +02:00
Marc Hartmayer
2c7e61a6c7 zipl: check_common_ipl_data: fix memory leak of @buffer
Related Valgrind output:
  ==1073934== 241,722,000 bytes in 30 blocks are definitely lost in loss record 2 of 2
  ==1073934==    at 0x484417C: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-s390x-linux.so)
  ==1073934==    by 0x1006B8D: misc_malloc (misc.c:33)
  ==1073934==    by 0x1006B8D: misc_read_file (misc.c:150)
  ==1073934==    by 0x100DACD: check_common_ipl_data (job.c:774)
  ==1073934==    by 0x100FE2F: check_job_ipl_data (job.c:827)
  ==1073934==    by 0x100FE2F: check_job_menu_data (job.c:999)
  ==1073934==    by 0x100FE2F: check_job_data (job.c:1139)
  ==1073934==    by 0x100FE2F: job_get (job.c:2011)
  ==1073934==    by 0x1006335: main (zipl.c:141)

Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
Acked-by: Eduard Shishkin <edward6@linux.ibm.com>
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
2023-05-26 12:18:08 +02:00
Joern Siglen
ae824745a0 dbginfo.sh: add nstat command in network section
include the statistics about the network and SNMP

Reported-by: Nils Hoppmann <NIHO@de.ibm.com>
Signed-off-by: Joern Siglen <siglen@de.ibm.com>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
2023-05-26 12:18:08 +02:00
Mete Durlu
2b2c111af4 hyptop: Show thread util by default
Since SMT is being used by default on z systems, hyptop should show
thread utilization by default on both system and system list window.

Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
Signed-off-by: Mete Durlu <meted@linux.ibm.com>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
2023-05-26 12:18:08 +02:00
Marc Hartmayer
1bfa78896f libpv|pvattest: do not link against openssl
Neither libpv nor pvattest uses libssl functionality directly, so let's
remove it from the pkg-config calls.

$ pkg-config --libs openssl
-lssl -lcrypto

$ pkg-config --libs libcrypto
-lcrypto

Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
2023-05-26 12:18:04 +02:00
Marc Hartmayer
e928c6f83c .gitignore: ignore clangd cache
Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
Reviewed-by: Benjamin Block <bblock@linux.ibm.com>
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
2023-05-26 12:13:35 +02:00
Marc Hartmayer
0e86da9d66 zipl: extract_signature: fix memory leak of @signature
Fix memory leak @signature in case of an unsupported signature type.

Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
Reviewed-by: Stefan Haberland <sth@linux.ibm.com>
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
2023-05-26 12:13:35 +02:00
Marc Hartmayer
21dbbcfa56 zipl: scan_upldate_bls_path: fix memory leak of @img_value
Valgrind finding:
  ==1083976== 19 bytes in 1 blocks are definitely lost in loss record 1 of 1
  ==1083976==    at 0x484417C: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-s390x-linux.so)
  ==1083976==    by 0x48F3C97: __vasprintf_internal (vasprintf.c:71)
  ==1083976==    by 0x1006861: vasprintf (stdio2.h:218)
  ==1083976==    by 0x1006861: misc_asprintf (misc.c:49)
  ==1083976==    by 0x100C7E1: scan_update_bls_path (scan.c:1874)
  ==1083976==    by 0x100FF4B: get_job_from_config_file (job.c:1901)
  ==1083976==    by 0x100FF4B: job_get (job.c:1997)
  ==1083976==    by 0x1006335: main (zipl.c:141)

Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
Reviewed-by: Stefan Haberland <sth@linux.ibm.com>
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
2023-05-26 12:13:35 +02:00
Marc Hartmayer
0a512bf904 common.mak: use single quotes in order to avoid globbing
Reviewed-by: Jan Höppner <hoeppner@linux.ibm.com>
Reviewed-by: Benjamin Block <bblock@linux.ibm.com>
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
2023-05-26 12:13:35 +02:00
Marc Hartmayer
e6be1c1b79 zipl/boot: constify data in section stage2_head
Declare `magic`, `tape_head`, and `stage2_head` as const.

Acked-by: Eduard Shishkin <edward6@linux.ibm.com>
Acked-by: Mikhail Zaslonko <zaslonko@linux.ibm.com>
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>
2023-03-31 18:23:46 +02:00
Marc Hartmayer
a4eb03dfe1 zipl: set kernel parmline only if it was specified
Before commit 5fb6434548 ("zipl: add get_common_components() and
finalize_common_address_data()") the default kernel parmline was only
overwritten if a parmline was specified. After the commit it was always
overwritten, even if no parmline was specified. Let's change this
behavior back by adding a NULL-pointer check. For dump types this change
changes the behavior before commit 5fb6434548 ("zipl: add
get_common_components() and finalize_common_address_data()").

Fixes: 5fb6434548 ("zipl: add get_common_components() and finalize_common_address_data()")
Reviewed-by: Steffen Eiden <seiden@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>
2023-03-31 18:23:46 +02:00
Marc Hartmayer
fc1167fd34 common.mak: avoid a lot of warnings if make --warn is used
Fix the following warnings by using proper default values:

../common.mak:1: warning: undefined variable 'COMMON_INCLUDED'
../common.mak:87: warning: undefined variable 'V'
../common.mak:95: warning: undefined variable 'W'
../common.mak:98: warning: undefined variable 'D'
../common.mak:107: warning: undefined variable 'ASAN'
../common.mak:249: warning: undefined variable 'OPT_FLAGS'
../common.mak:262: warning: undefined variable 'G'
../common.mak:280: warning: undefined variable 'C'
../common.mak:349: warning: undefined variable 'MAKECMDGOALS'
../common.mak:105: warning: undefined variable 'ENABLE_WERROR'

This has two main advantages:
1. Explicit default values
2. `make --warn` shows less false positives

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>
2023-03-17 10:56:11 +01:00
Marc Hartmayer
561559277d zkey: Makefiles: add newline at end of file
Reviewed-by: Jan Höppner <hoeppner@linux.ibm.com>
Reviewed-by: Ingo Franzki <ifranzki@linux.ibm.com>
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2023-03-17 10:56:11 +01:00
Thomas Richter
68a3ccd45e cpumf/lshwc: Update man page and remove concurrency statement
Linux kernel commits
a029a4eab39 ("s390/cpumf: Allow concurrent access for CPU Measurement Counter Facility")
453380318ed ("s390/cpumf: Allow multiple processes to access /dev/hwc")
removed this restriction. Both commits are included in linux 5.16.

Therefore remove the restriction in the man page.

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>
2023-03-17 10:56:11 +01:00
Ingo Franzki
fcfd4a6158 libseckey: Fix error checking when building ECDSA signatures
OpenSSL function i2d_ECDSA_SIG() returns a negative value in case of
an error, so check the returned length for <= zero to detect an error.

Reported-by: Holger Dengler <dengler@linux.ibm.com>
Reviewed-by: Holger Dengler <dengler@linux.ibm.com>
Signed-off-by: Ingo Franzki <ifranzki@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2023-03-17 10:56:11 +01:00
Ingo Franzki
e621d2dfa2 libseckey: Use OSSL_FUNC_keymgmt_im/export_types_ex functions
The provider functions OSSL_FUNC_keymgmt_import_types() and
OSSL_FUNC_keymgmt_export_types() do not get the provider context passed.
However, the implementation of these functions in the secure key provider
need the provider context to pass the call to the default provider
and append some of its own types to the result.

Up to now, the provider context was obtained using a global variable
holding the secure key provider handle. This may not be save if multiple
instances of the provider exist.

Just recently OpenSSL added support for an extended form of these
functions, namely OSSL_FUNC_keymgmt_import_types_ex() and
OSSL_FUNC_keymgmt_export_types_ex(), that get the provider context passed
as argument. Make use of these new functions, if compiled against an
OpenSSL version that supports them. For older OpenSSL versions still use
the global variable as before.

See OpenSSL commit 5e3b84505e

Signed-off-by: Ingo Franzki <ifranzki@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2023-03-17 10:56:11 +01:00
Fedor Loshakov
a92ee5ba8d ziomon/ziorep_config: fix for SCSI devices of type disk without block dev
If system configuration contains zfcp-attached SCSI devices of Peripheral
Device Type disk, but without block device, e.g. because the storage reports
Peripheral Qualifier 1 in INQUIRY, ziorep_config tool issue the
following type of errors during generation of .config file from .cfg
file:

$ ziorep_config -I -i test.cfg
Unpacking configuration ...Done.
Use of uninitialized value in subroutine entry at /usr/sbin/ziorep_config line 36.
Use of uninitialized value in subroutine entry at /usr/sbin/ziorep_config line 36.
Use of uninitialized value in subroutine entry at /usr/sbin/ziorep_config line 54.
Use of uninitialized value in subroutine entry at /usr/sbin/ziorep_config line 135.
...

Such errors can also be seen during printing of adapter, device and map
reports:

$ ziorep_config -ADM -i test.cfg
Unpacking configuration ...Done.
Use of uninitialized value in subroutine entry at /usr/sbin/ziorep_config line 36.
Use of uninitialized value in subroutine entry at /usr/sbin/ziorep_config line 36.
Use of uninitialized value in subroutine entry at /usr/sbin/ziorep_config line 54.
Use of uninitialized value in subroutine entry at /usr/sbin/ziorep_config line 135.
...

This is because ziorep_config reads block device parameters from
non-existent block device subdirectory. And therefore ziorep_config
leaves block device major:minor number column empty in .config file
instead of filling it with 0:0 preset value afterwards.

As a consequence, ziorep_traffic tool, which is using .config file to
get information about devices, reports the following error:

$ ziorep_traffic test
Extracting config data...done
ziorep_traffic: Could not parse line 1 - configuration file broken?

To fix this, skip reading the block device parameters for such
devices, and use the preset values that have been set before
instead.

Signed-off-by: Fedor Loshakov <loshakov@linux.ibm.com>
Suggested-by: Steffen Maier <maier@linux.ibm.com>
Reviewed-by: Benjamin Block <bblock@linux.ibm.com>
Reviewed-by: Steffen Maier <maier@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2023-03-17 10:56:11 +01:00
Fedor Loshakov
46c291835f ziomon/ziorep_config: fix missing SG major:minor for disk block devices
The value of "generic/dev" exists and can be retrieved directly under
the SCSI device directory, not under the disk block device subdirectory,
where the global variable $c_src points to after
$c_src = $devices{$hctl}{dev}; command.

So move the sg_mm retrieval before the block device parameters
retrieval.

Signed-off-by: Fedor Loshakov <loshakov@linux.ibm.com>
Suggested-by: Steffen Maier <maier@linux.ibm.com>
Reviewed-by: Benjamin Block <bblock@linux.ibm.com>
Reviewed-by: Steffen Maier <maier@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2023-03-17 10:56:11 +01:00
Benjamin Block
4941fc15c0 zfcpdbf: test-compile the script during the build using perl -c
For a slightly easier development loop add a pseudo compilation of the
zfcpdbf Perl script. This will run the Perl interpreter in syntax-check
mode:

  -c   causes Perl to check the syntax of the program and then exit
       without executing it.  Actually, it will execute any "BEGIN",
       "UNITCHECK", or "CHECK" blocks and any "use" statements: these are
       considered as occurring outside the execution of your program.
       "INIT" and "END" blocks, however, will be skipped.

Additionally add the `-w` switch when the Make variable `W` is `1`. This
will print additional warnings about dubious constructs (according to
Perl).

So this pseudo compilation only happens whenever the script is changed
during development create a file `.zfcpdbf.ct` as a result so we can
describe the relationship and dependency in Make. This file can be ignored
otherwise.

Signed-off-by: Benjamin Block <bblock@linux.ibm.com>
Reviewed-by: Steffen Maier <maier@linux.ibm.com>
Reviewed-by: Jan Höppner <hoeppner@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2023-03-17 10:56:11 +01:00
Joern Siglen
48d7c6e6d1 dbginfo.sh: rework opencryptoki data collection
changes in opencryptoki setup do require some modifications:
- "pkcsconf -mlist" does no longer work in a combined format
- config files have changed
- ep11info was not yet collected

Signed-off-by: Joern Siglen <siglen@de.ibm.com>
Reviewed-by: Ingo Franzki <ifranzki@de.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2023-03-03 09:58:40 +01:00
Steffen Maier
73c46a3056 zdev/dracut: fix kdump by only activating required devices
This prevents out-of-memory (OOM) situations in the kdump crashkernel
environment.

Please note that the new dracut module 95zdev-kdump and the new library
zdev-lib.sh need to be packaged into the same (core) (sub)package as
95zdev.

This patch introduces a new dracut module "zdev-kdump", which is used
instead of module "zdev" when building a kdump initrd:

1. Ignore all persistently configured block devices and disable zfcp auto
LUN scanning => minimize the number of SCSI devices enabled during kdump.

2. Do not rely on chzdev's persistent configuration => work with systems
that do not use chzdev for persistent device configuration.

The detection of kdump is based on strict hostonly mode and on $IN_KDUMP.
See also
https://src.fedoraproject.org/rpms/kexec-tools commit
4eedcae5e154 ("dracut-module-setup.sh: don't include multipath-hostonly")
and https://github.com/dracutdevs/dracut commits
35e86ac117ac ("Merge 90-multipath-hostonly and 90-multipath")
a695250ec7db ("Introduce tri-state hostonly mode")
and
https://src.fedoraproject.org/rpms/kexec-tools/blob/rawhide/f/mkdumprd#_17
https://src.fedoraproject.org/rpms/kexec-tools/blob/rawhide/f/dracut-module-setup.sh#_23.
The detection of kdump is also based on kdump_needed() in
https://github.com/openSUSE/kdump/blob/master/dracut/module-setup.sh.

Reviewed-by: Peter Oberparleiter <oberpar@linux.ibm.com>
Signed-off-by: Steffen Maier <maier@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2023-03-03 09:58:40 +01:00
Steffen Maier
f2c82bf2b5 zdev/dracut: fix hardcoded '/' as required mount or device
With the introduction of zdev for device configuration in v1.33.0,
it used a hardcoded "/" to refer to the root-fs.

Dracut has its own mechanism to find the root file system and to walk its
device dependencies.
Mkdumprd also has its own mechanism to interpret the kdump target
and invokes dracut so that dracut only considers arguments from mkdumprd
without any root-fs dracut would default to [--no-hostonly-default-device].

Use the dracut mechanism to walk device dependencies and individually
have chzdev treat each leaf-node in the dependency tree.
See also https://github.com/dracutdevs/dracut commit
83e0dc7a3dca ("Add for_each_host_dev_and_slaves for device only checking").
This enables the use of dracut options such as --add-device or
--mount used in turn by mkdumprd.

Reviewed-by: Peter Oberparleiter <oberpar@linux.ibm.com>
Signed-off-by: Steffen Maier <maier@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2023-03-03 09:58:20 +01:00
Steffen Eiden
d3a3b26d16 Make -Werror optional
Enforcing `-Werror` can cause problems when compiling with newer
compilers that have additional warnings on by default.

By default `-Werror` is turned off and can be turned on via
`ENABLE_WERROR=1`.

Fixes: https://github.com/ibm-s390-linux/s390-tools/issues/148
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
Reviewed-by: Jan Höppner <hoeppner@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2023-03-03 09:53:46 +01:00
Holger Dengler
c142bb0625 lszcrypt: use separate index for inner sub-device loop
The function show_devices_argv() iterates over all remaining
arguments. Each argument may specify a single device or a list of
sub-devices. Use a separate index for the inner sub-device loop. This
fixes a bug, that not all or wrong arguments are processed.

Also terminate the outer arguments loop based on the number of
remaining arguments.

Signed-off-by: Holger Dengler <dengler@linux.ibm.com>
Reviewed-by: Harald Freudenberger <freude@linux.ibm.com>
Reviewed-by: Jan Höppner <hoeppner@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2023-03-03 09:50:53 +01:00
Holger Dengler
ec04a1846e lszcrypt: use type-filter option also for sub-devices
The tools lszcrypt provides filter options for card types. Use these
options not only for devices (cards), but also for sub-devices
(domains).

Signed-off-by: Holger Dengler <dengler@linux.ibm.com>
Reviewed-by: Harald Freudenberger <freude@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2023-03-03 09:50:53 +01:00
Jan Höppner
0324fac616 Prepare for next release
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2023-02-14 14:05:17 +01:00
Jan Höppner
4014087876 New release s390-tools-2.26.0
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
v2.26.0
2023-02-14 14:05:17 +01:00
Harald Freudenberger
8a878a0d61 lszcrypt: display hardware filtering support capability
The CEX8 card has in CCA mode a new capability 'stateless
hardware filtering support' which is now displayed as
'H' bit in the FUNCTIONS column and with the -c option.

Signed-off-by: Harald Freudenberger <freude@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2023-02-14 13:03:06 +01:00
Sven Schnelle
2b511aa2b9 zipl/dump: move dump parmline processing and verification
The current code has different paths to construct the kernel parameters
depending on whether it's a dump kernel or a normal kernel. This would
require adding special handling to get_common_component(), because for
normal kernels the parmline is already set, contrary to dump kernels,
where the command line is constructed later.

To make the code simpler and fix a bug where the default command line no
longer works, move the dump command line processing to an earlier stage.
Also rename the old function to make the function name match what it is
actually doing.

Fixes: 5fb6434548 ("zipl: add get_common_components() and finalize_common_address_data()")
Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Reviewed-by: Stefan Haberland <sth@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2023-02-14 13:03:06 +01:00
Steffen Maier
6d8243d1b1 zdev: add default queue_depth value for zfcp-lun scsi_device
This avoids exporting explicit settings if it's the default anyway.
I.e. avoid the last line in the example below:

$ chzdev --export - --active --type --all
[active zfcp-lun 0.0.1941:0x500507630904d...:0x4055408f00000000]
scsi_dev/queue_depth=32

Suggested-by: Peter Oberparleiter <oberpar@linux.ibm.com>
Reviewed-by: Peter Oberparleiter <oberpar@linux.ibm.com>
Signed-off-by: Steffen Maier <maier@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2023-02-13 22:18:49 +01:00
Steffen Maier
7ecaeb1a3d zdev: add zfcp ber_stop parameter handling
Complements Linux kernel v5.4 commit 2190168aaea4 ("scsi: zfcp: fix
reaction on bit error threshold notification").

Reviewed-by: Benjamin Block <bblock@linux.ibm.com>
Reviewed-by: Peter Oberparleiter <oberpar@linux.ibm.com>
Signed-off-by: Steffen Maier <maier@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2023-02-13 22:18:49 +01:00