crypto: starfive - remove unnecessary alignmask for ahashes
The crypto API's support for alignmasks for ahash algorithms is nearly useless, as its only effect is to cause the API to align the key and result buffers. The drivers that happen to be specifying an alignmask for ahash rarely actually need it. When they do, it's easily fixable, especially considering that these buffers cannot be used for DMA. In preparation for removing alignmask support from ahash, this patch makes the starfive driver no longer use it. This driver did actually rely on it, but only for storing to the result buffer using int stores in starfive_hash_copy_hash(). This patch makes starfive_hash_copy_hash() use put_unaligned() instead. (It really should use a specific endianness, but that's an existing bug.) Signed-off-by: Eric Biggers <ebiggers@google.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
parent
2d91a839f5
commit
8c87553e2d
|
@ -209,7 +209,8 @@ static int starfive_hash_copy_hash(struct ahash_request *req)
|
|||
data = (u32 *)req->result;
|
||||
|
||||
for (count = 0; count < mlen; count++)
|
||||
data[count] = readl(ctx->cryp->base + STARFIVE_HASH_SHARDR);
|
||||
put_unaligned(readl(ctx->cryp->base + STARFIVE_HASH_SHARDR),
|
||||
&data[count]);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -628,7 +629,6 @@ static struct ahash_engine_alg algs_sha2_sm3[] = {
|
|||
CRYPTO_ALG_NEED_FALLBACK,
|
||||
.cra_blocksize = SHA224_BLOCK_SIZE,
|
||||
.cra_ctxsize = sizeof(struct starfive_cryp_ctx),
|
||||
.cra_alignmask = 3,
|
||||
.cra_module = THIS_MODULE,
|
||||
}
|
||||
},
|
||||
|
@ -658,7 +658,6 @@ static struct ahash_engine_alg algs_sha2_sm3[] = {
|
|||
CRYPTO_ALG_NEED_FALLBACK,
|
||||
.cra_blocksize = SHA224_BLOCK_SIZE,
|
||||
.cra_ctxsize = sizeof(struct starfive_cryp_ctx),
|
||||
.cra_alignmask = 3,
|
||||
.cra_module = THIS_MODULE,
|
||||
}
|
||||
},
|
||||
|
@ -687,7 +686,6 @@ static struct ahash_engine_alg algs_sha2_sm3[] = {
|
|||
CRYPTO_ALG_NEED_FALLBACK,
|
||||
.cra_blocksize = SHA256_BLOCK_SIZE,
|
||||
.cra_ctxsize = sizeof(struct starfive_cryp_ctx),
|
||||
.cra_alignmask = 3,
|
||||
.cra_module = THIS_MODULE,
|
||||
}
|
||||
},
|
||||
|
@ -717,7 +715,6 @@ static struct ahash_engine_alg algs_sha2_sm3[] = {
|
|||
CRYPTO_ALG_NEED_FALLBACK,
|
||||
.cra_blocksize = SHA256_BLOCK_SIZE,
|
||||
.cra_ctxsize = sizeof(struct starfive_cryp_ctx),
|
||||
.cra_alignmask = 3,
|
||||
.cra_module = THIS_MODULE,
|
||||
}
|
||||
},
|
||||
|
@ -746,7 +743,6 @@ static struct ahash_engine_alg algs_sha2_sm3[] = {
|
|||
CRYPTO_ALG_NEED_FALLBACK,
|
||||
.cra_blocksize = SHA384_BLOCK_SIZE,
|
||||
.cra_ctxsize = sizeof(struct starfive_cryp_ctx),
|
||||
.cra_alignmask = 3,
|
||||
.cra_module = THIS_MODULE,
|
||||
}
|
||||
},
|
||||
|
@ -776,7 +772,6 @@ static struct ahash_engine_alg algs_sha2_sm3[] = {
|
|||
CRYPTO_ALG_NEED_FALLBACK,
|
||||
.cra_blocksize = SHA384_BLOCK_SIZE,
|
||||
.cra_ctxsize = sizeof(struct starfive_cryp_ctx),
|
||||
.cra_alignmask = 3,
|
||||
.cra_module = THIS_MODULE,
|
||||
}
|
||||
},
|
||||
|
@ -805,7 +800,6 @@ static struct ahash_engine_alg algs_sha2_sm3[] = {
|
|||
CRYPTO_ALG_NEED_FALLBACK,
|
||||
.cra_blocksize = SHA512_BLOCK_SIZE,
|
||||
.cra_ctxsize = sizeof(struct starfive_cryp_ctx),
|
||||
.cra_alignmask = 3,
|
||||
.cra_module = THIS_MODULE,
|
||||
}
|
||||
},
|
||||
|
@ -835,7 +829,6 @@ static struct ahash_engine_alg algs_sha2_sm3[] = {
|
|||
CRYPTO_ALG_NEED_FALLBACK,
|
||||
.cra_blocksize = SHA512_BLOCK_SIZE,
|
||||
.cra_ctxsize = sizeof(struct starfive_cryp_ctx),
|
||||
.cra_alignmask = 3,
|
||||
.cra_module = THIS_MODULE,
|
||||
}
|
||||
},
|
||||
|
@ -864,7 +857,6 @@ static struct ahash_engine_alg algs_sha2_sm3[] = {
|
|||
CRYPTO_ALG_NEED_FALLBACK,
|
||||
.cra_blocksize = SM3_BLOCK_SIZE,
|
||||
.cra_ctxsize = sizeof(struct starfive_cryp_ctx),
|
||||
.cra_alignmask = 3,
|
||||
.cra_module = THIS_MODULE,
|
||||
}
|
||||
},
|
||||
|
@ -894,7 +886,6 @@ static struct ahash_engine_alg algs_sha2_sm3[] = {
|
|||
CRYPTO_ALG_NEED_FALLBACK,
|
||||
.cra_blocksize = SM3_BLOCK_SIZE,
|
||||
.cra_ctxsize = sizeof(struct starfive_cryp_ctx),
|
||||
.cra_alignmask = 3,
|
||||
.cra_module = THIS_MODULE,
|
||||
}
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue