Re: [PATCH 1/2] mm/cma: accept memory of multi-range CMA areas

From: Gupta, Pankaj

Date: Mon Nov 02 2026 - 11:14:25 EST


On systems with unaccepted memory, memblock allocations accept the
allocated range, but when cma_declare_contiguous_multi() uses open coded
allocation of multiple ranges, it reserves them with memblock_reserve()
and they are never accepted.

These pages are released to the buddy allocator by cma_activate_area()
with __free_pages() that does not check for unaccepted memory, so the
first access to such a page in a TDX or SEV-SNP guest is fatal.

Accept the memory of each range when it is reserved.
Fix looks correct to me.

Any easy way to reproduce and test on SEV SNP?
I think running a VM with 16G or ram on a single node and with

hugetlb_cma=8G memmap=2M\$0x2ffe00000 init_on_free=1

This triggered an unrelated issue for me, I sent a fix here:

https://lore.kernel.org/all/20261102113127.161823-1-pankaj.gupta@xxxxxxx/

I was able to verify this series with:

hugetlb_cma=8G cma=2G@0x200000000 init_on_free=1

Thanks,

Pankaj