From: "Ard Biesheuvel" <ardb@kernel.org>
To: "Kiryl Shutsemau (Meta)" <kas@kernel.org>
Cc: "Ilias Apalodimas" <ilias.apalodimas@linaro.org>,
"Thomas Gleixner" <tglx@kernel.org>,
"Ingo Molnar" <mingo@redhat.com>,
"Borislav Petkov" <bp@alien8.de>,
"Dave Hansen" <dave.hansen@linux.intel.com>,
x86@kernel.org, "H . Peter Anvin" <hpa@zytor.com>,
"Mike Rapoport" <rppt@kernel.org>,
"Tom Lendacky" <thomas.lendacky@amd.com>,
"Rick Edgecombe" <rick.p.edgecombe@intel.com>,
"Pankaj Gupta" <pankaj.gupta@amd.com>,
linux-efi@vger.kernel.org, linux-coco@lists.linux.dev,
linux-kernel@vger.kernel.org, kernel-team@meta.com,
stable@vger.kernel.org
Subject: Re: [PATCH] x86/efi: Handle EFI_UNACCEPTED_MEMORY in do_add_efi_memmap()
Date: Thu, 26 Nov 2026 12:29:30 +0100 [thread overview]
Message-ID: <2c075daa-978b-4efc-bb36-736909ec5ff6@app.fastmail.com> (raw)
In-Reply-To: <20261125173338.1250080-1-kas@kernel.org>
On Wed, 25 Nov 2026, at 18:33, Kiryl Shutsemau (Meta) wrote:
> The EFI stub reports unaccepted memory to the kernel as E820 RAM.
> do_add_efi_memmap() has no case for EFI_UNACCEPTED_MEMORY and adds the
> same range again as E820_TYPE_RESERVED. e820__update_table() resolves
> the overlap in favour of the reserved type, so the kernel never uses
> the range.
>
> do_add_efi_memmap() runs when soft reservation is enabled and the
> firmware marks any conventional memory EFI_MEMORY_SP; that takes no
> command-line option. It also runs with the add_efi_memmap boot
> parameter. A TDX or SEV-SNP guest booted either way loses the memory the
> firmware left unaccepted, and it does not show up in MemTotal.
>
> Add unaccepted memory as RAM, as the stub does. Without
> CONFIG_UNACCEPTED_MEMORY the kernel cannot accept it, so keep it
> reserved there.
>
> Fixes: 745e3ed85f71 ("efi/libstub: Implement support for unaccepted memory")
> Reported-by: Mike Rapoport <rppt@kernel.org>
> Cc: stable@vger.kernel.org
> Signed-off-by: Kiryl Shutsemau (Meta) <kas@kernel.org>
> ---
> Build-tested only, with and without CONFIG_UNACCEPTED_MEMORY.
>
> arch/x86/platform/efi/efi.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
I can take this via efi/urgent if desired.
next prev parent reply other threads:[~2026-11-26 11:29 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-25 17:33 [PATCH] x86/efi: Handle EFI_UNACCEPTED_MEMORY in do_add_efi_memmap() Kiryl Shutsemau (Meta)
2026-11-26 11:27 ` Gupta, Pankaj
2026-11-26 11:29 ` Ard Biesheuvel [this message]
2026-11-26 12:06 ` Kiryl Shutsemau (Meta)
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=2c075daa-978b-4efc-bb36-736909ec5ff6@app.fastmail.com \
--to=ardb@kernel.org \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=hpa@zytor.com \
--cc=ilias.apalodimas@linaro.org \
--cc=kas@kernel.org \
--cc=kernel-team@meta.com \
--cc=linux-coco@lists.linux.dev \
--cc=linux-efi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=pankaj.gupta@amd.com \
--cc=rick.p.edgecombe@intel.com \
--cc=rppt@kernel.org \
--cc=stable@vger.kernel.org \
--cc=tglx@kernel.org \
--cc=thomas.lendacky@amd.com \
--cc=x86@kernel.org \
/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.