From: Mike Rapoport <rppt@kernel.org>
To: "Gupta, Pankaj" <pankaj.gupta@amd.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
David Hildenbrand <david@kernel.org>,
Kiryl Shutsemau <kas@kernel.org>,
"Liam R. Howlett" <liam@infradead.org>,
Lorenzo Stoakes <ljs@kernel.org>, Michal Hocko <mhocko@suse.com>,
Suren Baghdasaryan <surenb@google.com>,
Vlastimil Babka <vbabka@kernel.org>,
linux-kernel@vger.kernel.org, linux-mm@kvack.org,
stable@vger.kernel.org
Subject: Re: [PATCH 1/2] mm/cma: accept memory of multi-range CMA areas
Date: Thu, 29 Oct 2026 14:19:53 +0200 [thread overview]
Message-ID: <auM56dTOXCb70vzz@kernel.org> (raw)
In-Reply-To: <a25827d8-83ee-4e05-8c55-4e6ca8a498ad@amd.com>
On Thu, Oct 29, 2026 at 11:52:53AM +0100, Gupta, Pankaj wrote:
>
> > 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
in the kernel command line will do the trick.
> Thanks,
>
> Pankaj
>
> >
> > Fixes: c009da4258f9 ("mm, cma: support multiple contiguous ranges, if requested")
> > Cc: stable@vger.kernel.org
> > Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
> > ---
> > mm/cma.c | 2 ++
> > 1 file changed, 2 insertions(+)
> >
> > diff --git a/mm/cma.c b/mm/cma.c
> > index a10ea37a261da..0035efb1130a5 100644
> > --- a/mm/cma.c
> > +++ b/mm/cma.c
> > @@ -678,6 +678,8 @@ int __init cma_declare_contiguous_multi(phys_addr_t total_size,
> > break;
> > }
> > + accept_memory(mlp->base, size);
> > +
> > pr_debug("created region %d: %016llx - %016llx\n",
> > nr, (u64)mlp->base, (u64)mlp->base + size);
> > cmrp = &cma->ranges[nr++];
> >
--
Sincerely yours,
Mike.
next prev parent reply other threads:[~2026-10-29 12:20 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-29 10:18 [PATCH 0/2] mm/cma: accept memory of CMA areas reserved with memblock_reserve() Mike Rapoport (Microsoft)
2026-10-29 10:18 ` [PATCH 1/2] mm/cma: accept memory of multi-range CMA areas Mike Rapoport (Microsoft)
2026-10-29 10:52 ` Gupta, Pankaj
2026-10-29 12:19 ` Mike Rapoport [this message]
2026-10-29 10:18 ` [PATCH 2/2] mm/cma: accept memory of CMA areas reserved at a fixed address Mike Rapoport (Microsoft)
2026-10-29 12:27 ` [PATCH 0/2] mm/cma: accept memory of CMA areas reserved with memblock_reserve() Kiryl Shutsemau
2026-10-29 12:40 ` Mike Rapoport
2026-10-29 13:17 ` Kiryl Shutsemau
2026-10-29 15:03 ` Mike Rapoport
2026-10-29 15:39 ` Kiryl Shutsemau
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=auM56dTOXCb70vzz@kernel.org \
--to=rppt@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=david@kernel.org \
--cc=kas@kernel.org \
--cc=liam@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=ljs@kernel.org \
--cc=mhocko@suse.com \
--cc=pankaj.gupta@amd.com \
--cc=stable@vger.kernel.org \
--cc=surenb@google.com \
--cc=vbabka@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.