[PATCH v5 5/6] of: kexec: Refactor IMA buffer related functions to make them reusable

Stefan Berger stefanb at linux.ibm.com
Thu Jul 7 09:10:31 PDT 2022



On 7/7/22 10:47, Jonathan McDowell wrote:
> On Wed, Jul 06, 2022 at 11:23:28AM -0400, Stefan Berger wrote:
>> Refactor IMA buffer related functions to make them reusable for carrying
>> TPM logs across kexec.
>>
>> Signed-off-by: Stefan Berger <stefanb at linux.ibm.com>
>> Cc: Rob Herring <robh+dt at kernel.org>
>> Cc: Frank Rowand <frowand.list at gmail.com>
>> Cc: Mimi Zohar <zohar at linux.ibm.com>
>>
>> ---
>> v5:
>>   - Rebased on Jonathan McDowell's commit "b69a2afd5afc x86/kexec: Carry
>>     forward IMA measurement log on kexec"
>> v4:
>>   - Move debug output into setup_buffer()
>> ---
>>   drivers/of/kexec.c | 125 ++++++++++++++++++++++++++-------------------
>>   1 file changed, 73 insertions(+), 52 deletions(-)
>>
>> diff --git a/drivers/of/kexec.c b/drivers/of/kexec.c
>> index 548dd5b1b5c1..404a86bb3978 100644
>> --- a/drivers/of/kexec.c
>> +++ b/drivers/of/kexec.c
>> @@ -117,45 +117,56 @@ static int do_get_kexec_buffer(const void *prop, int len, unsigned long *addr,
>>   }
>>   
>>   #ifdef CONFIG_HAVE_IMA_KEXEC
>> -/**
>> - * ima_get_kexec_buffer - get IMA buffer from the previous kernel
>> - * @addr:	On successful return, set to point to the buffer contents.
>> - * @size:	On successful return, set to the buffer size.
>> - *
>> - * Return: 0 on success, negative errno on error.
>> - */
>> -int __init ima_get_kexec_buffer(void **addr, size_t *size)
>> +static int get_kexec_buffer(const char *name, unsigned long *addr, size_t *size)
> 
> I think this new function can + should be marked __init as well; it's
> only called from the existing IMA functions and your new
> tpm_get_kexec_buffer which is already __init.

Yes, right. Thanks.
    Stefan



More information about the kexec mailing list