[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <uszziotbygfz3i5u6bcpczbcu7xhqmbec4p7eqjjhlgdcgtnxj@fm7ycfwhx3bu>
Date: Fri, 14 Feb 2025 15:37:51 +0200
From: "Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>
To: Dave Hansen <dave.hansen@...el.com>
Cc: Yan Zhao <yan.y.zhao@...el.com>, ebiederm@...ssion.com,
kexec@...ts.infradead.org, linux-kernel@...r.kernel.org, linux-coco@...ts.linux.dev,
x86@...nel.org, rick.p.edgecombe@...el.com, bhe@...hat.com
Subject: Re: [PATCH v2 1/1] kexec_core: Accept unaccepted kexec segments'
destination addresses
On Thu, Feb 13, 2025 at 07:50:42AM -0800, Dave Hansen wrote:
> On 12/13/24 01:54, Yan Zhao wrote:
> > + /*
> > + * The destination addresses are searched from system RAM rather than
> > + * being allocated from the buddy allocator, so they are not guaranteed
> > + * to be accepted by the current kernel. Accept the destination
> > + * addresses before kexec swaps their content with the segments' source
> > + * pages to avoid accessing memory before it is accepted.
> > + */
> > + for (i = 0; i < nr_segments; i++)
> > + accept_memory(image->segment[i].mem, image->segment[i].memsz);
>
> The "searched from system RAM" phrase both here and in the changelog
> doesn't quite parse for me.
>
> Also "System RAM" is the normal phrase that I use to describe the memory
> that mostly ends up _going_ into the buddy allocator. It's not just me:
>
> cat /proc/iomem | grep 'System RAM'
>
> I think a more useful comment (and changelog) might be something like this:
>
> The core kernel focuses on accepting memory which is known to be
> System RAM. However, there might be areas that are reserved in
> the memory map, not exposed to the kernel as "System RAM" and
> not accepted by firmware. Accept the memory before kexec touches
> it.
If kernel compiled with CONFIG_UNACCEPTED_MEMORY, EFI_UNACCEPTED_MEMORY
is part of System RAM. It translates to E820_TYPE_RAM. See setup_e820() in
EFI stub.
--
Kiryl Shutsemau / Kirill A. Shutemov
Powered by blists - more mailing lists