From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A66E736D500 for ; Thu, 20 Nov 2025 21:40:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763674827; cv=none; b=dcVZoDeogkiv9PHvDOkJETzYQ9J/hOCix3D2Y5OelX6teKf5Siggx+TMlGQr3Q75//TO41h1ki9PrluQQVOz4QwE0RSNYKJ0M5Mj7M84y0oRhQcHW2Z03mbitNjGiO7eDzMzSpYb7luJRjuTE1GYpBaM+Bcu5qDrFGJfIRUcqLI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763674827; c=relaxed/simple; bh=5VcSJF0iFC4W64s42MPIkzt01vEkzBggUtR96d28QXU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=dXaE9yOnEyGOYDOskazCJj/O2PXdhWLa2h21SFzoMy3bx2QIm0GGlgYdo+osim9tkTSLf0W1dLQrHgy4AuL8OBfE/cm3g3TOv6k6wpiAWwpHd4gb94aeLM5QE6GrqYDEXW4HNhltD9lRN9dUhKUkB9p1S82eszxbn+uFDiyTIjE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 4C48F339; Thu, 20 Nov 2025 13:40:17 -0800 (PST) Received: from arm.com (usa-sjc-mx-foss1.foss.arm.com [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id A7A103F63F; Thu, 20 Nov 2025 13:40:23 -0800 (PST) Date: Thu, 20 Nov 2025 21:40:21 +0000 From: Catalin Marinas To: Randy Dunlap Cc: Conor Dooley , linux-arm-kernel@lists.infradead.org, Conor Dooley , Jonathan Cameron , Will Deacon , linux-kernel@vger.kernel.org, Arnd Bergmann Subject: Re: [PATCH v1] arm64, lib: make ARM64 select ARCH_HAS_CPU_CACHE_INVALIDATE_MEMREGION not GENERIC_CPU_CACHE_MAINTENANCE Message-ID: References: <20251119-zippy-distinct-1e2a7da7b69b@spud> <20251120-ruined-liability-9ecbf53affd1@spud> <669d4bbb-4011-493c-b056-34e682a1ac26@infradead.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <669d4bbb-4011-493c-b056-34e682a1ac26@infradead.org> 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. -- Catalin