Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp2780883rwl; Mon, 27 Mar 2023 05:20:46 -0700 (PDT) X-Google-Smtp-Source: AKy350baefFwGm6tdbVfhDOQnEjrh/oWSiY/pmPxjD6t30VrKhVWx/rgAfFgpPQGCSwkRshPRp+0 X-Received: by 2002:a17:907:8c0e:b0:930:bc07:3bf7 with SMTP id ta14-20020a1709078c0e00b00930bc073bf7mr13695832ejc.5.1679919646635; Mon, 27 Mar 2023 05:20:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679919646; cv=none; d=google.com; s=arc-20160816; b=MuKe6vpnOiqpUSqBGHAGR9ejvJYTP/83BSaxMa2HULLg0S9w0qar4Gk5fhPFwlG1t0 jwmr+0alvZga1giCUSNSys7wUKbEq6rOGPd5shT/gpBX/fVORXVtvvVM2gurxuuuzYkA u1IdUtqhWAncYhDOfckZLNbDgeog3FpiMtFYZPSDWMz5FeMcvVgyUnRiYebLkGm+Rx1C sB7zrTsBt9070ePjzCBtc0aXl5jr5uAbT6TPTdsYWBL+SxZ9J+JpQX3DfOWvDZZcsr3i l2Y2c7MgOjDT39EjkLya3uAD8JRmPzN+bhMep9iFSUQSf7r6ngO+mHvJGkprNmPk0PN+ /7aA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=bP7xlyl2hu4N1sJB8eXOX8AthGHTFYpX9/lwBGTlLN0=; b=EFZRs1VZRqpwx1LZEUgKMS4HZE03EJfVeoGW50Xd2ejS9FMHvi2mwba3HXD0qT3iru 22oAT/rHwl1Yt4IfZmfKUe7xhdKU86Y9SqjhguzK46S2lBRMO30bR+cW1+qKFS/9uxpL Aqc9r6K6/ckTWvuVtW9rqIMc1/qRjxoFPpEP10keyIn3DJL3Ers6kYnZDIU/DeuEFrGL BxuAP704Ab++sQIhbEpp42Jj1lLBsJCENnbLqRq3Vrvu/SGarOWNoRaQ3hrfSkgVd+Jw /RKaz6kRzpAbaWCsxU5lV1qaBqpoKIVX6hvu5LZ2avJmWFk9M/K3zXTvOfKMRRQRiIUB S1KQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=K3KExgvB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f21-20020a17090631d500b0093195cf7f14si26254559ejf.797.2023.03.27.05.20.22; Mon, 27 Mar 2023 05:20:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=K3KExgvB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232865AbjC0MUG (ORCPT + 99 others); Mon, 27 Mar 2023 08:20:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45244 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230107AbjC0MTv (ORCPT ); Mon, 27 Mar 2023 08:19:51 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 444B86EA6 for ; Mon, 27 Mar 2023 05:17:43 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id AA28DB8118C for ; Mon, 27 Mar 2023 12:17:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 25CD6C433D2; Mon, 27 Mar 2023 12:17:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1679919461; bh=8F7QuYtpfLMxudvEc2UVzK8oJdfABOssMctt035/R6Y=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=K3KExgvBsPxXtPX+VC0N2a7KnIspWj4/twfMbAF949S+JDq5VnihcfFE48DsON2t5 bkH95HsSncB6DLn/XqaM7mUtKZ6ROvhtNVF5qk8oKBFuF0AJoAOE/469MBmC1SYo9R bEnJ3GfnXNPuxrjYgIJnV/N7a+J7Q17ympwDCmPw+rIJ8TbvZFirNkZ6wUwSS/SieE 4WvFXIVl6Qfm1Hc/jUAbif6ogBmWQMYUjOGEqqCF4LYjuZURxUaUnCSTm/XwpWENEN qejn3ZTFyPPCSxWskkRTl5uvSzi3gMsV342oCFZt8U7b6fk1J6t3OnI7eZ1Qn2rJN6 nKhQGYOzIKHqA== Date: Mon, 27 Mar 2023 13:17:35 +0100 From: Will Deacon To: Pierre Gondois 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 Subject: Re: [PATCH 3/3] cacheinfo: Add use_arch[|_cache]_info field/function Message-ID: <20230327121734.GB31342@willie-the-truck> References: <20230327115953.788244-1-pierre.gondois@arm.com> <20230327115953.788244-4-pierre.gondois@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230327115953.788244-4-pierre.gondois@arm.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-5.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Will