Skip to content

Commit 8f9aca0

Browse files
hfreudeMartin Schwidefsky
authored andcommitted
s390/zcrypt: fix specification exception on z196 during ap probe
The older machines don't have the QCI instruction available. With support for up to 256 crypto cards the probing of each card has been extended to check card ids from 0 up to 255. For machines with QCI support there is a filter limiting the range of probed cards. The older machines (z196 and older) don't have this filter and so since support for 256 cards is in the driver all cards are probed. However, these machines also require to have the card id fit into 6 bits. Exceeding this limit results in a specification exception which happens on every kernel startup even when there is no crypto configured and used at all. This fix limits the range of probed crypto cards to 64 if there is no QCI instruction available to obey to the older ap architecture and so fixes the specification exceptions on z196 machines. Cc: stable@vger.kernel.org # v4.17+ Fixes: af4a722 ("s390/zcrypt: Support up to 256 crypto adapters.") Signed-off-by: Harald Freudenberger <freude@linux.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
1 parent 4a8ef69 commit 8f9aca0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/s390/crypto/ap_bus.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,8 @@ static inline int ap_test_config(unsigned int *field, unsigned int nr)
248248
static inline int ap_test_config_card_id(unsigned int id)
249249
{
250250
if (!ap_configuration) /* QCI not supported */
251-
return 1;
251+
/* only ids 0...3F may be probed */
252+
return id < 0x40 ? 1 : 0;
252253
return ap_test_config(ap_configuration->apm, id);
253254
}
254255

0 commit comments

Comments
 (0)