path: root/arch/s390/crypto/prng.c
diff options
authorMartin Schwidefsky <>2016-08-18 12:59:46 +0200
committerMartin Schwidefsky <>2016-08-29 11:05:09 +0200
commit69c0e360f990c2dc737681f40a361195066cef02 (patch)
treee5e5ff1ff6f09e21b28752b948283589803d81eb /arch/s390/crypto/prng.c
parentd863d5945f2be0abfcd9d36b1a7c605f3eaef517 (diff)
s390/crypto: cpacf function detection
The CPACF code makes some assumptions about the availablity of hardware support. E.g. if the machine supports KM(AES-256) without chaining it is assumed that KMC(AES-256) with chaining is available as well. For the existing CPUs this is true but the architecturally correct way is to check each CPACF functions on its own. This is what the query function of each instructions is all about. Reviewed-by: Harald Freudenberger <> Signed-off-by: Martin Schwidefsky <>
Diffstat (limited to 'arch/s390/crypto/prng.c')
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/s390/crypto/prng.c b/arch/s390/crypto/prng.c
index bbf2af74c549..79e3a1f6313a 100644
--- a/arch/s390/crypto/prng.c
+++ b/arch/s390/crypto/prng.c
@@ -757,13 +757,13 @@ static int __init prng_init(void)
int ret;
/* check if the CPU has a PRNG */
- if (!cpacf_query(CPACF_KMC, CPACF_KMC_PRNG))
+ if (!cpacf_query_func(CPACF_KMC, CPACF_KMC_PRNG))
/* choose prng mode */
if (prng_mode != PRNG_MODE_TDES) {
/* check for MSA5 support for PPNO operations */
- if (!cpacf_query(CPACF_PPNO, CPACF_PPNO_SHA512_DRNG_GEN)) {
+ if (!cpacf_query_func(CPACF_PPNO, CPACF_PPNO_SHA512_DRNG_GEN)) {
if (prng_mode == PRNG_MODE_SHA512) {
pr_err("The prng module cannot "
"start in SHA-512 mode\n");