Re: [PATCH] x86/unaccepted_memory: Do not accept ranges that are no longer E820 RAM
From: Gupta, Pankaj
Date: Mon Nov 02 2026 - 06:51:44 EST
Hi Ard,
Hello Pankaj,
On Mon, 2 Nov 2026, at 12:31, Pankaj Gupta wrote:
The EFI stub builds the unaccepted memory bitmap before the kernel parsesCan we just disallow memmap= when running in a confidential VM?
its command line. Option memmap=<size>$<addr> removes RAM from the E820
map while its bits are still set in the bitmap.
The removed range, such as a memmap=...$... hole, is then still treated as
unaccepted RAM and accept_memory() tries to accept it. The hole is not
mapped, so on SEV-SNP the PVALIDATE faults and the guest crashes early in
the boot:
BUG: unable to handle page fault for address: ffff8a14bfe00000
RIP: 0010:pvalidate_pages+0xc0/0x250
set_pages_state+0x41a/0x440
snp_accept_memory+0x3e/0x50
accept_memory+0x186/0x260
__free_pages_core+0xd2/0x240
memblock_free_pages+0x1b/0x30
memblock_free_all+0x275/0x2d0
This was seen with memmap=2M$0x1ffe00000, a 2 MiB hole in RAM, on a 19 GiB
SNP guest with lazy acceptance.
Fixes: 2053bc57f367 ("efi: Add unaccepted memory support")
Signed-off-by: Pankaj Gupta <pankaj.gupta@xxxxxxx>
---
arch/x86/include/asm/unaccepted_memory.h | 23 ++++++++++++++++++++++-
1 file changed, 22 insertions(+), 1 deletion(-)
My experiments showed: memmap itself don't have a problem but memap with a hole is causing crash.
There might be some usecases which are already using this, e.g:
https://lore.kernel.org/all/20261029-cma-multi-v1-0-2cbced8b5cb7@xxxxxxxxxx/
Thanks,
Pankaj