Linux EFI development
 help / color / mirror / Atom feed
* [PATCH RFC 0/3] x86/e820: Ignore memmap= and mem= in confidential guests
@ 2026-11-24 13:32 Pankaj Gupta
  2026-11-24 13:32 ` [PATCH RFC 1/3] x86/e820: Ignore memmap= " Pankaj Gupta
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Pankaj Gupta @ 2026-11-24 13:32 UTC (permalink / raw)
  To: Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen, x86
  Cc: H . Peter Anvin, Tom Lendacky, Ard Biesheuvel, Kiryl Shutsemau,
	Ilias Apalodimas, linux-kernel, Mike Rapoport, linux-mm,
	linux-efi, Pankaj.gupta.linux, Pankaj Gupta

In a confidential guest (SEV-SNP, TDX) the EFI stub builds the unaccepted
memory bitmap before the command line is parsed. memmap= and mem= edit
e820_table only afterwards.

accept_memory() accepts whole 2 MiB units. A memmap= hole that is not
unit-aligned is touched when its unit is accepted. On SEV-SNP this faults
early in boot and crashes the guest (e.g. memmap=1M$0x1ffe00000), because
PVALIDATE needs the page mapped and the hole is not. TDX works on
physical addresses, so the hole is accepted and the options work there
today. The same option therefore behaves differently per vendor.

This replaces my earlier fix [1][2], following review feedback from Ard
Biesheuvel and Kiryl Shutsemau: the firmware's view of memory must match
the OS, and a bitmap unit cannot be half accepted. Instead of making the
bitmap follow memmap= and mem=, ignore them in confidential guests.

Patch 1 warns and ignores memmap= in confidential guests.
Patch 2 keeps memmap= in a kdump kernel (elfcorehdr= on the command
        line), as ignoring it would let the kdump kernel use the memory
        of the crashed kernel.
Patch 3 does the same for mem=.

[1] https://lore.kernel.org/all/20261102113127.161823-1-pankaj.gupta@amd.com/
[2] https://lore.kernel.org/all/20261113105554.199912-1-pankaj.gupta@amd.com/

Pankaj Gupta (3):
  x86/e820: Ignore memmap= in confidential guests
  x86/e820: Allow memmap= in a kdump kernel in confidential guests
  x86/e820: Ignore mem= in confidential guests

 arch/x86/kernel/e820.c | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2026-11-24 17:28 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-24 13:32 [PATCH RFC 0/3] x86/e820: Ignore memmap= and mem= in confidential guests Pankaj Gupta
2026-11-24 13:32 ` [PATCH RFC 1/3] x86/e820: Ignore memmap= " Pankaj Gupta
2026-11-24 13:32 ` [PATCH RFC 2/3] x86/e820: Allow memmap= in a kdump kernel " Pankaj Gupta
2026-11-24 13:32 ` [PATCH RFC 3/3] x86/e820: Ignore mem= " Pankaj Gupta
2026-11-24 15:09 ` [PATCH RFC 0/3] x86/e820: Ignore memmap= and " Dave Hansen
2026-11-24 15:56   ` Mike Rapoport
2026-11-24 15:58     ` Dave Hansen
2026-11-24 16:14       ` Mike Rapoport
2026-11-24 16:26         ` Ard Biesheuvel
2026-11-24 16:32           ` Dave Hansen
2026-11-24 17:27           ` Gupta, Pankaj

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox