Commit Graph

108 Commits

Author SHA1 Message Date
Peter Oberparleiter
cb77faeae7 chpstat: add tool to display channel-path statistics
Add a new tool named chpstat that can be used to view channel-path
statistics such as utilization and I/O throughput, and to query and
control the status of the channel-path statistics function.

Note: Channel-path statistics are only available on systems running in
      an LPAR or DPM partition.

When run without further options, data for all channel-paths is
displayed repeatedly with a 5 second delay in table format.

Example output:

      CHANNEL-PATH       UTILIZATION(%)   READ(B/s)  WRITE(B/s)
  ID TYP CMG SHR SPEED  PART TOTAL  BUS  PART TOTAL  PART TOTAL
  1d  25   2   1     -  7.16  7.50 7.50  129M  129M  0.00  161K
  21  1b   2   1   32G  0.00  0.00 0.00  0.00  0.00  0.00  0.00
  34  1b   2   1   32G  0.00  0.00 0.00  0.00  0.00  0.00  0.00
  61  25   2   1     -  0.00  0.01 0.00  0.00 2.00K  0.00  307K
  63  25   2   1     -  0.00  0.01 0.00  0.00  0.00  0.00  381K
  bd  11   2   1   10G     -     -    - 529.8 532.1 616.3 616.3

Reviewed-by: Vineeth Vijayan <vneethv@linux.ibm.com>
Signed-off-by: Peter Oberparleiter <oberpar@linux.ibm.com>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
2024-05-27 16:52:27 +02:00
Jan Höppner
6bc0b023aa dasdstat: Fix missing hyphen escapes in the man page
Hyphens are converted by groff to a different unicode character leading
to failing command execution of copy-pasted options or examples.

Ensure that all hyphens are properly escaped.

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>
2024-05-27 16:51:38 +02:00
Jan Höppner
13d673e0f7 dasdstat: Fix man page title
The man page title was incorrectly set to "LSDASD". Set the correct name
"DASDSTAT".

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>
2024-05-27 16:51:35 +02:00
Jan Höppner
c40c159173 lsdasd: Fix missing hyphen escapes in the man page
Hyphens are converted by groff to a different unicode character leading
to failing command execution of copy-pasted options or examples.

Ensure that all hyphens are properly escaped.

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>
2024-05-27 16:51:32 +02:00
Harald Freudenberger
d716c553c4 chzcrypt: Escape hyphens in man page correctly
Insert backslash(es) to escape the hyphens used
in the chzcrypt man page correctly.

Suggested-by: Jan Hoeppner <hoeppner@linux.ibm.com>
Signed-off-by: Harald Freudenberger <freude@linux.ibm.com>
Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
2024-05-27 16:50:21 +02:00
Harald Freudenberger
ab35922161 lszcrypt: Escape hyphens in man page correctly
Insert backslash(es) to escape the hyphens used
in the lszcrypt man page correctly.

Suggested-by: Jan Hoeppner <hoeppner@linux.ibm.com>
Signed-off-by: Harald Freudenberger <freude@linux.ibm.com>
Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
2024-05-27 16:50:18 +02:00
Ingo Franzki
0a01719477 zcryptstats: Fix missing hyphen escapes in man pages
Ensure that all hyphens in command options and examples are escaped properly.

Signed-off-by: Ingo Franzki <ifranzki@linux.ibm.com>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
2024-05-27 16:50:08 +02:00
Vineeth Vijayan
d888a27f07 zconf/chp: add reference to zos document
The 'lschp' command's output contains a 'type' identifier column. For
information about each value of this identifier, provide the
reference to the z/OS public documentation in the manpage.

Suggested-by: Mike Storzer <MSTORZER@de.ibm.com>
Signed-off-by: Vineeth Vijayan <vneethv@linux.ibm.com>
Reviewed-by: Peter Oberparleiter <oberpar@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2024-04-26 15:07:19 +02:00
Harald Freudenberger
8235e025d4 zcrypt/lszcrypt: Improve lszcrypt output on SE guests
The AP queue states within a SE guest may have a so called asynchronous
error pending. When that's the case, the sysfs read of some AP queue
attributes fails with EIO. lszcrypt was not really prepared for this
and instead showed some incorrect output.

