Skip to contentSkip to conversation

FAILED: patch "[PATCH] mm/cma: accept memory of CMA areas reserved at a fixed address" failed to apply to 6.12-stable tree

PATCH New Sasha Levin 1 participant 2 messages Nov 10 – Nov 14

Subsystems (3)
lore
Share & tools
lore

Sasha Levin

author maintainer
#0 lore raw

The patch below does not apply to the 6.12-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.

To reproduce the conflict and resubmit, you may use the following commands:

git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.12.y
git checkout FETCH_HEAD
git cherry-pick -x f8f9cbc34a309a388c052706f3329d1b52985aa3
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '[email protected]' --subject-prefix 'PATCH 6.12.y' 'HEAD^..'

Thanks,
Sasha

------------------ original commit in Linus's tree ------------------

From f8f9cbc34a309a388c052706f3329d1b52985aa3 Mon Sep 17 00:00:00 2001
From: "Mike Rapoport (Microsoft)" <[email protected]>
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=<size>@<base> 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.

Fixes 75d090fd167a ("x86/tdx: Add unaccepted memory support")
Cc David Hildenbrand <[email protected]>
Cc Liam R. Howlett <[email protected]>
Cc Lorenzo Stoakes <[email protected]>
Cc Michal Hocko <[email protected]>
Cc Suren Baghdasaryan <[email protected]>
Cc Vlastimil Babka <[email protected]>
---
 mm/cma.c | 2 ++
 1 file changed, 2 insertions(+)
mm/cma.c +2 -0
index 0035efb1130a5..f61d52796f4ef 100644
@@ -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;
 }
 
Signature · 1 line
2.53.0
author maintainer
#1 lore raw

PATCH 1/1 mm/cma: accept memory of CMA areas reserved at a fixed address

From: "Mike Rapoport (Microsoft)" <[email protected]>

[ Upstream commit f8f9cbc34a309a388c052706f3329d1b52985aa3 ]

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=<size>@<base> 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.

Fixes 75d090fd167a ("x86/tdx: Add unaccepted memory support")
Cc David Hildenbrand <[email protected]>
Cc Liam R. Howlett <[email protected]>
Cc Lorenzo Stoakes <[email protected]>
Cc Michal Hocko <[email protected]>
Cc Suren Baghdasaryan <[email protected]>
Cc Vlastimil Babka <[email protected]>
[ sashal: placed accept_memory() directly in cma_declare_contiguous_nid() because cma_fixed_reserve() is absent ]
---
 mm/cma.c | 2 ++
 1 file changed, 2 insertions(+)
mm/cma.c +2 -0
index 2d9fae9392835..4a0616bb12b77 100644
@@ -313,6 +313,8 @@ int __init cma_declare_contiguous_nid(phys_addr_t base,
 			ret = -EBUSY;
 			goto err;
 		}
+
+		accept_memory(base, size);
 	} else {
 		phys_addr_t addr = 0;
 
Signature · 1 line
2.53.0