FAILED: patch "[PATCH] mm/cma: accept memory of CMA areas reserved at a fixed address" failed to apply to 6.6-stable tree
Subsystems (3)
Sasha Levin
maintainerThe patch below does not apply to the 6.6-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.6.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.6.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.
--- mm/cma.c | 2 ++ 1 file changed, 2 insertions(+)
mm/cma.c +2 -0
@@ -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
Sasha Levin
maintainerPATCH 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.
--- mm/cma.c | 2 ++ 1 file changed, 2 insertions(+)
mm/cma.c +2 -0
@@ -318,6 +318,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
Re: [PATCH 6.6.y] mm/cma: accept memory of CMA areas reserved at a fixed address
mm/cma.c int __init cma_declare_contiguous_nid(phys_addr_t base, · line 325
Quoted 13 lines · Sasha Levin
mm/cma.c +2
-0@@ -318,6 +318,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 ;
NAK.
accept_memory() takes (start, end) in 6.6. It was converted to (start, size) in 6.12. See 5adfeaecc487 ("mm: rework accept memory helpers"). Here size is taken as the end address. For the usual cma=<size>@<base>, base is above size and nothing gets accepted, so the bug stays.
The 6.12.y backport is fine as is.
Correct backport for 6.6.y:
-- >8 --
From: "Mike Rapoport (Microsoft)" <[email protected]>
Subject: [PATCH 6.6.y] 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.
(cherry picked from commit f8f9cbc34a309a388c052706f3329d1b52985aa3) [ kas: 6.6 has no cma_fixed_reserve(); accept the area in the fixed-address
branch of cma_declare_contiguous_nid(). accept_memory() takes (start, end) in this tree, it was converted to (start, size) in 6.12 ]
--- mm/cma.c | 2 ++ 1 file changed, 2 insertions(+)
mm/cma.c +2 -0
@@ -318,6 +318,8 @@ int __init cma_declare_contiguous_nid(phys_addr_t base, ret = -EBUSY ; goto err; } + +accept_memory (base, base + size); }else {phys_addr_t addr =0 ;
Signature · 1 line
Kiryl Shutsemau / Kirill A. Shutemov
Sasha Levin
maintainerRe: [PATCH 6.6.y] mm/cma: accept memory of CMA areas reserved at a fixed address
Quoted 5 lines · Kiryl Shutsemau (Meta)
accept_memory()takes (start, end) in 6.6. It was converted to (start, size) in 6.12. See5adfeaecc487("mm: rework accept memory helpers"). Here size is taken as the end address. For the usual cma=<size>@<base>, base is above size and nothing gets accepted, so the bug stays.
The copy in the 6.6 queue is not the one that was posted. It already calls accept_memory(base, base + size), see queue-6.6/mm-cma-accept-memory-of-cma-areas-reserved-at-a-fixe.patch and its "[
sashal: ... ]" note.
The 6.12 copy passes (base, size), matching the 6.12 signature, as you say.
Signature · 2 lines
Thanks, Sasha