This patch fixes this oddity and now lszcrypt -c shows "error" in case
of ap_bound or ap_associate read errors and lszcrypt -V shows also
"error" if the BS bits could not get fetched.

Signed-off-by: Harald Freudenberger <freude@linux.ibm.com>
Reviewed-by: Jan Höppner <hoeppner@linux.ibm.com>
Reviewed-by: Holger Dengler <dengler@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2023-09-27 18:29:06 +02:00
Harald Freudenberger
e35e73d2a3 chzcrypt: Support for SE bind, unbind and associate
This patch adds support for Secure Execution with AP pass-through
support for chzcrypt.

chzcrypt details:
* new command: --se-associate <secret-id> <queue device>
* new command: --se-bind <queue device>
* new command: --se-unbind <queue device>

Signed-off-by: Harald Freudenberger <freude@linux.ibm.com>
Reviewed-by: Holger Dengler <dengler@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2023-07-04 15:40:56 +02:00
Harald Freudenberger
f821f31a51 lszcrypt: Support for SE AP pass-through support
This patch adds support for Secure Execution with AP pass-through
support for lszcrypt.

lszcrypt details:
* extension to -b: list AP bus features
* extension to -c: now also valid for queue devices, shows
		   bind and assoicate state in SE environment;
		   shows MK states (only for current MKs).
* extension to -V: new column SESTAT within an SE guest, shows text
		   for the BS bits within an SE environment:
		   "usable", "bond", "avail", "unuse".

Signed-off-by: Harald Freudenberger <freude@linux.ibm.com>
Reviewed-by: Holger Dengler <dengler@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2023-07-04 15:40:47 +02:00
Marc Hartmayer
0c1a5069d9 Rename ARCH to HOST_ARCH
Use a common naming convention for the variable [1][2][3]. In an
upcoming patch the Makefile variable `BUILD_ARCH` will be introduced.

[1] https://www.gnu.org/software/automake/manual/html_node/Cross_002dCompilation.html
[2] https://docs.yoctoproject.org/ref-manual/variables.html#term-HOST_ARCH
[3] https://mesonbuild.com/Cross-compilation.html#cross-compilation

Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
Reviewed-by: Benjamin Block <bblock@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:53 +02: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
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
Nikolay Gueorguiev
db6eb7d554 s390-tools: Fix Makefile install step chown warnings
Since coreutils v9.1 commit 8f31074cb ("chown: warn about USER.GROUP")
chown utility now warns about using of wrong separator for USER and
GROUP options.

Closes: https://github.com/ibm-s390-linux/s390-tools/pull/145
Signed-off-by: Nikolay Gueorguiev <nikolay.gueorguiev@suse.com>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
2022-12-15 11:23:37 +01:00
Stefan Haberland
803b87e324 zconf/lsdasd: add Copy Pair output option
Add an option -P|--copy-pairs to show all DASD devices with copy
relations set up in the system and their roles.

The output looks like:

    # ./s390-tools/zconf/lsdasd -h
    [...]
            -P|--copy-pairs
	             Print information about copy pairs.

     # ./s390-tools/zconf/lsdasd -P
     Bus-ID    Role       Name      Paired devices
     ================================================================================
     0.0.9700  primary    dasdd     0.0.9740,0.0.9743,0.0.9744,0.0.9745
     0.0.9740  secondary            0.0.9700
     0.0.9701  primary    dasdf     0.0.9741
     0.0.9741  secondary            0.0.9701
     0.0.9702  primary    dasdh     0.0.9742
     0.0.9742  secondary            0.0.9702

Signed-off-by: Stefan Haberland <sth@linux.ibm.com>
Reviewed-by: Jan Hoeppner <hoeppner@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2022-11-15 10:24:42 +01:00
Stefan Haberland
5107a7be16 zconf/lsdasd: fix Copy Pair related output
Fix the default output for copy pair secondary devices to not show
a faulty blockdevice entry and major:minor combination.

