linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
To: Randy Dunlap <rdunlap@infradead.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>,
	Conor Dooley <conor@kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	Conor Dooley <conor.dooley@microchip.com>,
	Will Deacon <will@kernel.org>, <linux-kernel@vger.kernel.org>,
	Arnd Bergmann <arnd@arndb.de>, <wangyushan12@huawei.com>
Subject: Re: [PATCH v1] arm64, lib: make ARM64 select ARCH_HAS_CPU_CACHE_INVALIDATE_MEMREGION not GENERIC_CPU_CACHE_MAINTENANCE
Date: Fri, 21 Nov 2025 10:48:27 +0000	[thread overview]
Message-ID: <20251121104827.00005033@huawei.com> (raw)
In-Reply-To: <a6fff5b6-7e7f-4883-b905-500d55dbf21e@infradead.org>

On Thu, 20 Nov 2025 15:25:46 -0800
Randy Dunlap <rdunlap@infradead.org> wrote:

> On 11/20/25 1:40 PM, Catalin Marinas wrote:
> > On Thu, Nov 20, 2025 at 12:13:10PM -0800, Randy Dunlap wrote:  
> >> On 11/20/25 11:29 AM, Conor Dooley wrote:  
> >>> On Thu, Nov 20, 2025 at 05:30:46PM +0000, Catalin Marinas wrote:  
> >>>> On Wed, Nov 19, 2025 at 07:08:27PM +0000, Conor Dooley wrote:  
> >>>>> index 09aec4a1e13f..ac223e627bc5 100644
> >>>>> --- a/lib/Kconfig
> >>>>> +++ b/lib/Kconfig
> >>>>> @@ -544,8 +544,9 @@ config ARCH_HAS_CPU_CACHE_INVALIDATE_MEMREGION
> >>>>>  	bool
> >>>>>  
> >>>>>  config GENERIC_CPU_CACHE_MAINTENANCE
> >>>>> -	bool
> >>>>> -	select ARCH_HAS_CPU_CACHE_INVALIDATE_MEMREGION
> >>>>> +	def_bool y
> >>>>> +	depends on ARCH_HAS_CPU_CACHE_INVALIDATE_MEMREGION
> >>>>> +	depends on ARM64  
> >>>>
> >>>> That's what we do if GENERIC_CPU_CACHE_MAINTENANCE depends on some arch
> >>>> code but that's not the case here. GENERIC_CPU_CACHE_MAINTENANCE is an
> >>>> alternative implementation that an arch can select if it does not
> >>>> provide its own. I find the current code without the above patch better.  
> >>>
> >>> Right, I am going to leave it as-is for now then. That's both you and I
> >>> (and presumably Jonathan) finding the current form more natural. Sorry
> >>> Randy!  
> >>
> >> Thanks. I tried.
> >>
> >> I still say that it makes no sense for something generic
> >> (GENERIC_CPU_CACHE_MAINTENANCE in lib/Kconfig) to inform the
> >> config system that the config has something $ARCH-specific
> >> (ARCH_HAS_CPU_CACHE_INVALIDATE_MEMREGION).  
> > 
> > Yes, that's not great either but the solution with the GENERIC depending
> > on ARCH does work since there's no actual dependency between them.
> > 
> > As an alternative, I'm happy for arm64 to select both the ARCH and
> > GENERIC options if you think that works better.
> >   
> 
> Yes, I think that would be much better.
> Thanks.
> 

I'm fine with that as well (was where we were in earlier versions).
I'm offline for 10 days from tomorrow, but wangyushan +CC has been heavily
involved in this series throughout if we need to test anything etc.

For a patch that is basically just (this to me seems fine to squash
as well if that is easier)

Acked-by: Jonathan Cameron <jonathan.cameron@huawei.com>


diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index 893e0af0bc51..b4507eeabc4c 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -20,6 +20,7 @@ config ARM64
        select ARCH_ENABLE_SPLIT_PMD_PTLOCK if PGTABLE_LEVELS > 2
        select ARCH_ENABLE_THP_MIGRATION if TRANSPARENT_HUGEPAGE
        select ARCH_HAS_CACHE_LINE_SIZE
+       select ARCH_HAS_CPU_CACHE_INVALIDATE_MEMREGION
        select ARCH_HAS_CC_PLATFORM
        select ARCH_HAS_CURRENT_STACK_POINTER
        select ARCH_HAS_DEBUG_VIRTUAL
diff --git a/lib/Kconfig b/lib/Kconfig
index e11136d188ae..2923924bea78 100644
--- a/lib/Kconfig
+++ b/lib/Kconfig
@@ -544,7 +544,6 @@ config ARCH_HAS_CPU_CACHE_INVALIDATE_MEMREGION

 config GENERIC_CPU_CACHE_MAINTENANCE
        bool
-       select ARCH_HAS_CPU_CACHE_INVALIDATE_MEMREGION

 config ARCH_HAS_MEMREMAP_COMPAT_ALIGN
        bool

If not I'm guessing no one will mind too much if we tidy this up post or
late in merge window.

Thanks,

Jonathan




  reply	other threads:[~2025-11-21 10:48 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-19 19:08 [PATCH v1] arm64, lib: make ARM64 select ARCH_HAS_CPU_CACHE_INVALIDATE_MEMREGION not GENERIC_CPU_CACHE_MAINTENANCE Conor Dooley
2025-11-19 21:22 ` Randy Dunlap
2025-11-20 17:30 ` Catalin Marinas
2025-11-20 19:29   ` Conor Dooley
2025-11-20 20:13     ` Randy Dunlap
2025-11-20 21:40       ` Catalin Marinas
2025-11-20 23:25         ` Randy Dunlap
2025-11-21 10:48           ` Jonathan Cameron [this message]
2025-11-21 18:44             ` Conor Dooley

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=20251121104827.00005033@huawei.com \
    --to=jonathan.cameron@huawei.com \
    --cc=arnd@arndb.de \
    --cc=catalin.marinas@arm.com \
    --cc=conor.dooley@microchip.com \
    --cc=conor@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rdunlap@infradead.org \
    --cc=wangyushan12@huawei.com \
    --cc=will@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).