Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp567206rwl; Wed, 12 Apr 2023 00:28:33 -0700 (PDT) X-Google-Smtp-Source: AKy350ZesZT82PNrKzC4UfzbC1Uyl9jt3VdaAzVchUUKOTXWKz4KQHT6ORJeUthcE/Wd8sAnLVvO X-Received: by 2002:a05:6a20:6528:b0:d8:d18d:60ae with SMTP id n40-20020a056a20652800b000d8d18d60aemr14874390pzg.7.1681284512769; Wed, 12 Apr 2023 00:28:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681284512; cv=none; d=google.com; s=arc-20160816; b=ky/1l839mAdMfbDVKxHMUHU91OXwhpeSnAhzJpSz2R6uTlHA7wKoPE/Z00Yc6oWWkj ZBpg7Y6vD7OQRQfWhLVA7FZKvaObU5rp9Ef1jTHUgWbQ4HRvpv2Jke0tXZDDlUVlD6MD FdIbOTiDt0oqzaMK4h+BZPajDmS+BEnz3k+RibvC53PAl+MmrxqptckDJZrrU7KiDUEM Lplq8OqnX2Ey6jCIsmuzBtwVrGzcB0kV6Ry0xMxx6zcNek85+lxkSBdlqKEKzO5F+kPO TN7xqOEZU63zMnrL3newRsKMrO/r0NnX5NsLkc25OvHx/XaYgVJBSOi7I0scil0HpY4G UmSQ== 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=xuie8NtKYX1RBrsCdfsoeY9+pVxP16ycviKocgp4ebk=; b=sCi/Ckvln/UN/kyd7fP/NMr0LAFF+Nr2zfE/AvIQFuXI0+eI7jzoZ7aUZSMP+SkY5z +T2miiLycTTVqzIVFFdKrTzn5fa3U2yujgWDpu3hFv+h8EwL4M+iZVADaowpkvNYcb/E Cmj5WiU54jGxIA6EUCM6fQg/5bs/p70prC9mmtju11NfiF6J/PszMFEKAZt2tWYEMCDb IOOq+16SYeFKPYbHdfd05IrQtonqEUT7sUxwQFLUTbpz+VDgSkf6vpcG4SVDsunbj+7K jr9IV7yQYNaJoI+15lNoCkfBzh7m43Zovm5HND6bALVrBicNVm/lUgCbCWnr9q47nMPV EdsA== 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 i10-20020a65484a000000b004fca80d4647si15228001pgs.216.2023.04.12.00.28.20; Wed, 12 Apr 2023 00:28:32 -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 S229576AbjDLHSd (ORCPT + 99 others); Wed, 12 Apr 2023 03:18:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45738 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229458AbjDLHSb (ORCPT ); Wed, 12 Apr 2023 03:18:31 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id CC75FF1 for ; Wed, 12 Apr 2023 00:18:26 -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 D6E49D75; Wed, 12 Apr 2023 00:19:10 -0700 (PDT) Received: from pierre123.nice.arm.com (pierre123.nice.arm.com [10.34.100.129]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id B7E273F73F; Wed, 12 Apr 2023 00:18:24 -0700 (PDT) From: Pierre Gondois To: linux-kernel@vger.kernel.org Cc: Radu Rendec , Alexandre Ghiti , Conor Dooley , Will Deacon , Pierre Gondois , Greg Kroah-Hartman , "Rafael J. Wysocki" , Sudeep Holla , Palmer Dabbelt , Gavin Shan Subject: [PATCH v2 0/3] cacheinfo: Correctly fallback to using clidr_el1's information Date: Wed, 12 Apr 2023 09:18:03 +0200 Message-Id: <20230412071809.12670-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 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 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. Pierre Gondois (3): cacheinfo: Check sib_leaf in cache_leaves_are_shared() cacheinfo: Check cache properties are present in DT cacheinfo: Add use_arch[|_cache]_info field/function drivers/base/cacheinfo.c | 48 +++++++++++++++++++++++++++++++++++---- include/linux/cacheinfo.h | 11 +++++++++ 2 files changed, 55 insertions(+), 4 deletions(-) -- 2.25.1