提交 6ed54387 编写于 作者: J Jan Glauber 提交者: Martin Schwidefsky

[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: NJan Glauber <jang@linux.vnet.ibm.com>
Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
上级 cfa1e7e1
...@@ -368,9 +368,12 @@ static inline int crypt_s390_func_available(int func, ...@@ -368,9 +368,12 @@ static inline int crypt_s390_func_available(int func,
if (facility_mask & CRYPT_S390_MSA && !test_facility(17)) if (facility_mask & CRYPT_S390_MSA && !test_facility(17))
return 0; 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; 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; return 0;
switch (func & CRYPT_S390_OP_MASK) { switch (func & CRYPT_S390_OP_MASK) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册