Linux EFI development
 help / color / mirror / Atom feed
From: Pankaj Gupta <pankaj.gupta@amd.com>
To: Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>, <x86@kernel.org>,
	Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.org>, <rdunlap@infradead.org>,
	<linux-doc@vger.kernel.org>
Cc: Arnd Bergmann <arnd@arndb.de>,
	Dapeng Mi <dapeng1.mi@linux.intel.com>,
	Marco Elver <elver@google.com>, "H . Peter Anvin" <hpa@zytor.com>,
	"Tom Lendacky" <thomas.lendacky@amd.com>,
	Ard Biesheuvel <ardb@kernel.org>,
	"Kiryl Shutsemau" <kas@kernel.org>,
	Ilias Apalodimas <ilias.apalodimas@linaro.org>,
	<linux-kernel@vger.kernel.org>, Mike Rapoport <rppt@kernel.org>,
	<linux-mm@kvack.org>, <linux-efi@vger.kernel.org>,
	<Pankaj.gupta.linux@gmail.com>,
	Ethan Nelson-Moore <enelsonmoore@gmail.com>,
	Karl Mehltretter <kmehltretter@gmail.com>,
	Pankaj Gupta <pankaj.gupta@amd.com>,
	Dave Hansen <dave.hansen@intel.com>
Subject: [PATCH v3] Documentation: kernel-parameters: memmap= and mem= in confidential guests
Date: Fri, 4 Dec 2026 04:53:41 -0600	[thread overview]
Message-ID: <20261204105341.252273-1-pankaj.gupta@amd.com> (raw)

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 can and will break things.

Link: https://lore.kernel.org/all/96be8f5a-8f65-48ff-8263-1d5d5f706354@intel.com/
Suggested-by: Dave Hansen <dave.hansen@intel.com>
Suggested-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Pankaj Gupta <pankaj.gupta@amd.com>
---
    v3:
     - Say only that the options can and will break things (Dave).
     - Move the mem= note out of the x86 part (Mike).
     - Mention that the other memmap= variants are covered too (Mike).
    v2: https://lore.kernel.org/all/20261203113547.250526-1-pankaj.gupta@amd.com/
    v1: https://lore.kernel.org/all/20261125120301.223907-1-pankaj.gupta@amd.com/

 Documentation/admin-guide/kernel-parameters.txt | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
index dce9b8f3ae98..a8617544b225 100644
--- a/Documentation/admin-guide/kernel-parameters.txt
+++ b/Documentation/admin-guide/kernel-parameters.txt
@@ -3915,6 +3915,8 @@ Kernel parameters
 			 the hypervisor, then assigned to KVM guests.
 			4 to limit the memory available for kdump kernel.
 
+			This option can and will break things.
+
 			[ARC,MICROBLAZE] - the limit applies only to low memory,
 			high memory is not affected.
 
@@ -3971,6 +3973,9 @@ Kernel parameters
 			Example:
 				memmap=100M@2G,100M#3G,1G!1024G
 
+			This option and the other memmap= variants can and will
+			break things.
+
 	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.

base-commit: fe6ff8d5d675c01793b9f051d16055dd4aa75244
-- 
2.34.1


             reply	other threads:[~2026-12-04 10:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-04 10:53 Pankaj Gupta [this message]
2026-12-05 10:54 ` [PATCH v3] Documentation: kernel-parameters: memmap= and mem= in confidential guests sashiko-bot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261204105341.252273-1-pankaj.gupta@amd.com \
    --to=pankaj.gupta@amd.com \
    --cc=Pankaj.gupta.linux@gmail.com \
    --cc=ardb@kernel.org \
    --cc=arnd@arndb.de \
    --cc=bp@alien8.de \
    --cc=corbet@lwn.net \
    --cc=dapeng1.mi@linux.intel.com \
    --cc=dave.hansen@intel.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=elver@google.com \
    --cc=enelsonmoore@gmail.com \
    --cc=hpa@zytor.com \
    --cc=ilias.apalodimas@linaro.org \
    --cc=kas@kernel.org \
    --cc=kmehltretter@gmail.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-efi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mingo@redhat.com \
    --cc=rdunlap@infradead.org \
    --cc=rppt@kernel.org \
    --cc=skhan@linuxfoundation.org \
    --cc=tglx@kernel.org \
    --cc=thomas.lendacky@amd.com \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox