From: "Pratik R. Sampat" <prsampat@amd.com>
To: Kiryl Shutsemau <kas@kernel.org>,
Zhenzhong Duan <zhenzhong.duan@intel.com>
Cc: marcandre.lureau@redhat.com, david@kernel.org,
rick.p.edgecombe@intel.com, pbonzini@redhat.com, mst@redhat.com,
peterx@redhat.com, chenyi.qiang@intel.com,
elena.reshetova@intel.com, michael.roth@amd.com,
ackerleytng@google.com, linux-kernel@vger.kernel.org,
linux-coco@lists.linux.dev, virtualization@lists.linux.dev,
x86@kernel.org, yilun.xu@intel.com, xiaoyao.li@intel.com,
chao.p.peng@intel.com
Subject: Re: [RFCv2 PATCH 1/6] efi/unaccepted: Support hotplug memory in unaccepted bitmap via SRAT
Date: Wed, 24 Jun 2026 10:23:21 -0400 [thread overview]
Message-ID: <99b5307e-e892-4d82-9e85-4f664b4d29b9@amd.com> (raw)
In-Reply-To: <ajvLaBs62bDoxC3W@thinkstation>
On 6/24/26 8:25 AM, Kiryl Shutsemau wrote:
> On Tue, Jun 23, 2026 at 06:17:32AM -0400, Zhenzhong Duan wrote:
>> Currently, allocate_unaccepted_bitmap() only scans the initial EFI
>> boot memory map. This misses hotpluggable ranges described in the
>> ACPI SRAT. Without early tracking, hotplug pages are accessed without
>> acceptance and this triggers guest crash.
>>
>> Introduce a lightweight ACPI SRAT parser to scan these regions early.
>> If a region has both ACPI_SRAT_MEM_ENABLED and ACPI_SRAT_MEM_HOT_PLUGGABLE
>> flags, expand the tracking boundaries. This avoids pulling in the full
>> ACPI subsystem while ensuring the bitmap covers both static memory and
>> hotplug memory.
>
> Ugh.. Parsing SRAT there is ugly. I would rather avoid it.
>
I agree. Parsing it here means SRAT gets parsed twice, which doesn't make much
sense.
> Do I understand correctly that we don't have a way represent pluggable,
> but not present memory in EFI memory map?
>
> IIUC, EFI_MEMORY_HOT_PLUGGABLE is actually present, but unpluggable
> memory.
>
Right. And repurposing EFI_MEMORY_HOT_PLUGGABLE (plus updating the spec) would
likely make this messier: by its current definition it describes cold-plugged
pages that may be removed, not pages that may be hot-added later.
> Maybe it would be better just allocate bitmap upto maxmem?
>
> And fix EFI spec to add pluggable-but-not-present attribute.
>
I am currently working with the UEFI community around two proposals for a spec
change:
1. Add a new attribute, as Kiryl suggested, or
2. Add a generic new hotplug memory type that represents all the memory that
could be added later.
In either case, we could then precisely allocate the bitmap by parsing the
region with the attribute/type.
I prefer (1), but I have RFC proposals, code-first edk2 changes, and the Linux
plumbing ready for both approaches, and plan to post them in the following week
after ironing out a few kinks.
Thanks,
--Pratik
next prev parent reply other threads:[~2026-06-24 14:23 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-23 10:17 [RFCv2 PATCH 0/6] Support memory hotplug/unplug for TDX CoCo guests Zhenzhong Duan
2026-06-23 10:17 ` [RFCv2 PATCH 1/6] efi/unaccepted: Support hotplug memory in unaccepted bitmap via SRAT Zhenzhong Duan
2026-06-24 12:25 ` Kiryl Shutsemau
2026-06-24 14:23 ` Pratik R. Sampat [this message]
2026-06-23 10:17 ` [RFCv2 PATCH 2/6] efi/unaccepted: Set unaccepted bits for all hotplug memory Zhenzhong Duan
2026-06-24 12:29 ` Kiryl Shutsemau
2026-06-23 10:17 ` [RFCv2 PATCH 3/6] efi/unaccepted: Create plugged bitmap to support hotplug memory in coco guest Zhenzhong Duan
2026-06-23 10:17 ` [RFCv2 PATCH 4/6] x86/tdx: Implement arch_unaccept_memory() Zhenzhong Duan
2026-06-23 10:17 ` [RFCv2 PATCH 5/6] mm/memory_hotplug: Support ACPI hotplug/unplug for coco guest Zhenzhong Duan
2026-06-24 12:33 ` Kiryl Shutsemau
2026-06-23 10:17 ` [RFCv2 PATCH 6/6] virtio-mem: Support memory " Zhenzhong Duan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=99b5307e-e892-4d82-9e85-4f664b4d29b9@amd.com \
--to=prsampat@amd.com \
--cc=ackerleytng@google.com \
--cc=chao.p.peng@intel.com \
--cc=chenyi.qiang@intel.com \
--cc=david@kernel.org \
--cc=elena.reshetova@intel.com \
--cc=kas@kernel.org \
--cc=linux-coco@lists.linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=marcandre.lureau@redhat.com \
--cc=michael.roth@amd.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peterx@redhat.com \
--cc=rick.p.edgecombe@intel.com \
--cc=virtualization@lists.linux.dev \
--cc=x86@kernel.org \
--cc=xiaoyao.li@intel.com \
--cc=yilun.xu@intel.com \
--cc=zhenzhong.duan@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.