[PATCH v1] arm64, lib: make ARM64 select ARCH_HAS_CPU_CACHE_INVALIDATE_MEMREGION not GENERIC_CPU_CACHE_MAINTENANCE

Conor Dooley conor at kernel.org
Thu Nov 20 11:29:59 PST 2025


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!

> 
> Maybe what gets confusing here is that the core code uses
> ARCH_HAS_CPU_CACHE_INVALIDATE_MEMREGION directly. A more involved fix
> would be something like:
> 
> config CPU_CACHE_INVALIDATE_MEMREGION
> 	def_bool y
> 	depends on ARCH_HAS_CPU_CACHE_INVALIDATE_MEMREGION ||
> 		GENERIC_CPU_CACHE_MAINTENANCE
> 
> and then go and change all the uses of
> ARCH_HAS_CPU_CACHE_INVALIDATE_MEMREGION.
> 
> Up to you, the current code also works for me.
> 
> -- 
> Catalin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20251120/23be78f5/attachment.sig>


More information about the linux-arm-kernel mailing list