mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Kiryl Shutsemau <kas@kernel.org>
To: Ard Biesheuvel <ardb@kernel.org>
Cc: linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org,
	 x86@kernel.org, Borislav Petkov <bp@alien8.de>,
	 "Edgecombe, Rick P" <rick.p.edgecombe@intel.com>
Subject: Re: [PATCH v2 2/3] x86/boot: Move unaccepted memory handling out of the decompressor
Date: Fri, 25 Sep 2026 12:59:17 +0100	[thread overview]
Message-ID: <arZh_KWXq7-kmwiw@thinkstation> (raw)
In-Reply-To: <20260925075137.44298-7-ardb@kernel.org>

On Fri, Sep 25, 2026 at 09:51:40AM +0200, Ard Biesheuvel wrote:
> arch_accept_memory() is an arch-specific hook that is required by the
> EFI stub when processing memory that the firmware reports to the OS as
> EFI_UNACCEPTED_MEMORY.
> 
> This hook is called after ExitBootServices() has been called, as before
> that point, the EFI memory map may get updated behind the back of the
> running EFI stub, making it difficult to get a stable view on it while
> iterating over the entries.
> 
> Currently, the x86 version of this hook is implemented in its
> decompressor rather than in the EFI stub itself, in a manner that is
> problematic: when an error occurs, it calls the decompressor's error()
> routine, but without having gone through the decompressor initialization
> code. This means it will resort to direct port I/O rather than the
> hypercall based interface that TDX guests would use otherwise.
> 
> Conceptually, code that is only called from the EFI stub, and never by
> the decompressor when doing legacy boot, belongs in the EFI stub and not
> in the decompressor.
> 
> So move it into the x86-specific EFI stub code, replacing the error() on
> the TDX path with tdx_panic(), and dropping the error() when no CC
> support is detected - the kernel can decide what to do in this case
> after it has booted.
> 
> Signed-off-by: Ard Biesheuvel <ardb@kernel.org>

Reviewed-by: Kiryl Shutsemau (Meta) <kas@kernel.org>

-- 
  Kiryl Shutsemau / Kirill A. Shutemov

  reply	other threads:[~2026-09-25 11:59 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-25  7:51 [PATCH v2 0/3] Move memory acceptance x86 arch code into EFI stub Ard Biesheuvel
2026-09-25  7:51 ` [PATCH v2 1/3] x86/tdx: Share tdx_panic() with the " Ard Biesheuvel
2026-09-25 11:44   ` Kiryl Shutsemau
2026-09-25  7:51 ` [PATCH v2 2/3] x86/boot: Move unaccepted memory handling out of the decompressor Ard Biesheuvel
2026-09-25 11:59   ` Kiryl Shutsemau [this message]
2026-09-25  7:51 ` [PATCH v2 3/3] x86/boot: Drop unused implementation of panic() Ard Biesheuvel

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=arZh_KWXq7-kmwiw@thinkstation \
    --to=kas@kernel.org \
    --cc=ardb@kernel.org \
    --cc=bp@alien8.de \
    --cc=linux-efi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rick.p.edgecombe@intel.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®