mbox series

[v2,0/3] efistub/x86: Fix early SEV-SNP memory acceptance

Message ID 20250404082921.2767593-5-ardb+git@google.com
Headers show
Series efistub/x86: Fix early SEV-SNP memory acceptance | expand

Message

Ard Biesheuvel April 4, 2025, 8:29 a.m. UTC
From: Ard Biesheuvel <ardb@kernel.org>

This is a follow-up to [0]. Instead of avoiding memory acceptance from
the EFI stub altogether, switch to a separate API that can be
implemented by SEV-SNP without relying on the shared GHCB page, which
cannot be created yet when still executing in the firmware context with
the firmware's page tables.

[0] https://lore.kernel.org/all/20250325091614.1203411-2-ardb+git@google.com/T/#u

Cc: Tom Lendacky <thomas.lendacky@amd.com>,
Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
Cc: Borislav Petkov <bp@alien8.de>,
Cc: Dionna Amalie Glaze <dionnaglaze@google.com>,
Cc: Kevin Loughlin <kevinloughlin@google.com>

Ard Biesheuvel (3):
  x86/boot: Move accept_memory() into decompressor
  x86/boot: Use separate API for memory acceptance in the EFI stub
  x86/boot: Implement early memory acceptance for SEV-SNP

 arch/x86/boot/compressed/mem.c                   | 47 +++++++++++++++-
 arch/x86/boot/compressed/sev.c                   | 34 ++++++++++--
 drivers/firmware/efi/libstub/efistub.h           |  3 +-
 drivers/firmware/efi/libstub/unaccepted_memory.c | 57 +++-----------------
 drivers/firmware/efi/libstub/x86-stub.c          | 41 ++++++++++++++
 5 files changed, 124 insertions(+), 58 deletions(-)