From: "Kiryl Shutsemau (Meta)" <kas@kernel.org>
To: Ard Biesheuvel <ardb@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:06:21 +0000 [thread overview]
Message-ID: <awggd5bP1Yg7qgRQ@shutemov.name> (raw)
In-Reply-To: <2c075daa-978b-4efc-bb36-736909ec5ff6@app.fastmail.com>
On Thu, Nov 26, 2026 at 12:29:30PM +0100, Ard Biesheuvel wrote:
>
>
> 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.
It is not urgent on my part. It can wait the next merge window, unless
someone else needs it now.
--
Kiryl Shutsemau / Kirill A. Shutemov
prev parent reply other threads:[~2026-11-26 12:06 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-25 17:33 Kiryl Shutsemau (Meta)
2026-11-26 11:27 ` Gupta, Pankaj
2026-11-26 11:29 ` Ard Biesheuvel
2026-11-26 12:06 ` Kiryl Shutsemau (Meta) [this message]
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=awggd5bP1Yg7qgRQ@shutemov.name \
--to=kas@kernel.org \
--cc=ardb@kernel.org \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=hpa@zytor.com \
--cc=ilias.apalodimas@linaro.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®