From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C21BDC7618D for ; Thu, 6 Apr 2023 07:29:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To:Subject: MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=s3BHCBAGQxcAwHydMoQgJV8GunDAwigHi66uucFwRYc=; b=zCIiDj/2GnR+9k mDNyONXog0q5ecmF1Pik44mQhwtjjg6A31O5I+Nv3w6ubpKC3LDwKwMDub2csk58881kt7zWtKQm9 9hZTDtJsaSwGv8qpjjFGTjqjxi26o2cYdzWpNxMuSJJu0kzKxlkwuY8zPfMfQ24ZiVUSFIICsCTVP CYiIrtgpMwkKFf7IHVqwzzWGE1UaCZA/T2OiYJkzvGcf8K35L/WJo9CsRvoU7U5thAtSBmpNSrj/e d/iqb3d+2ZP58Xuy42/mX6oPe4Xmiug/j9mJIhZ4NJW7LjvI6qow40QaTJ0iSz9I+GxI0/S5xvvRd HB8UoycgeKKZTYQxPi1Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pkK3D-006cyS-0U; Thu, 06 Apr 2023 07:28:55 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pkK39-006cxX-3C for linux-arm-kernel@lists.infradead.org; Thu, 06 Apr 2023 07:28:53 +0000 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 F1CA316F8; Thu, 6 Apr 2023 00:29:29 -0700 (PDT) Received: from [192.168.1.12] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id B173A3F73F; Thu, 6 Apr 2023 00:28:42 -0700 (PDT) Message-ID: Date: Thu, 6 Apr 2023 09:28:32 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: [PATCH 3/3] cacheinfo: Add use_arch[|_cache]_info field/function Content-Language: en-US To: Will Deacon Cc: linux-kernel@vger.kernel.org, Radu Rendec , Catalin Marinas , Greg Kroah-Hartman , "Rafael J. Wysocki" , Sudeep Holla , Palmer Dabbelt , Oliver Upton , Akihiko Odaki , Gavin Shan , Conor Dooley , linux-arm-kernel@lists.infradead.org References: <20230327115953.788244-1-pierre.gondois@arm.com> <20230327115953.788244-4-pierre.gondois@arm.com> <20230327121734.GB31342@willie-the-truck> From: Pierre Gondois In-Reply-To: <20230327121734.GB31342@willie-the-truck> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230406_002852_101862_B084821B X-CRM114-Status: GOOD ( 17.99 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hello Will, On 3/27/23 14:17, Will Deacon wrote: > On Mon, Mar 27, 2023 at 01:59:51PM +0200, Pierre Gondois wrote: >> The cache information can be extracted from either a Device >> Tree (DT), the PPTT ACPI table, or arch registers (clidr_el1 >> for arm64). >> >> The clidr_el1 register is used only if DT/ACPI information is not >> available. It does not states how caches are shared among CPUs. >> >> Add a use_arch_cache_info field/function to identify when the >> DT/ACPI doesn't provide cache information. Use this information >> to assume L1 caches are privates and L2 and higher are shared among >> all CPUs. >> >> Signed-off-by: Pierre Gondois >> --- >> arch/arm64/kernel/cacheinfo.c | 5 +++++ >> drivers/base/cacheinfo.c | 20 ++++++++++++++++++-- >> include/linux/cacheinfo.h | 2 ++ >> 3 files changed, 25 insertions(+), 2 deletions(-) >> >> diff --git a/arch/arm64/kernel/cacheinfo.c b/arch/arm64/kernel/cacheinfo.c >> index c307f69e9b55..b6306cda0fa7 100644 >> --- a/arch/arm64/kernel/cacheinfo.c >> +++ b/arch/arm64/kernel/cacheinfo.c >> @@ -96,3 +96,8 @@ int populate_cache_leaves(unsigned int cpu) >> } >> return 0; >> } >> + >> +bool use_arch_cache_info(unsigned int cpu) >> +{ >> + return true; >> +} > > It would be a lot nicer if this was a static inline function in a header > rather than a weak symbol. I am not sure I see where the static inline function should be added. Do you prefer to have function like the following in include/linux/cacheinfo.h ? static inline bool use_arch_cache_info(unsigned int cpu) { #if defined(CONFIG_ARM64) return true; #else return false; #endif } Regards, Pierre > > Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel