Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp2758638rwl; Mon, 27 Mar 2023 05:04:06 -0700 (PDT) X-Google-Smtp-Source: AKy350Ycu3Zj/sHjiC5rgQgafeRonUF49IvW5lKo4WmqIREjeNgAMirMkOEf7nyR8N+4ZH7JaSyC X-Received: by 2002:a17:907:a0b:b0:93e:739f:b0b3 with SMTP id bb11-20020a1709070a0b00b0093e739fb0b3mr13997919ejc.50.1679918646218; Mon, 27 Mar 2023 05:04:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679918646; cv=none; d=google.com; s=arc-20160816; b=AEy2N2NdVMZQU75KfQjAIJO/iTeRg1DEzBxtqZXpvYZYpUMtfx8f/GdSdpy41DnPCT En8irc9trcabMSaDA0Che7ZnnKL+wLtQ71i0F75DaKIYz4hVCOgxTMWTfMCCR68FK+zd IqEO87oZpejQLkeyvboLzJX9LOIVmbZdSlYrngCCzdZ9OF81qKFptlG9mHx++u1CwP7P 5IETfq6Avfitjnr4gfT9bqiFnqf7paXo2jQpbUCLpXzcbgsWbAJCA5XGTVwi1QeUp+5W 5pckijEPJhw8cwJOMcSz8xWU5m4sj7DvxO12j1g2n2LZiSHlMdIukpdrDHC360gXVVMC 7I4g== 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=FyCE/gG6RKpLcn50r43/hbbp8zoN/Aw+Yy6T5TBezCs=; b=yJECDDVZ/MnciHDUER1OwP9hyfG/bEB65BLD5SgvNgyje9+QXRouK0ajCjnG5ney93 6F0ScxMvXh2+h1VY7+otRVvF7/ZrrWpU+qRNcvzqeDp1V4sgadOoTV+dT8EMkwNOQ9xI Qx/2QAkLX6lgMjOKc1+tEJtitMlnwvVgQE92lOklZ8cHN8cyVIMbgWMn1CghtMv1g/Fk BQXpDylHPb6i/ppn/M7kfwCH2Z5N/y0qs3ABX5uTfccKafsPvzOa0iT/sh++aKI2hzqA 7htMOIlFPVQdvfrClGjUT2MJROJ6q8/As4tIQYfWBZUXxKcFoC534xsRSj4Z6W7QHVqA H0Gw== 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 ba15-20020a0564021acf00b00502259b5834si7531424edb.564.2023.03.27.05.03.40; Mon, 27 Mar 2023 05:04:06 -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 S232573AbjC0MAV (ORCPT + 99 others); Mon, 27 Mar 2023 08:00:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49276 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232574AbjC0MAT (ORCPT ); Mon, 27 Mar 2023 08:00:19 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 1BB2D1BE2 for ; Mon, 27 Mar 2023 05:00:19 -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 1154D4B3; Mon, 27 Mar 2023 05:01:03 -0700 (PDT) Received: from pierre123.arm.com (unknown [10.57.19.133]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 5897D3F663; Mon, 27 Mar 2023 05:00:16 -0700 (PDT) From: Pierre Gondois To: linux-kernel@vger.kernel.org Cc: Radu Rendec , Pierre Gondois , Catalin Marinas , Will Deacon , Greg Kroah-Hartman , "Rafael J. Wysocki" , Sudeep Holla , Jeremy Linton , Akihiko Odaki , Palmer Dabbelt , Gavin Shan , linux-arm-kernel@lists.infradead.org Subject: [PATCH 0/3] cacheinfo: Correctly fallback to using clidr_el1's information Date: Mon, 27 Mar 2023 13:59:48 +0200 Message-Id: <20230327115953.788244-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=-2.3 required=5.0 tests=RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE 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 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 arch/arm64/kernel/cacheinfo.c | 5 ++++ drivers/base/cacheinfo.c | 53 ++++++++++++++++++++++++++++++++--- include/linux/cacheinfo.h | 2 ++ 3 files changed, 56 insertions(+), 4 deletions(-) -- 2.25.1