Re: [PATCH v2 1/2] mm/memory_hotplug: Add support to accept memory during hot-add

From: Pratik R. Sampat

Date: Mon Jan 12 2026 - 17:23:45 EST




On 1/12/26 3:04 PM, Andrew Morton wrote:
> On Mon, 12 Jan 2026 14:22:59 -0600 "Pratik R. Sampat" <prsampat@xxxxxxx> wrote:
>
>> Confidential computing guests require memory to be accepted before use.
>> The unaccepted memory bitmap maintained by firmware does not track
>> hotplugged memory ranges.
>>
>> Call arch_accept_memory() during the hot-add path to explicitly validate
>> and transition the newly added memory to a private state, making it
>> usable by the guest.
>>
>> Signed-off-by: Pratik R. Sampat <prsampat@xxxxxxx>
>> ---
>> mm/memory_hotplug.c | 4 ++++
>> 1 file changed, 4 insertions(+)
>>
>> diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
>> index a63ec679d861..8cfbf0541430 100644
>> --- a/mm/memory_hotplug.c
>> +++ b/mm/memory_hotplug.c
>> @@ -38,6 +38,7 @@
>> #include <linux/node.h>
>>
>> #include <asm/tlbflush.h>
>> +#include <asm/unaccepted_memory.h>
>
> This only exists for x86!

Ah, I missed that entirely. Thanks for catching that.

Probably not the best option to have a generic unaccepted_memory.h as well.
Maybe, I should have arch_[un]accept_memory() definitions within mm.h wrapped
within CONFIG_UNACCEPTED_MEMORY instead so that its cleaner.

>
> Otherwise, the mm/ changes are minimal so I volunteer this patchset
> for the x86 tree ;)

Ack!

--Pratik