On Wed, 17 Sep 2025 20:40:32 +0300 Mike Rapoport <[email protected]> wrote:
> A vmalloc allocation is preserved using binary structure similar to
> global KHO memory tracker. It's a linked list of pages where each page
> is an array of physical address of pages in vmalloc area.
>
> kho_preserve_vmalloc() hands out the physical address of the head page
> to the caller. This address is used as the argument to
> kho_vmalloc_restore() to restore the mapping in the vmalloc address
> space and populate it with the preserved pages.
>
> ...
>
> --- a/include/linux/kexec_handover.h
> +++ b/include/linux/kexec_handover.h
> @@ -39,12 +39,22 @@ struct page;
>
> struct kho_serialization;
>
> +struct kho_vmalloc_chunk;
> +struct kho_vmalloc {
> + DECLARE_KHOSER_PTR(first, struct kho_vmalloc_chunk *);
offtopic nit: DECLARE_KHOSER_PTR() *defines* a union named "first". It
doesn't declare one. A better name for this would have been DEFINE_...
And the world would be a better place if those three macros had a bit
of documentation ;)
The code looks nice though.