From patchwork Mon Mar 27 11:59:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre Gondois X-Patchwork-Id: 13189099 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 88D45C761A6 for ; Mon, 27 Mar 2023 12:01:22 +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-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=SSaJckmmThrik/FatyLP/KXjx5QF5nTnFAvTxOJ69s4=; b=k60VcqPyT1WN6V 9j7lz1L/hsOqRkNrZ9cQ2bMsg90XCHfaaq8So+TwW20NSB74/4sSJnr423CRDbRpgTf9Hbjb/ke/K 4gmHAKT/DeHhEPmOUTp5mqPKZQlRwx9cl1jSgOST6+79AYUQgbRQ0WoT+YT0/yBS5UKv8Ud5SQhnH i16Y/2SUuU+s3h8EQTJmXBLQZA63BjWpo3GUtxE1bdbhenYkpJlPa8EIGMXTnXTRspMsLQ3LAHvLE D5104encdgR0xukuxTqU8/FMo2eV0MQv3B+/tU7DpODGgtsaaBcPz7gLGXO33kWGGHB06YJX6/v9v iyTTv4jdyWGj86h6E0cA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pglWU-00AoVY-2z; Mon, 27 Mar 2023 12:00:26 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pglWR-00AoTC-1d for linux-arm-kernel@lists.infradead.org; Mon, 27 Mar 2023 12:00:25 +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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230327_050023_614949_C197D56C X-CRM114-Status: UNSURE ( 8.45 ) X-CRM114-Notice: Please train this message. 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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(-)