lkml.org 
[lkml]   [2020]   [Jul]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [RESEND PATCH v5 06/11] ppc64/kexec_file: restrict memory usage of kdump kernel
From
Date


On 28/07/20 7:14 pm, Michael Ellerman wrote:
> Hari Bathini <hbathini@linux.ibm.com> writes:
>> diff --git a/arch/powerpc/kexec/file_load_64.c b/arch/powerpc/kexec/file_load_64.c
>> index 2df6f4273ddd..8df085a22fd7 100644
>> --- a/arch/powerpc/kexec/file_load_64.c
>> +++ b/arch/powerpc/kexec/file_load_64.c
>> @@ -17,9 +17,21 @@
>> #include <linux/kexec.h>
>> #include <linux/of_fdt.h>
>> #include <linux/libfdt.h>
>> +#include <linux/of_device.h>
>> #include <linux/memblock.h>
>> +#include <linux/slab.h>
>> +#include <asm/drmem.h>
>> #include <asm/kexec_ranges.h>
>>
>> +struct umem_info {
>> + uint64_t *buf; /* data buffer for usable-memory property */
>> + uint32_t idx; /* current index */
>> + uint32_t size; /* size allocated for the data buffer */
>
> Use kernel types please, u64, u32.
>
>> + /* usable memory ranges to look up */
>> + const struct crash_mem *umrngs;
>
> "umrngs".
>
> Given it's part of the umem_info struct could it just be "ranges"?

True. Actually, having crash_mem_range *ranges + u32 nr_ranges and
populating them seems better. Will do that..

>> + return NULL;
>> + }
>
> um_info->size = new_size;
>
>> +
>> + memset(tbuf + um_info->idx, 0, MEM_RANGE_CHUNK_SZ);
>
> Just pass __GFP_ZERO to krealloc?

There are patches submitted to stable fixing a few modules that use
krealloc with __GFP_ZERO. Also, this zeroing is not really needed.
I will drop the memset instead..

Thanks
Hari

\
 
 \ /
  Last update: 2020-07-28 21:35    [W:0.061 / U:2.232 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site