Re: [PATCH v1 01/20] s390/ap: Move response_type struct into ap_msg struct

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 24/02/2025 16:23, Holger Dengler wrote:
> On 23/02/2025 10:54, Harald Freudenberger wrote:
>> Move the very small response_type struct into struct ap_msg.
>> So there is no need to kmalloc this tiny struct with each
>> ap message preparation.
> 
> I understand the intention for this patch, but in my opinion the layering concept between ap and zcrypt is violated by defining the response-type as part of the ap message struct. But I don't have any better solution, so for the moment you may leave it as is.
> 
>>
>> Signed-off-by: Harald Freudenberger <freude@xxxxxxxxxxxxx>
>> ---
>>  drivers/s390/crypto/ap_bus.h           |  12 ++-
>>  drivers/s390/crypto/zcrypt_msgtype50.c |  22 +++---
>>  drivers/s390/crypto/zcrypt_msgtype6.c  | 101 ++++++++++---------------
>>  3 files changed, 59 insertions(+), 76 deletions(-)
>>
[...]
>> diff --git a/drivers/s390/crypto/zcrypt_msgtype6.c b/drivers/s390/crypto/zcrypt_msgtype6.c
>> index b64c9d9fc613..21ee311cf33d 100644
>> --- a/drivers/s390/crypto/zcrypt_msgtype6.c
>> +++ b/drivers/s390/crypto/zcrypt_msgtype6.c
>> @@ -1061,28 +1046,26 @@ static long zcrypt_msgtype6_modexpo_crt(struct zcrypt_queue *zq,
>>   * Prepare a CCA AP msg: fetch the required data from userspace,
>>   * prepare the AP msg, fill some info into the ap_message struct,
>>   * extract some data from the CPRB and give back to the caller.
>> - * This function allocates memory and needs an ap_msg prepared
>> - * by the caller with ap_init_message(). Also the caller has to
>> - * make sure ap_release_message() is always called even on failure.
>> + * This function may allocate memory if the ap_msg msg buffer is
>> + * not preallocated and needs an ap_msg prepared by the caller
>> + * with ap_init_message(). Also the caller has to make sure
>> + * ap_release_message() is always called even on failure.
> 
> Please move this change to the patch, which makes the allocation optional.

This change will be reverted by the next patch in the series, so please dropt it here and make only the change in the next patch.

[...]
>> @@ -1158,28 +1141,26 @@ static long zcrypt_msgtype6_send_cprb(bool userspace, struct zcrypt_queue *zq,
>>   * Prepare an EP11 AP msg: fetch the required data from userspace,
>>   * prepare the AP msg, fill some info into the ap_message struct,
>>   * extract some data from the CPRB and give back to the caller.
>> - * This function allocates memory and needs an ap_msg prepared
>> - * by the caller with ap_init_message(). Also the caller has to
>> - * make sure ap_release_message() is always called even on failure.
>> + * This function may allocate memory if the ap_msg msg buffer is
>> + * not preallocated and needs an ap_msg prepared by the caller
>> + * with ap_init_message(). Also the caller has to make sure
>> + * ap_release_message() is always called even on failure.
> 
> Please move this change to the patch, which makes the allocation optional.

Same here.

-- 
Mit freundlichen Grüßen / Kind regards
Holger Dengler
--
IBM Systems, Linux on IBM Z Development
dengler@xxxxxxxxxxxxx





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Kernel Development]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Info]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Linux Media]     [Device Mapper]

  Powered by Linux