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>
This commit is contained in:
Harald Freudenberger
2021-08-12 11:53:59 +02:00
committed by Jan Höppner
parent 07677668a3
commit 890b15d158
2 changed files with 20 additions and 3 deletions

View File

@@ -117,7 +117,7 @@ of the columns show up in verbose mode only.
.TP
.B CARD.DOM
The crypto card number in hexadecimal for a crypto card line or
the crypto card number and the domain id both in hex seperated by a single
the crypto card number and the domain id both in hex separated by a single
dot for a queue line.
.TP
.B TYPE and HWTYPE
@@ -150,9 +150,16 @@ may be adjusted on the HMC or SE. The chzcrypt application can also
trigger this state with the --config-on and --config-off options.
.br
lszcrypt shows 'online' when a card or queue is available for
cryptograhic operations. 'offline' is displayed when a card or queue
cryptographic operations. 'offline' is displayed when a card or queue
is switched to (software) offline. If a card is 'deconfigured' via
HMC, SE or chzcrypt the field shows 'deconfig'.
.br
If a queue is not bound to a device driver there is no detailed
information available and thus the status shows only '-'.
.br
If a queue is bound to the vfio-ap device driver it is up to this driver
to give some status information and what exactly this means. So lszcrypt
shows the text retrieved from the underlying sysfs attribute here.
.TP
.B REQUESTS
This is the counter value of successful processed requests on card or queue
@@ -173,7 +180,7 @@ S - APSC available: card/queue can handle requests with the special bit
enabled.
.br
M - Accelerator card/queue with support for RSA ME with up to 4k key size.
.br
.Sr
C - Accelerator card/queue with support for RSA CRT with up to 4k key size.
.br
D - Card/queue is providing CCA functions (this is the CCA Coprocessor mode).

View File

@@ -397,6 +397,16 @@ static void read_subdev_rec_default(struct util_rec *rec, const char *grp_dev,
util_rec_set(rec, "status", "online");
else if (online == 0)
util_rec_set(rec, "status", "offline");
else {
/* no online attribute, maybe use status attribute */
if (util_path_is_readable("%s/%s/status",
grp_dev, sub_dev)) {
util_file_read_line(buf, sizeof(buf),
"%s/%s/status",
grp_dev, sub_dev);
util_rec_set(rec, "status", buf);
}
}
}
util_file_read_ul(&facility, 16, "%s/ap_functions", grp_dev);