aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/crypto
diff options
context:
space:
mode:
authorJan Glauber <jang@linux.vnet.ibm.com>2011-11-14 05:19:07 -0500
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2011-11-14 05:19:09 -0500
commit6ed54387dc470fc439cb154724a1ac81d251c126 (patch)
tree52c5c3bb66f38eae5cba19109cd5657d9526f4ea /arch/s390/crypto
parentcfa1e7e1d49c6f5f0b00b2cb890b521e5c0dc7ea (diff)
[S390] crypto: avoid MSA3 and MSA4 instructions in ESA mode
MSA3 and MSA4 instructions are only available under CONFIG_64BIT. Bail out before using any of these instructions if the kernel is running in 31 bit mode. Signed-off-by: Jan Glauber <jang@linux.vnet.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/crypto')
-rw-r--r--arch/s390/crypto/crypt_s390.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/arch/s390/crypto/crypt_s390.h b/arch/s390/crypto/crypt_s390.h
index 49676771bd66..ffd1ac255f19 100644
--- a/arch/s390/crypto/crypt_s390.h
+++ b/arch/s390/crypto/crypt_s390.h
@@ -368,9 +368,12 @@ static inline int crypt_s390_func_available(int func,
368 368
369 if (facility_mask & CRYPT_S390_MSA && !test_facility(17)) 369 if (facility_mask & CRYPT_S390_MSA && !test_facility(17))
370 return 0; 370 return 0;
371 if (facility_mask & CRYPT_S390_MSA3 && !test_facility(76)) 371
372 if (facility_mask & CRYPT_S390_MSA3 &&
373 (!test_facility(2) || !test_facility(76)))
372 return 0; 374 return 0;
373 if (facility_mask & CRYPT_S390_MSA4 && !test_facility(77)) 375 if (facility_mask & CRYPT_S390_MSA4 &&
376 (!test_facility(2) || !test_facility(77)))
374 return 0; 377 return 0;
375 378
376 switch (func & CRYPT_S390_OP_MASK) { 379 switch (func & CRYPT_S390_OP_MASK) {