* [PATCH] Documentation: kernel-parameters: memmap= and mem= in confidential guests
@ 2026-11-25 12:03 Pankaj Gupta
2026-12-01 10:07 ` Mike Rapoport
0 siblings, 1 reply; 3+ messages in thread
From: Pankaj Gupta @ 2026-11-25 12:03 UTC (permalink / raw)
To: Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen, x86,
Jonathan Corbet, Shuah Khan, rdunlap, linux-doc
Cc: Arnd Bergmann, Dapeng Mi, Marco Elver, H . Peter Anvin,
Tom Lendacky, Ard Biesheuvel, Kiryl Shutsemau, Ilias Apalodimas,
linux-kernel, Mike Rapoport, linux-mm, linux-efi,
Pankaj.gupta.linux, Ethan Nelson-Moore, Karl Mehltretter,
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
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.
Link: https://lore.kernel.org/all/96be8f5a-8f65-48ff-8263-1d5d5f706354@intel.com/
Signed-off-by: Pankaj Gupta <pankaj.gupta@amd.com>
---
Documentation/admin-guide/kernel-parameters.txt | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
index dce9b8f3ae98..d0e9a2c7dddb 100644
--- a/Documentation/admin-guide/kernel-parameters.txt
+++ b/Documentation/admin-guide/kernel-parameters.txt
@@ -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.
--
2.34.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] Documentation: kernel-parameters: memmap= and mem= in confidential guests
2026-11-25 12:03 [PATCH] Documentation: kernel-parameters: memmap= and mem= in confidential guests Pankaj Gupta
@ 2026-12-01 10:07 ` Mike Rapoport
2026-12-01 10:11 ` Ard Biesheuvel
0 siblings, 1 reply; 3+ messages in thread
From: Mike Rapoport @ 2026-12-01 10:07 UTC (permalink / raw)
To: Pankaj Gupta
Cc: Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen, x86,
Jonathan Corbet, Shuah Khan, rdunlap, linux-doc, Arnd Bergmann,
Dapeng Mi, Marco Elver, H . Peter Anvin, Tom Lendacky,
Ard Biesheuvel, Kiryl Shutsemau, Ilias Apalodimas, linux-kernel,
linux-mm, linux-efi, Pankaj.gupta.linux, Ethan Nelson-Moore,
Karl Mehltretter
On Wed, Nov 25, 2026 at 06:03:01AM -0600, Pankaj Gupta wrote:
> 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.
>
> Link: https://lore.kernel.org/all/96be8f5a-8f65-48ff-8263-1d5d5f706354@intel.com/
> Signed-off-by: Pankaj Gupta <pankaj.gupta@amd.com>
> ---
> Documentation/admin-guide/kernel-parameters.txt | 12 ++++++++++++
> 1 file changed, 12 insertions(+)
>
> diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
> index dce9b8f3ae98..d0e9a2c7dddb 100644
> --- a/Documentation/admin-guide/kernel-parameters.txt
> +++ b/Documentation/admin-guide/kernel-parameters.txt
> @@ -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
Pardon my ignorance, are there confidential guests that don't use
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.
Do we need the details about the unaccepted bitmap in the user facing docs?
> +
> 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.
> --
> 2.34.1
>
>
--
Sincerely yours,
Mike.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Documentation: kernel-parameters: memmap= and mem= in confidential guests
2026-12-01 10:07 ` Mike Rapoport
@ 2026-12-01 10:11 ` Ard Biesheuvel
0 siblings, 0 replies; 3+ messages in thread
From: Ard Biesheuvel @ 2026-12-01 10:11 UTC (permalink / raw)
To: Mike Rapoport, Pankaj Gupta
Cc: Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen, x86,
Jonathan Corbet, Shuah Khan, Randy Dunlap, linux-doc,
Arnd Bergmann, Dapeng Mi, Marco Elver, H . Peter Anvin,
Tom Lendacky, Kiryl Shutsemau (Meta), Ilias Apalodimas,
linux-kernel, linux-mm, linux-efi, Pankaj.gupta.linux,
Ethan Nelson-Moore, Karl Mehltretter
On Tue, 1 Dec 2026, at 11:07, Mike Rapoport wrote:
> On Wed, Nov 25, 2026 at 06:03:01AM -0600, Pankaj Gupta wrote:
>> 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.
>>
>> Link: https://lore.kernel.org/all/96be8f5a-8f65-48ff-8263-1d5d5f706354@intel.com/
>> Signed-off-by: Pankaj Gupta <pankaj.gupta@amd.com>
>> ---
>> Documentation/admin-guide/kernel-parameters.txt | 12 ++++++++++++
>> 1 file changed, 12 insertions(+)
>>
>> diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
>> index dce9b8f3ae98..d0e9a2c7dddb 100644
>> --- a/Documentation/admin-guide/kernel-parameters.txt
>> +++ b/Documentation/admin-guide/kernel-parameters.txt
>> @@ -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
>
> Pardon my ignorance, are there confidential guests that don't use
> 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.
>
> Do we need the details about the unaccepted bitmap in the user facing docs?
>
I don't think so.
Could we just document that things like mem= and memmap= are best effort and
may break the mutual consistency of the various memory descriptions provided
by the platform firmware?
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-12-01 10:12 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-25 12:03 [PATCH] Documentation: kernel-parameters: memmap= and mem= in confidential guests Pankaj Gupta
2026-12-01 10:07 ` Mike Rapoport
2026-12-01 10:11 ` Ard Biesheuvel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox