]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
s390/zcrypt: hex string mask improvements for apmask and aqmask.
authorHarald Freudenberger <freude@linux.ibm.com>
Mon, 20 Aug 2018 13:27:45 +0000 (15:27 +0200)
committerThadeu Lima de Souza Cascardo <cascardo@canonical.com>
Fri, 9 Nov 2018 19:01:00 +0000 (17:01 -0200)
commitf7ea641faddba1e32433023e2eb1df83ed4bda3d
tree79a17c4638a8afca95037e074155958de24a58a7
parent3cb86ad04bd1d08e629bc98020862d64d01b3e75
s390/zcrypt: hex string mask improvements for apmask and aqmask.

BugLink: https://bugs.launchpad.net/bugs/1799184
The sysfs attributes /sys/bus/ap/apmask and /sys/bus/ap/aqmask
and the kernel command line arguments ap.apm and ap.aqm get
an improvement of the value parsing with this patch:

The mask values are bitmaps in big endian order starting with bit 0.
So adapter number 0 is the leftmost bit, mask is 0x8000... The sysfs
attributes and the kernel command line accept 2 different formats:
 - Absolute hex string starting with 0x like "0x12345678" does set
   the mask starting from left to right. If the given string is shorter
   than the mask it is padded with 0s on the right. If the string is
   longer than the mask an error comes back (EINVAL).
 - Relative format - a concatenation (done with ',') of the terms
   +<bitnr>[-<bitnr>] or -<bitnr>[-<bitnr>]. <bitnr> may be any
   valid number (hex, decimal or octal) in the range 0...255.
   Here are some examples:
     "+0-15,+32,-128,-0xFF"
     "-0-255,+1-16,+0x128"

Signed-off-by: Harald Freudenberger <freude@linux.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
(cherry picked from commit 3d8f60d38e249f989a7fca9c2370c31c3d5487e1)
Signed-off-by: Frank Heimes <frank.heimes@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/s390/crypto/ap_bus.c