The new output looks like:

    # lsdasd
    Bus-ID    Status    Name      Device  Type         BlkSz  Size      Blocks
    ================================================================================
    0.0.9740  secondary                   ECKD
    0.0.9741  secondary                   ECKD
    0.0.9742  secondary                   ECKD
    0.0.e964  active    dasda     94:0    ECKD         4096   21129MB   5409180
    0.0.e967  active    dasdb     94:4    ECKD         4096   21129MB   5409180
    0.0.9330  active    dasdc     94:8    ECKD         4096   782MB     200340
    0.0.9700  active    dasdd     94:12   ECKD         4096   782MB     200340
    0.0.9701  active    dasdf     94:20   ECKD         4096   782MB     200340
    0.0.9702  active    dasdh     94:28   ECKD         4096   782MB     200340

Also add copy_pairs to extended output:

     # lsdasd -l 9700
     0.0.9700/dasdd/94:12
       status:                               active
       type:                                 ECKD
       blksz:                                4096
       size:                                 782MB
       blocks:                               200340
       extent_size:                          1113
       logical_capacity:                     1113
       space_allocated:                      1113
       use_diag:                             0
       readonly:                             0
       eer_enabled:                          0
       erplog:                               0
       hpf:                                  1
       uid:                                  IBM.750000000ABT31.9700.00
       fc_security:                          Unsupported
       paths_installed:                      38 39 3a 3b
       paths_in_use:                         38 39 3a 3b
       paths_non_preferred:
       paths_invalid_cabling:
       paths_cuir_quiesced:
       paths_invalid_hpf_characteristics:
       paths_error_threshold_exceeded:
       copy_pairs:                           0.0.9700,0.0.9740 0.0.9700,0.0.9743 0.0.9700,0.0.9744 0.0.9700,0.0.9745

Signed-off-by: Stefan Haberland <sth@linux.ibm.com>
Reviewed-by: Jan Hoeppner <hoeppner@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2022-11-15 10:24:42 +01:00
Holger Dengler
538264a8cd lszcrypt: fix parameter handling for device list
lszcrypt allows the explicit definition of a list of devices. Continue
the parameter processing if multiple devices are specified.

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>
2022-10-22 20:27:16 +02:00
Jan Höppner
a957e3efd6 zcryptstats: Fix man page section in title line
The title line of the zcryptstats man page specifies section 1 (user
command) while the tool is a system command.
Change it to section 8 for system command.

Fixes: https://github.com/ibm-s390-linux/s390-tools/issues/135
Reviewd-by Ingo Franzki <ifranzki@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2022-06-03 18:40:36 +02:00
Frank Heimes
901f082f1a s390-tools: Fix typos that were detected by lintian as 'typo-in-manual-page'
The static analysis tool for Debian packages 'lintian', especially if called
like 'lintian -EvIL +pedantic', checks manual pages for correctness and typos.
This commit fixes typos that were identified by lintian and marked with
'typo-in-manual-page' while s390-tools version 2.20.0 was packaged.

Closes: https://github.com/ibm-s390-linux/s390-tools/pull/134
Signed-off-by: Frank Heimes <frank.heimes@canonical.com>
Acked-by: Steffen Maier maier@linux.ibm.com [ziomon]
Acked-by: Ingo Franzki ifranzki@linux.ibm.com [zkey]
[hoeppner@linux.ibm.com: fix commit message]
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2022-06-03 18:40:36 +02:00
Juergen Christ
0012eaf68e zcryptctl: Fix some typos
Fix typos in usage and error messages.

Signed-off-by: Juergen Christ <jchrist@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2022-03-18 14:41:21 +01:00
Juergen Christ
c22d282e67 zcryptctl: Add control domain handling
Support control domain handling for custom zcrypt device nodes.

Signed-off-by: Juergen Christ <jchrist@linux.ibm.com>
Reviewed-by: Harald Freudenberger <freude@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2022-03-18 14:41:21 +01:00
Harald Freudenberger
46fd42af0c lszcrypt: new option to show the serial numbers of CCA and EP11 cards
The new option -s, long --serial shows the serial numbers of
CCA and EP11 cards.

Signed-off-by: Harald Freudenberger <freude@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2022-03-09 12:11:49 +01:00
Harald Freudenberger
a8b0d7ace8 lszcrypt: new options to filter cards/queues only
New options:
  --cardonly
  --queueonly
