Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

s390/zcrypt: support for extended number of ap domains

Extends the number of ap domains within the zcrypt device driver up to 256.
AP domains in the range 00..255 will be detected.

Signed-off-by: Ingo Tuchscherer <ingo.tuchscherer@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>

authored by

Ingo Tuchscherer and committed by
Martin Schwidefsky
170387a8 44230282

+15 -5
+12 -2
drivers/s390/crypto/ap_bus.c
··· 1188 1188 ap_qid_t qid; 1189 1189 int rc, i, j; 1190 1190 1191 + /* IF APXA isn't installed, only 16 domains could be defined */ 1192 + if (!ap_configuration->ap_extended && (ap_domain_index > 15)) 1193 + return -EINVAL; 1194 + 1191 1195 /* 1192 1196 * We want to use a single domain. Either the one specified with 1193 1197 * the "domain=" parameter or the domain with the maximum number ··· 1904 1900 { 1905 1901 int i, j; 1906 1902 1907 - for (i = 0; i < AP_DOMAINS; i++) 1908 - for (j = 0; j < AP_DEVICES; j++) 1903 + for (i = 0; i < AP_DOMAINS; i++) { 1904 + if (!ap_test_config_domain(i)) 1905 + continue; 1906 + for (j = 0; j < AP_DEVICES; j++) { 1907 + if (!ap_test_config_card_id(j)) 1908 + continue; 1909 1909 ap_reset_queue(AP_MKQID(j, i)); 1910 + } 1911 + } 1910 1912 } 1911 1913 1912 1914 static struct reset_call ap_reset_call = {
+3 -3
drivers/s390/crypto/ap_bus.h
··· 31 31 #include <linux/types.h> 32 32 33 33 #define AP_DEVICES 64 /* Number of AP devices. */ 34 - #define AP_DOMAINS 16 /* Number of AP domains. */ 34 + #define AP_DOMAINS 256 /* Number of AP domains. */ 35 35 #define AP_MAX_RESET 90 /* Maximum number of resets. */ 36 36 #define AP_RESET_TIMEOUT (HZ*0.7) /* Time in ticks for reset timeouts. */ 37 37 #define AP_CONFIG_TIME 30 /* Time in seconds between AP bus rescans. */ ··· 45 45 */ 46 46 typedef unsigned int ap_qid_t; 47 47 48 - #define AP_MKQID(_device,_queue) (((_device) & 63) << 8 | ((_queue) & 15)) 48 + #define AP_MKQID(_device, _queue) (((_device) & 63) << 8 | ((_queue) & 255)) 49 49 #define AP_QID_DEVICE(_qid) (((_qid) >> 8) & 63) 50 - #define AP_QID_QUEUE(_qid) ((_qid) & 15) 50 + #define AP_QID_QUEUE(_qid) ((_qid) & 255) 51 51 52 52 /** 53 53 * structy ap_queue_status - Holds the AP queue status.