Messages in this thread |  | | Date | Wed, 26 Nov 2025 11:12:13 +0000 | | From | Kiryl Shutsemau <> | | Subject | Re: [RFC PATCH 2/4] mm: Add support for unaccepted memory hotplug |
| |
On Tue, Nov 25, 2025 at 11:57:51AM -0600, Pratik R. Sampat wrote: > The unaccepted memory structure currently only supports accepting memory > present at boot time. The unaccepted table uses a fixed-size bitmap > reserved in memblock based on the initial memory layout, preventing > dynamic addition of memory ranges after boot. This causes guest > termination when memory is hot-added in a secure virtual machine due to > accessing pages that have not transitioned to private before use.
How does the hot-pluggable memory look in EFI memory map? I thought hot-pluggable ranges suppose to be declared thare. The cleanest solution would be to have hot-pluggable and unaccepted indicated in EFI memory, so we can size bitmap accordingly upfront.
> Extend the unaccepted memory framework to handle hotplugged memory by > dynamically managing the unaccepted bitmap. Allocate a new bitmap when > hotplugged ranges exceed the reserved bitmap capacity and switch to > kernel-managed allocation. > > Hotplugged memory also follows the same acceptance policy using the > accept_memory=[eager|lazy] kernel parameter to accept memory either > up-front when added or before first use. > > Signed-off-by: Pratik R. Sampat <prsampat@amd.com> > --- > arch/x86/boot/compressed/efi.h | 1 + > .../firmware/efi/libstub/unaccepted_memory.c | 1 + > drivers/firmware/efi/unaccepted_memory.c | 83 +++++++++++++++++++ > include/linux/efi.h | 1 + > include/linux/mm.h | 11 +++ > mm/memory_hotplug.c | 7 ++ > mm/page_alloc.c | 2 + > 7 files changed, 106 insertions(+) > > diff --git a/arch/x86/boot/compressed/efi.h b/arch/x86/boot/compressed/efi.h > index 4f7027f33def..a220a1966cae 100644 > --- a/arch/x86/boot/compressed/efi.h > +++ b/arch/x86/boot/compressed/efi.h > @@ -102,6 +102,7 @@ struct efi_unaccepted_memory { > u32 unit_size; > u64 phys_base; > u64 size; > + bool mem_reserved; > unsigned long *bitmap; > }; >
Again, this is ABI break for kexec.
-- Kiryl Shutsemau / Kirill A. Shutemov
|  |