which filter the output to show only card or queue information.

Signed-off-by: Harald Freudenberger <freude@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2022-03-09 12:11:49 +01:00
Harald Freudenberger
a29b3c8997 lszcrypt: new options to show only accel, cca or ep11 cards/queues
New options:
  --accelonly
  --ccaonly
  --ep11only
which restrict the output to only cards/queues with the given mode.

Signed-off-by: Harald Freudenberger <freude@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2022-03-09 12:11:49 +01:00
Harald Freudenberger
27dce3317a lszcrypt: add support for checkstop state
Newer kernel show a sysfs attribute chkstop which displays
the checkstop state of a crypto card. This patch enables
support for lszcrypt to display the checkstop state.

Signed-off-by: Harald Freudenberger <freude@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2022-03-09 12:11:49 +01:00
Harald Freudenberger
4382901daa lszcrypt: show AP bus msg size limit capability
If there is a max_msg_size attribute for the card
the lszcrypt -c option will show this limit as
  AP bus max message size limit xx Kb

Signed-off-by: Harald Freudenberger <freude@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2022-03-09 12:11:45 +01:00
Harald Freudenberger
bcbb6fcae6 zcryptstats: add CEX8 support
Add the CEX8 crypto card to the list of known crypto cards.

Signed-off-by: Harald Freudenberger <freude@linux.ibm.com>
Reviewed-by: Ingo Franzki <ifranzki@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2022-03-09 12:11:45 +01:00
Harald Freudenberger
b16a6d4fe1 lszcrypt: add CEX8S support
Recognize AP type 14 as CEX8S crypto express card.

Signed-off-by: Harald Freudenberger <freude@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2022-03-09 12:11:42 +01:00
Vineeth Vijayan
761a185938 zconf/lscss: show device number from pmcw
lscss shows device number as 'None' if the corresponding device in the
subchannel is non-operational or not connected. Instead, show the
device-no derived from the new dev_busid attribute which provides the
value of device_id irrespective of the device availability.

i.e the current lscss shows

Device   Subchan.  DevType CU Type Use  PIM PAM POM  CHPIDs
----------------------------------------------------------------------
0.0.0000 0.0.0000  3390/0c 3990/e9      f0  a0  ff   32333435 00000000
none     0.0.00c7                       f0  a0  5f   32333435 00000000
none     0.0.00c8                       f0  a0  5f   32333435 00000000

here the subchannels 0.0.00c7 and 0.0.00c8 do not have an operational
device on them. Hence the device is shown as none.

With this patch,

Device   Subchan.  DevType CU Type Use  PIM PAM POM  CHPIDs
----------------------------------------------------------------------
0.0.0000 0.0.0000  3390/0c 3990/e9      f0  a0  ff   32333435 00000000
0.0.74c8 0.0.00c7                       f0  a0  5f   32333435 00000000
0.0.74c9 0.0.00c8                       f0  a0  5f   32333435 00000000

The device-no is shown as 0.0.74c8; Where the DevType field still
indicates that the device is not present.

Signed-off-by: Vineeth Vijayan <vneethv@linux.ibm.com>
Reviewed-by: Peter Oberparleiter <oberpar@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2021-09-30 17:20:52 +02:00
Harald Freudenberger
890b15d158 lszcrypt: add support for vfio-ap status field
lszcrypt now evaluates and displays the 'status' in the
'STATUS' column if the vfio provides this sysfs attribute.

Signed-off-by: Harald Freudenberger <freude@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2021-09-30 17:20:52 +02:00
Harald Freudenberger
07677668a3 lszcrypt: online is status and now tracked as status
The 'STATUS' field was within the code used as 'online'
record because it showed the online state. But now it
displays some more info like 'deconfig' and maybe even
more in the future. So now the code also uses a 'status'
record for this info.

Signed-off-by: Harald Freudenberger <freude@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2021-09-30 17:20:52 +02:00
Harald Freudenberger
fde914fd1c lszcrypt: Improved output for deconfig cards and queues
Slight rework of the lszcrypt code with:
- a queue or card in deconfigured mode is displayed
  as 'deconfig' regardless which driver is bound to
  the device.
