diff options
author | Harald Freudenberger <freude@linux.ibm.com> | 2025-04-24 15:36:07 +0200 |
---|---|---|
committer | Heiko Carstens <hca@linux.ibm.com> | 2025-04-30 11:34:01 +0200 |
commit | 95de56ae0db0fb039f3ae3ddfa1a281508fcef4f (patch) | |
tree | 7850424ee22c53344a378abb287d48874b42e25a /drivers/s390/crypto/zcrypt_ccamisc.h | |
parent | 2845ad7466af7d2ee218ddbe2896c7c5532b9f73 (diff) |
s390/zcrypt: Rework cca findcard() implementation and callers
Rework the memory usage of the cca findcard() implementation:
- findcard does not allocate memory for the list of apqns
any more.
- the callers are now responsible to provide an array of
apqns to store the matching apqns into.
Signed-off-by: Harald Freudenberger <freude@linux.ibm.com>
Reviewed-by: Holger Dengler <dengler@linux.ibm.com>
Link: https://lore.kernel.org/r/20250424133619.16495-14-freude@linux.ibm.com
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Diffstat (limited to 'drivers/s390/crypto/zcrypt_ccamisc.h')
-rw-r--r-- | drivers/s390/crypto/zcrypt_ccamisc.h | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/s390/crypto/zcrypt_ccamisc.h b/drivers/s390/crypto/zcrypt_ccamisc.h index cc7d362a2bad..ca41a675dd3b 100644 --- a/drivers/s390/crypto/zcrypt_ccamisc.h +++ b/drivers/s390/crypto/zcrypt_ccamisc.h @@ -217,14 +217,12 @@ int cca_query_crypto_facility(u16 cardnr, u16 domain, * - if old_mkvp != 0 only apqns where old_mkvp == mkvp * The mktype determines which set of master keys to use: * 0 = AES_MK_SET - AES MK set, 1 = APKA MK_SET - APKA MK set - * The array of apqn entries is allocated with kmalloc and returned in *apqns; - * the number of apqns stored into the list is returned in *nr_apqns. One apqn - * entry is simple a 32 bit value with 16 bit cardnr and 16 bit domain nr and - * may be casted to struct pkey_apqn. The return value is either 0 for success - * or a negative errno value. If no apqn meeting the criteria is found, - * -ENODEV is returned. + * The caller should set *nr_apqns to the nr of elements available in *apqns. + * On return *nr_apqns is then updated with the nr of apqns filled into *apqns. + * The return value is either 0 for success or a negative errno value. + * If no apqn meeting the criteria is found, -ENODEV is returned. */ -int cca_findcard2(u32 **apqns, u32 *nr_apqns, u16 cardnr, u16 domain, +int cca_findcard2(u32 *apqns, u32 *nr_apqns, u16 cardnr, u16 domain, int minhwtype, int mktype, u64 cur_mkvp, u64 old_mkvp); #define AES_MK_SET 0 |