From: Will Deacon <will@kernel.org>
To: Dev Jain <dev.jain@arm.com>
Cc: Yang Shi <yang@os.amperecomputing.com>,
ryan.roberts@arm.com, cl@gentwo.org, catalin.marinas@arm.com,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] arm64: mm: relax VM_ALLOW_HUGE_VMAP if BBML2_NOABORT is supported
Date: Thu, 30 Oct 2025 13:16:53 +0000 [thread overview]
Message-ID: <aQNlRQO7oXUcR84A@willie-the-truck> (raw)
In-Reply-To: <ceae80d4-ae63-4bf7-bf97-1d6b5b090aad@arm.com>
On Fri, Oct 17, 2025 at 09:20:10PM +0530, Dev Jain wrote:
> On 17/10/25 12:20 am, Yang Shi wrote:
> > On 10/14/25 11:50 PM, Dev Jain wrote:
> > > On 14/10/25 4:57 am, Yang Shi wrote:
> > > > When changing permissions for vmalloc area, VM_ALLOW_HUGE_VMAP area is
> > > > exclueded because kernel can't split the va mapping if it is called on
> > > > partial range.
> > > > It is no longer true if the machines support BBML2_NOABORT after commit
> > > > a166563e7ec3 ("arm64: mm: support large block mapping when
> > > > rodata=full").
> > > > So we can relax this restriction and update the comments accordingly.
> > > >
> > > > Fixes: a166563e7ec3 ("arm64: mm: support large block mapping
> > > > when rodata=full")
> > > > Signed-off-by: Yang Shi <yang@os.amperecomputing.com>
> > > > ---
> > > > arch/arm64/mm/pageattr.c | 13 +++++++------
> > > > 1 file changed, 7 insertions(+), 6 deletions(-)
> > > >
> > > > diff --git a/arch/arm64/mm/pageattr.c b/arch/arm64/mm/pageattr.c
> > > > index c21a2c319028..b4dcae6273a8 100644
> > > > --- a/arch/arm64/mm/pageattr.c
> > > > +++ b/arch/arm64/mm/pageattr.c
> > > > @@ -157,13 +157,13 @@ static int change_memory_common(unsigned
> > > > long addr, int numpages,
> > > > /*
> > > > * Kernel VA mappings are always live, and splitting live section
> > > > - * mappings into page mappings may cause TLB conflicts. This means
> > > > - * we have to ensure that changing the permission bits of
> > > > the range
> > > > - * we are operating on does not result in such splitting.
> > > > + * mappings into page mappings may cause TLB conflicts on
> > > > the machines
> > > > + * which don't support BBML2_NOABORT.
> > > > *
> > > > * Let's restrict ourselves to mappings created by vmalloc
> > > > (or vmap).
> > > > - * Disallow VM_ALLOW_HUGE_VMAP mappings to guarantee that
> > > > only page
> > > > - * mappings are updated and splitting is never needed.
> > > > + * Disallow VM_ALLOW_HUGE_VMAP mappings if the systems
> > > > don't support
> > > > + * BBML2_NOABORT to guarantee that only page mappings are
> > > > updated and
> > > > + * splitting is never needed on those machines.
> > > > *
> > > > * So check whether the [addr, addr + size) interval is entirely
> > > > * covered by precisely one VM area that has the VM_ALLOC
> > > > flag set.
> > > > @@ -171,7 +171,8 @@ static int change_memory_common(unsigned
> > > > long addr, int numpages,
> > > > area = find_vm_area((void *)addr);
> > > > if (!area ||
> > > > end > (unsigned long)kasan_reset_tag(area->addr) +
> > > > area->size ||
> > > > - ((area->flags & (VM_ALLOC | VM_ALLOW_HUGE_VMAP)) != VM_ALLOC))
> > > > + !(area->flags & VM_ALLOC) || ((area->flags &
> > > > VM_ALLOW_HUGE_VMAP) &&
> > > > + !system_supports_bbml2_noabort()))
> > > > return -EINVAL;
> > > > if (!numpages)
> > >
> > > This will conflict with my upcoming vmalloc-huge series, so best to
> > > leave it to me,
> > > I already have this included :)
> >
> > My point is that I hope this can be merged as a hotfix for 6.18. I have
> > no strong opinion on either the maintainers take this one or from your
> > series. But if this will go into 6.18 as a hotfix, it should be also a
> > prerequisite patch (standalone) in your series, and the rest of your
> > series should be based on top of it. Of course this argument will not
> > stand if we don't care to have it fixed for 6.18.
>
> I see what you mean, but I don't think this patch should be treated as a
> hotfix. We forgot to relax a
>
> restriction - that's fine. That is not an incorrectness in the linear map
> series. A fix usually
>
> fixes an incorrectness.
Right, unless there's a real functional issue that is affecting people
then I don't see the need to take any of this for 6.18.
Will
prev parent reply other threads:[~2025-10-30 13:16 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-13 23:27 [PATCH 0/2] Two minor fixes for BBML2_NOABORT Yang Shi
2025-10-13 23:27 ` [PATCH 1/2] arm64: mm: make linear mapping permission update more robust for patial range Yang Shi
2025-10-14 8:05 ` Ryan Roberts
2025-10-14 20:15 ` Yang Shi
2025-10-15 6:46 ` Dev Jain
2025-10-16 18:45 ` Yang Shi
2025-10-16 18:47 ` Dev Jain
2025-10-13 23:27 ` [PATCH 2/2] arm64: mm: relax VM_ALLOW_HUGE_VMAP if BBML2_NOABORT is supported Yang Shi
2025-10-14 8:08 ` Ryan Roberts
2025-10-14 20:23 ` Yang Shi
2025-10-15 6:50 ` Dev Jain
2025-10-16 18:50 ` Yang Shi
2025-10-17 15:50 ` Dev Jain
2025-10-30 13:16 ` Will Deacon [this message]
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=aQNlRQO7oXUcR84A@willie-the-truck \
--to=will@kernel.org \
--cc=catalin.marinas@arm.com \
--cc=cl@gentwo.org \
--cc=dev.jain@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ryan.roberts@arm.com \
--cc=yang@os.amperecomputing.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®