RE: [PATCH] efi: Free existing memory map before installing new memory map

From: Prakhya, Sai Praneeth
Date: Wed Jun 27 2018 - 03:28:12 EST


> > Also, could you please clarify if there is any specific reason why
> > memory allocated using memblock_reserve() shouldn't be freed. I mean,
> > not with memblock_free() but I think we could make it _available_
> > using free_bootmem() (or something similar, please correct me if this is not
> the right API).
>
> On arm64, the memory map is provided to the core kernel by the stub, and after
> kexec, a pointer to the same memory map will be passed to the next kernel. So
> the kernel does not 'own' that allocation, and it should not free it or overwrite
> it.

Thanks for the reply. It confirms that the issue is only on x86 systems.
I see that arm64 doesn't call efi_memmap_alloc() and hence there is no concept
of allocating memory for new memory map and installing it (so no memory leak).

Regards,
Sai