mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Mikołaj Lenczewski" <miko.lenczewski@arm.com>
To: Ryan Roberts <ryan.roberts@arm.com>
Cc: suzuki.poulose@arm.com, yang@os.amperecomputing.com,
	corbet@lwn.net, catalin.marinas@arm.com, will@kernel.org,
	jean-philippe@linaro.org, robin.murphy@arm.com, joro@8bytes.org,
	akpm@linux-foundation.org, ardb@kernel.org, mark.rutland@arm.com,
	joey.gouly@arm.com, maz@kernel.org, james.morse@arm.com,
	broonie@kernel.org, oliver.upton@linux.dev, baohua@kernel.org,
	david@redhat.com, ioworker0@gmail.com, jgg@ziepe.ca,
	nicolinc@nvidia.com, mshavit@google.com, jsnitsel@redhat.com,
	smostafa@google.com, linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, iommu@lists.linux.dev
Subject: Re: [PATCH v5 3/3] arm64/mm: Elide tlbi in contpte_convert() under BBML2
Date: Thu, 3 Apr 2025 08:28:01 +0000	[thread overview]
Message-ID: <20250403082801.GA14239@mazurka.cambridge.arm.com> (raw)
In-Reply-To: <fc505d3f-8ee4-40ed-8b8e-9e1c07b21fe1@arm.com>

On Thu, Apr 03, 2025 at 09:14:43AM +0100, Ryan Roberts wrote:
> On 25/03/2025 05:36, Mikołaj Lenczewski wrote:
> > diff --git a/arch/arm64/mm/contpte.c b/arch/arm64/mm/contpte.c
> > index 55107d27d3f8..77ed03b30b72 100644
> > --- a/arch/arm64/mm/contpte.c
> > +++ b/arch/arm64/mm/contpte.c
> > @@ -68,7 +68,8 @@ static void contpte_convert(struct mm_struct *mm, unsigned long addr,
> >  			pte = pte_mkyoung(pte);
> >  	}
> >  
> > -	__flush_tlb_range(&vma, start_addr, addr, PAGE_SIZE, true, 3);
> > +	if (!system_supports_bbml2_noabort())
> > +		__flush_tlb_range(&vma, start_addr, addr, PAGE_SIZE, true, 3);
> >  
> >  	__set_ptes(mm, start_addr, start_ptep, pte, CONT_PTES);
> 
> Despite all the conversation we had about completely eliding the TLBI for the
> BBML2 case, I've continued to be a bit uneasy about it. I had another chat with
> Alex C and we concluded that it is safe, but there could be conceivable
> implementations where it is not performant. Alex suggested doing a TLBI without
> the DSB and I think that's a good idea. So after the __set_ptes(), I suggest adding:
> 
> 	if (system_supports_bbml2_noabort())
> 		__flush_tlb_range_nosync(mm, start_addr, addr, PAGE_SIZE,
> 					 true, 3);
> 
> That will issue the TLBI but won't wait for it to complete. So it should be very
> fast. We are guranteed correctness immediately. We are guranteed performance
> after the next DSB (worst-case; next context switch).
> 
> Thanks,
> Ryan

Hi Ryan,

Sure, perfectly happy to add that on. Will respin and add a note about
this behaviour to the source code and to the patch / cover letter.

-- 
Kind regards,
Mikołaj Lenczewski

      reply	other threads:[~2025-04-03  8:28 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-25  9:36 [PATCH v5 0/3] Initial BBML2 support for contpte_convert() Mikołaj Lenczewski
2025-03-25  9:36 ` [PATCH v5 1/3] arm64: Add BBM Level 2 cpu feature Mikołaj Lenczewski
2025-03-25 11:06   ` Suzuki K Poulose
2025-04-03  8:15   ` Ryan Roberts
2025-03-25  9:36 ` [PATCH v5 2/3] iommu/arm: Add BBM Level 2 smmu feature Mikołaj Lenczewski
2025-03-25  9:36 ` [PATCH v5 3/3] arm64/mm: Elide tlbi in contpte_convert() under BBML2 Mikołaj Lenczewski
2025-04-01 13:38   ` David Hildenbrand
2025-04-03  8:14   ` Ryan Roberts
2025-04-03  8:28     ` Mikołaj Lenczewski [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=20250403082801.GA14239@mazurka.cambridge.arm.com \
    --to=miko.lenczewski@arm.com \
    --cc=akpm@linux-foundation.org \
    --cc=ardb@kernel.org \
    --cc=baohua@kernel.org \
    --cc=broonie@kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=corbet@lwn.net \
    --cc=david@redhat.com \
    --cc=iommu@lists.linux.dev \
    --cc=ioworker0@gmail.com \
    --cc=james.morse@arm.com \
    --cc=jean-philippe@linaro.org \
    --cc=jgg@ziepe.ca \
    --cc=joey.gouly@arm.com \
    --cc=joro@8bytes.org \
    --cc=jsnitsel@redhat.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=maz@kernel.org \
    --cc=mshavit@google.com \
    --cc=nicolinc@nvidia.com \
    --cc=oliver.upton@linux.dev \
    --cc=robin.murphy@arm.com \
    --cc=ryan.roberts@arm.com \
    --cc=smostafa@google.com \
    --cc=suzuki.poulose@arm.com \
    --cc=will@kernel.org \
    --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®