Skip to contentSkip to conversation

Documentation: kernel-parameters: memmap= and mem= in confidential guests

PATCH New Pankaj Gupta 1 participant 1 message Nov 25

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Documentation: kernel-parameters: memmap= and mem= in confidential guests

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 the E820 table only afterwards, so the two no longer match.

accept_memory() accepts whole units (2 MiB on x86). On SEV-SNP this can touch a memmap= hole, which is not mapped, and crashes the guest early in boot. TDX accepts by physical address and does not fault.

Making the bitmap follow these options is not feasible in current design, as a unit cannot be half accepted. These options are debugging tools, so document that they are not supported in confidential guests that use unaccepted memory.

---
 Documentation/admin-guide/kernel-parameters.txt | 12 ++++++++++++
 1 file changed, 12 insertions(+)
Documentation/admin-guide/kernel-parameters.txt +12 -0
index dce9b8f3ae98..d0e9a2c7dddb 100644
@@ -3930,6 +3930,12 @@ Kernel parameters
 			in above case 3, memory may need be hot added after boot
 			if system memory of hypervisor is not sufficient.
 
+			[X86] Not supported in confidential guests (SEV-SNP,
+			TDX) that use unaccepted memory. The unaccepted memory
+			bitmap is built before the command line is parsed and
+			does not follow mem=, so memory that is no longer in
+			the memory map may still be accepted.
+
 	mem=nn[KMG]@ss[KMG]
 			[ARM,MIPS,EARLY] - override the memory layout
 			reported by firmware.
@@ -3971,6 +3977,12 @@ Kernel parameters
 			Example:
 				memmap=100M@2G,100M#3G,1G!1024G
 
+			[X86] Not supported in confidential guests (SEV-SNP,
+			TDX) that use unaccepted memory. The unaccepted memory
+			bitmap is built before the command line is parsed and
+			does not follow memmap=. A memory hole can crash an
+			SEV-SNP guest early in boot.
+
 	memmap=nn[KMG]#ss[KMG]
 			[KNL,ACPI,EARLY] Mark specific memory as ACPI data.
 			Region of memory to be marked is from ss to ss+nn.
Signature · 1 line
2.34.1