Skip to content

Commit

Permalink
[S390] crypto: avoid MSA3 and MSA4 instructions in ESA mode
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Martin Schwidefsky <[email protected]>
  • Loading branch information
Jan Glauber authored and Martin Schwidefsky committed Nov 14, 2011
1 parent cfa1e7e commit 6ed5438
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions arch/s390/crypto/crypt_s390.h
Original file line number Diff line number Diff line change
Expand Up @@ -368,9 +368,12 @@ static inline int crypt_s390_func_available(int func,

if (facility_mask & CRYPT_S390_MSA && !test_facility(17))
return 0;
if (facility_mask & CRYPT_S390_MSA3 && !test_facility(76))

if (facility_mask & CRYPT_S390_MSA3 &&
(!test_facility(2) || !test_facility(76)))
return 0;
if (facility_mask & CRYPT_S390_MSA4 && !test_facility(77))
if (facility_mask & CRYPT_S390_MSA4 &&
(!test_facility(2) || !test_facility(77)))
return 0;

switch (func & CRYPT_S390_OP_MASK) {
Expand Down

0 comments on commit 6ed5438

Please sign in to comment.