Re: [PATCH v2] Documentation: kernel-parameters: memmap= and mem= in confidential guests
From: Mike Rapoport
Date: Thu Dec 03 2026 - 08:40:42 EST
On Thu, Dec 03, 2026 at 05:35:47AM -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 the current
> design, as a unit cannot be half accepted. So document that these
> options are best effort.
>
> Link: https://lore.kernel.org/all/96be8f5a-8f65-48ff-8263-1d5d5f706354@xxxxxxxxx/
> Suggested-by: Ard Biesheuvel <ardb@xxxxxxxxxx>
> Signed-off-by: Pankaj Gupta <pankaj.gupta@xxxxxxx>
> ---
> v2:
> - Document mem= and memmap= as best effort, as suggested by Ard,
> instead of describing the unaccepted memory bitmap.
> v1: https://lore.kernel.org/all/20261125120301.223907-1-pankaj.gupta@xxxxxxx/
>
> Documentation/admin-guide/kernel-parameters.txt | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
> index dce9b8f3ae98..9636e662fed1 100644
> --- a/Documentation/admin-guide/kernel-parameters.txt
> +++ b/Documentation/admin-guide/kernel-parameters.txt
> @@ -3930,6 +3930,10 @@ Kernel parameters
> in above case 3, memory may need be hot added after boot
> if system memory of hypervisor is not sufficient.
>
> + This option is best effort and may break the mutual
> + consistency of the various memory descriptions provided
> + by the platform firmware.
> +
I'd move it out of x86 part to [KNL,BOOT,EARLY].
> mem=nn[KMG]@ss[KMG]
> [ARM,MIPS,EARLY] - override the memory layout
> reported by firmware.
> @@ -3971,6 +3975,10 @@ Kernel parameters
> Example:
> memmap=100M@2G,100M#3G,1G!1024G
>
> + This option is best effort and may break the mutual
> + consistency of the various memory descriptions provided
> + by the platform firmware.
> +
And here I'd mention that other memmap= variants are treated the same.
> 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.