From f8f9cbc34a309a388c052706f3329d1b52985aa3 Mon Sep 17 00:00:00 2001 From: "Mike Rapoport (Microsoft)" Date: Thu, 29 Oct 2026 12:18:38 +0200 Subject: [PATCH] mm/cma: accept memory of CMA areas reserved at a fixed address CMA areas allocated from memblock have their memory accepted by memblock_alloc_range_nid(), but areas reserved at a fixed address with memblock_reserve() are not. If a fixed CMA area is requested by the cma=@ command line parameter, it may be in regular RAM and on TDX and SEV-SNP guests it must be accepted. Accept the memory of fixed CMA areas as well, so that all CMA areas are accepted regardless of how they were reserved. Link: https://lore.kernel.org/20261029-cma-multi-v1-2-2cbced8b5cb7@kernel.org Fixes: 75d090fd167a ("x86/tdx: Add unaccepted memory support") Signed-off-by: Mike Rapoport (Microsoft) Signed-off-by: Andrew Morton Reviewed-by: Kiryl Shutsemau (Meta) Reviewed-by: Pankaj Gupta Tested-by: Pankaj Gupta Cc: David Hildenbrand Cc: Liam R. Howlett Cc: Lorenzo Stoakes Cc: Michal Hocko Cc: Suren Baghdasaryan Cc: Vlastimil Babka Cc: --- mm/cma.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mm/cma.c b/mm/cma.c index 0035efb1130a..f61d52796f4e 100644 --- a/mm/cma.c +++ b/mm/cma.c @@ -381,6 +381,8 @@ static int __init cma_fixed_reserve(phys_addr_t base, phys_addr_t size) return -EBUSY; } + accept_memory(base, size); + return 0; }