Received: by 2002:a05:6358:53a8:b0:117:f937:c515 with SMTP id z40csp210301rwe; Fri, 14 Apr 2023 01:16:55 -0700 (PDT) X-Google-Smtp-Source: AKy350ZBQCi1ckQ9Qr08ytYjayE4GAVkKZJ7r4aiDBuQx9kgVjhgTMsYnT64xcX1tbkzue44wRIx X-Received: by 2002:a17:903:2305:b0:1a6:a6e7:8846 with SMTP id d5-20020a170903230500b001a6a6e78846mr121693plh.40.1681460215338; Fri, 14 Apr 2023 01:16:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681460215; cv=none; d=google.com; s=arc-20160816; b=Swsag6Pblmk8odzbAP8izxXDz2nGSxJ29C7s636hz7D4BHUPrIOTLzggltBOe7xjFJ wbQMs6KbjRKz4qJh1xCfU1Axe/HmYUDzF8AHQVTVYd/ZpjP9H6zf5ocpcxkjOKVugRfa ppDtlE7bjPyV3IszG0cLXY9/nOeawdUHD5Ld4oCc5NwKscAlST0npyxc/QPNL+4GReT/ nvc7KG7jiARIx3/W+wtLnsZL795TbOsFmSQvjdnCnccWyz0Wjfd/WRVn0RDrto0OsDQR s6wx13RjQpbe8edoN/gXni+8tdkGGkVYAcm+XMXsIVq4e2rJaxDsi1btaQwG6CRK1T5c KB4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=RrnUNVsSt05ZH8nBRquoyWC7XxIGa66TzuSIiVHmc8E=; b=0Pg6goWG5pcbSTNbrOENbcyK4I7RXqH+0/BffImgLElSMThaJmePpgmcWu8983SyBN sOvXEm9gvyfNq7Al6LEg866qfJLsJSWA1Z7saUsz/3TfAgYgYB8gASxbBN0IcvWsqFFI 67g7TZB666JtyX8ZD/0D2C1dmCPTGEJGMfZZU3RxclbAw8j0sJA08A9hcoE0t+yxKflP Vt/RJSjamQ/xH8QW4b5ZikbSz+wV69NmXHepcoDfewxRzVSmGmehPZR/Q5RmeVJDJvRp zyXDrDehS1uoGbjeRVnL4TRFJ1RGfKK2Uqwvvlfsq4mdzUu0Wv914hXu+qosnMzRs05h i18w== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k5-20020a170902c40500b001a183ade8f7si4610300plk.433.2023.04.14.01.16.41; Fri, 14 Apr 2023 01:16:55 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230036AbjDNIPc (ORCPT + 99 others); Fri, 14 Apr 2023 04:15:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53236 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229967AbjDNIPX (ORCPT ); Fri, 14 Apr 2023 04:15:23 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 509AF30EA for ; Fri, 14 Apr 2023 01:15:22 -0700 (PDT) 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 7B00B2F4; Fri, 14 Apr 2023 01:16:06 -0700 (PDT) Received: from pierre123.arm.com (unknown [10.57.19.162]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 9B9553F6C4; Fri, 14 Apr 2023 01:15:17 -0700 (PDT) From: Pierre Gondois To: linux-kernel@vger.kernel.org Cc: Radu Rendec , Alexandre Ghiti , Conor Dooley , Will Deacon , Florian Fainelli , Pierre Gondois , Sudeep Holla , Greg Kroah-Hartman , "Rafael J. Wysocki" , Palmer Dabbelt , Gavin Shan Subject: [PATCH v4 0/4] cacheinfo: Correctly fallback to using clidr_el1's information Date: Fri, 14 Apr 2023 10:14:48 +0200 Message-Id: <20230414081453.244787-1-pierre.gondois@arm.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham 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 v4: arch_topology: Remove early cacheinfo error message: - Only remove the error message if the error code is -ENOENT cacheinfo: Add use_arch[|_cache]_info field/function: - Use a static variable instead of a per-leaf 'use_arch_info' - Reformat the use_arch_cache_info() define v3: cacheinfo: Check sib_leaf in cache_leaves_are_shared(): - Reformulate commit message - Fix rebase issue and move '&&' condition which was in the last patch to this patch. cacheinfo: Add use_arch[|_cache]_info field/function: - Put the function declaration in one line. arch_topology: Remove early cacheinfo error message: - New patch. v2: cacheinfo: Check sib_leaf in cache_leaves_are_shared() - Reformulate commit message - Add 'Fixes: f16d1becf96f ("cacheinfo: Use cache identifiers [...]' cacheinfo: Check cache properties are present in DT - Use of_property_present() - Add 'Reported-by: Alexandre Ghiti ' cacheinfo: Add use_arch[|_cache]_info field/function: - Make use_arch_cache_info() a static inline function The cache information can be extracted from either a Device Tree (DT), the PPTT ACPI table, or arch registers (clidr_el1 for arm64). When the DT is used but no cache properties are advertised, the current code doesn't correctly fallback to using arch information. Correct this. Also use the assumption that L1 data/instruction caches are private and L2/higher caches are shared when the cache information is coming form clidr_el1. As suggested by Alexandre, this serie should ideally go to 6.3 fixes. Pierre Gondois (4): cacheinfo: Check sib_leaf in cache_leaves_are_shared() cacheinfo: Check cache properties are present in DT arch_topology: Remove early cacheinfo error message if -ENOENT cacheinfo: Add use_arch[|_cache]_info field/function drivers/base/arch_topology.c | 7 +++--- drivers/base/cacheinfo.c | 49 ++++++++++++++++++++++++++++++++---- include/linux/cacheinfo.h | 6 +++++ 3 files changed, 54 insertions(+), 8 deletions(-) -- 2.25.1