- a queue or card in 'deconfig' mode does not show
  any counters any more but displays a '-' instead.
- a queue not bound or bound to something else as
  the 'default' zcrypt dd does not show any counters
  but displays a '-' instead.

Signed-off-by: Harald Freudenberger <freude@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2021-09-30 17:20:52 +02:00
Steffen Maier
45e3f016f4 lszfcp: add linkdown case to host marker of extended output
Complements v2.9.0 commit 4036e80b26 ("lszfcp: add new output marker
for non-good FCP devices (hosts)").

Otherwise "linkdown" shows as "failed" because linkdown happens to be
the one special case that also sets the failed status flag of the
FCP device (host). Linkdown is kind of benign compared to other cases
where the FCP device is in failed status.

Examples:
$ lszfcp -He
0.0.194a host3 linkdown

$ lszfcp -HeV
/sys/devices/css0/0.0.0004/0.0.194a linkdown
/sys/class/fc_host/host3
/sys/class/scsi_host/host3

Signed-off-by: Steffen Maier <maier@linux.ibm.com>
Reviewed-by: Benjamin Block <bblock@linux.ibm.com>
Reviewed-by: Fedor Loshakov <loshakov@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2021-09-30 16:55:02 +02:00
Ingo Franzki
3e818c53b2 zconf/zcrypt: Fix sparse warnings
A compile with sparse (make C=1) shows a couple of warnings:
like:

  chzcrypt.c:36:3: warning: symbol 'l' was not declared.
  Should it be static?

  lszcrypt.c: In function 'show_device':
  lszcrypt.c:556:9: warning: 'card' may be used uninitialized
  [-Wmaybe-uninitialized]

Fix those warnings.

Signed-off-by: Ingo Franzki <ifranzki@linux.ibm.com>
Reviewed-by: Jan Hoeppner <hoeppner@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2021-07-05 13:55:54 +02:00
Wenjia Zhang
4fb18a1e7b znetconf: avoid conflict with "chzdev -e"
Using "chzdev -e" to configurate a device persistently, the
corresponding udev rule is also created, which will trigger a uevent
that sets the device online as soon as the group device is created.

If 'znetconf -r/R' is first used to remove such a configured device
(which won't remove the corresponding udev rule) and then
'znetconf -a/A' afterwards on the same device, either the error
"Failed to make <device> online" or "Failed to configure layer2=1"
will occur.

For the first error, the udev queue might not have been fully processed
and hence the check whether a device is online may fail due to that
race. Call 'udevadm settle' to ensure a fully processed queue before
checking whether a device is online.

The second error occurs, because configure_ccwgroupdev_option() does
not check whether the device is online. Add the check and set the
device offline if necessary. Also, log any details for debugging
purposes.

Signed-off-by: Wenjia Zhang <wenjia@linux.ibm.com>
Reviewed-by: Alexandra Winter <wintera@linux.ibm.com>
Reviewed-by: Jan Hoeppner <hoeppner@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2021-05-20 18:49:44 +02:00
Jan Höppner
d619b492e9 lsdasd: Add FC Endpoint Security information
Provide the status of the FC Endpoint Security information via the long
output of lsdasd for online Base and Alias devices.

New Output:

$ lsdasd -l c600
0.0.c600/dasdd/9412
  status:                               n/f
  type:                                 ECKD
  blksz:                                512
  size:
  blocks:
  extent_size:                          1113
  logical_capacity:                     1113
  space_allocated:                      1113
  use_diag:                             0
  readonly:                             0
  eer_enabled:                          0
  erplog:                               0
  hpf:                                  1
  uid:                                  IBM.750000000KMV11.c600.00
  fc_security:                          Encryption
  paths_installed:                      38 39 3a 3b
  paths_in_use:                         38 39 3a 3b
  paths_non_preferred:
  paths_invalid_cabling:
  paths_cuir_quiesced:
  paths_invalid_hpf_characteristics:
  paths_error_threshold_exceeded:

Reviewed-by: Stefan Haberland <sth@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2020-11-12 10:50:48 +01:00
Ingo Franzki
cf2311f1f1 zcryptstats: Fix handling of partial results with many domains
When many domains per card are available, then the results of the SCDMD
CHSC call may not fit into the output area, and a partial result is
returned. The further results must be retrieved with another CHSC call.

Fix the code to pass the correct next-domain to the subsequent CHSC call
of a partial response. Otherwise the same set of domains 1 to n are
retrieved again, resulting in an infinite loop, because this will always
produce a partial result.

Signed-off-by: Ingo Franzki <ifranzki@linux.ibm.com>
Reviewed-by: Harald Freudenberger <freude@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2020-11-12 08:06:11 +01:00
Harald Freudenberger
6eddae9a8a zcrypt: Support new config state with lszcrypt and chzcrypt
lszcrypt now shows a card/queue which is in 'deconfigured' state as
'deconfig' in the STATE column (verbose and non verbose mode).

chzcrypt became two new options: --config-on and --config-off to
switch one or more card devices to 'configured' or 'deconfigured'
state.

Both applications are able to handle older kernels which do now
provide the config sysfs attribute required for this new feature.

Signed-off-by: Harald Freudenberger <freude@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2020-10-12 13:12:55 +02:00
Guevenc Guelce
1003d81412 znetconf: introduce better ways to locate udevadm
When udevadm is going to be used, try to locate it
in $PATH and if it fails, try to locate it in well-known
binary paths.

Signed-off-by: Guevenc Guelce <guvenc@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2020-07-17 17:55:39 +02:00
Julian Wiedmann
e679a4002e lsluns: try harder to find udevadm
Hard-coding udevadm's location isn't robust enough - for instance,
Ubuntu 20.04 moved it to /usr/bin.

First see if we can reach it through $PATH, then fall back to hard-coded
locations that we know about.
Also when finally falling back to udevsettle, check that it exists.
Otherwise we end up throwing tons of "No such file or directory" error
messages at the user.

Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com>
Reviewed-by: Steffen Maier <maier@linux.ibm.com>
Reviewed-by: Fedor Loshakov <loshakov@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2020-05-29 15:18:31 +02:00
Marc Hartmayer
67aef9bbf3 Consolidate ALIGN, __ALIGN_MASK, ARRAY_SIZE macros
Consolidate `ALIGN, __ALIGN_MASK, ARRAY_SIZE` macros and add them to
lib/zt_common.h. While at it, adapt coding style.

Reviewed-by: Philipp Rudo <prudo@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>
2020-03-16 13:39:10 +01:00
Ingo Franzki
e15e8a1bfa zcryptstats: Add support for CEX7
Add the CEX7 crypto card to the list of known crypto cards.

Signed-off-by: Ingo Franzki <ifranzki@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2019-09-18 12:55:17 +02:00
Harald Freudenberger
4fc0c3cfef zcrypt: CEX7S exploitation support
This patch adds CEX7S exploitation support to lszcrypt and chzcrypt.

Signed-off-by: Harald Freudenberger <freude@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2019-09-18 12:55:17 +02:00
Jan Höppner
15b7f9d83f lsdasd: Add support for thin-provisioned volumes
Make lsdasd aware of thinly provisioned (Extent Space Efficient (ESE))
DASD volumes.

The ESE information is added to the discipline output and the extended
output additionally lists information about logical capacity, allocated
space, and the extent size.

Output before:

Bus-ID     Status      Name      Device  Type  BlkSz  Size      Blocks
==============================================================================
0.0.95e0   alias                         ECKD
0.0.7eb4   active      dasda     94:0    ECKD  4096   7043MB    1803060
0.0.7eb7   active      dasdb     94:4    ECKD  4096   7043MB    1803060
0.0.95d0   active      dasdc     94:8    ECKD  4096   42259MB   10818360
0.0.95d1   n/f         dasdd     94:12   ECKD
0.0.95d4   n/f         dasde     94:16   ECKD
0.0.95d5   active      dasdh     94:28   ECKD  4096   831097MB  212761080

Output after:

Bus-ID    Status    Name      Device  Type         BlkSz  Size      Blocks
================================================================================
0.0.95e0  alias                       ECKD
0.0.7eb4  active    dasda     94:0    ECKD         4096   7043MB    1803060
0.0.7eb7  active    dasdb     94:4    ECKD         4096   7043MB    1803060
0.0.95d0  active    dasdc     94:8    ECKD (ESE)   4096   42259MB   10818360
0.0.95d1  n/f       dasdd     94:12   ECKD (ESE)
0.0.95d4  n/f       dasde     94:16   ECKD (ESE)
0.0.95d5  active    dasdh     94:28   ECKD (ESE)   4096   831097MB  212761080

Extended output before:

0.0.95d0/dasdc/94:8
  status:                               active
  type:                                 ECKD
  blksz:                                4096
  size:                                 42259MB
  blocks:                               10818360
  use_diag:                             0
  readonly:                             0
  eer_enabled:                          0
  erplog:                               0
  hpf:                                  1
  uid:                                  IBM.750000000ABT31.9500.d0
  paths_installed:                      38 39 3a 3b
  paths_in_use:                         38 39 3a 3b
  paths_non_preferred:
  paths_invalid_cabling:
  paths_cuir_quiesced:
  paths_invalid_hpf_characteristics:
  paths_error_threshold_exceeded:

Extended output after:

0.0.95d0/dasdc/94:8
  status:                               active
  type:                                 ECKD (ESE)
  blksz:                                4096
  size:                                 42259MB
  blocks:                               10818360
  extent_size:                          1113
  logical_capacity:                     60102
  space_allocated:                      18921
  use_diag:                             0
  readonly:                             0
  eer_enabled:                          0
  erplog:                               0
  hpf:                                  1
  uid:                                  IBM.750000000ABT31.9500.d0
  paths_installed:                      38 39 3a 3b
  paths_in_use:                         38 39 3a 3b
  paths_non_preferred:
  paths_invalid_cabling:
  paths_cuir_quiesced:
  paths_invalid_hpf_characteristics:
  paths_error_threshold_exceeded:

Reviewed-by: Stefan Haberland <sth@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2019-08-08 15:27:21 +02:00
Ingo Franzki
784ac7d190 zcryptstats: Add note about loading kernel module chsc_sch
Dependent on kernel config option CHSC_SCH the device node /dev/chsc may
exist per default or not. In case the kernel is built with CHSC_SCH=M,
then the device driver is built as separate kernel module, and must
therefore be loaded using modprobe chsc_sch to make device node /dev/chsc
available.

Signed-off-by: Ingo Franzki <ifranzki@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2019-07-31 15:59:50 +02:00
Karsten Graul
58e2135d87 znetconf: show help and version without ccwgroup driver loaded
When directory $SYSFSDIR/bus/ccwgroup does not exist znetconf issues an
error message and terminates. Its not even possible to get the output of
--help or --version. Fix that by moving the responsible check behind the
parameter evaluation.

Signed-off-by: Karsten Graul <kgraul@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2019-07-09 16:24:17 +02:00
Jens Remus
91509973fe zdev: Do not pass user input as format string
The function util_path_exists() consumes its first parameter as format
string. Passing the user input specified to the chzdev option --export
as-is to the function opens up the possibility for a format string
injection.

Fixes: d542138868 ("zdev: use libutil provided path functions")
Signed-off-by: Jens Remus <jremus@linux.ibm.com>
Reviewed-by: Peter Oberparleiter <oberpar@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2019-07-09 16:24:17 +02:00
Jens Remus
39520546c5 chcp: Use macro S_ISDIR() to test type of file
Testing whether a file is a directory by comparing the struct stat
field st_mode against S_IFDIR is wrong. If st_mode has any access
permission bits set along with the file type code the test will always
fail.

The file type encoded in the struct stat field st_mode is actually an
enumeration. To test whether a file is a directory either extract the
file type from st_mode using the mask S_IFMT and compare it against
S_IFDIR or simply use the macro S_ISDIR().

Fixes: b627b8d8e1 ("Initial s390-tools-2.0.0 import")
Signed-off-by: Jens Remus <jremus@linux.ibm.com>
Reviewed-by: Peter Oberparleiter <oberpar@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2019-07-09 16:24:17 +02:00