From mboxrd@z Thu Jan 1 00:00:00 1970 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 4CB7FC433F5 for ; Wed, 18 May 2022 07:11:25 +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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=2VvQLq4qBbccgKCLu8cYMOW6R5r5zlmJ6uKAXt0+BbY=; b=q59cJSJ1zJ1icZ 8oHEwaxll6f6cSFxoJpWG77By7LqSAOxZzv01r3a1jfhQRuEV8PLdIXlZ0zuGLa++3eT1Eos3PG4E xgkq/fjBUHI5QPnStGI4w+oe9EMbbYpAqmdTptKhAjsIxJCNHLrNyYfcXJvVkMn2Xi+belQ0bo+CC yx5j2L0Ei+mHsMYfdq/BYqW09t95e5Dz52i/yvvCEJz7n0pgZuL/dUx68bbVnzzctpBBP9vaKXSCA x6aXXqaxuC7UQt6G7VyvlvDGU7y/YEOxoWit5A1xD69X7zum2jap9+iVTOH7Ey+T3+LpznX80sByI fvEjyLUMiEJClcDnvQ/A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nrDol-00HZS9-Fs; Wed, 18 May 2022 07:09:59 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nrDoi-00HZQ8-37 for linux-arm-kernel@lists.infradead.org; Wed, 18 May 2022 07:09:57 +0000 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 dfw.source.kernel.org (Postfix) with ESMTPS id 5B67A60EC8; Wed, 18 May 2022 07:09:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 44A7CC385A5; Wed, 18 May 2022 07:09:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1652857794; bh=2JqqIZvpbqswCTRP/bzbvdehB+RQl291QgBbPVeUz5A=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Pp6SO/TKxrZNHvldAOjrKknX9j4MOMm00eEc1bfMfTaRIqoiHbCk/9Ay0O4pYErpz 4WdOW/iMxXaSM20je3wnFPC3Rgm/JmcjW14O0UwKCfuPKAz+kyEFtfveeT5pwRSsYI CO9ObRCJkU7czDbnU3B4Uu/unhdj0DhMD4BhO25o= Date: Wed, 18 May 2022 09:09:52 +0200 From: Greg KH To: Kohei Tarumizu Subject: Re: [PATCH v4 5/8] arm64: Create cache sysfs directory without ACPI PPTT for hardware prefetch control Message-ID: References: <20220518063032.2377351-1-tarumizu.kohei@fujitsu.com> <20220518063032.2377351-6-tarumizu.kohei@fujitsu.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220518063032.2377351-6-tarumizu.kohei@fujitsu.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220518_000956_237799_7C52E682 X-CRM114-Status: GOOD ( 24.63 ) 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: , Cc: rafael@kernel.org, peterz@infradead.org, catalin.marinas@arm.com, linus.walleij@linaro.org, dave.hansen@linux.intel.com, conor.dooley@microchip.com, hpa@zytor.com, will@kernel.org, mchehab+huawei@kernel.org, x86@kernel.org, mingo@redhat.com, eugenis@google.com, arnd@arndb.de, bp@alien8.de, tglx@linutronix.de, pcc@google.com, linux-arm-kernel@lists.infradead.org, marcos@orca.pet, tony.luck@intel.com, marcan@marcan.st, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, May 18, 2022 at 03:30:29PM +0900, Kohei Tarumizu wrote: > Create a cache sysfs directory without ACPI PPTT if the > CONFIG_HWPF_CONTROL is true. > > Hardware prefetch control driver need cache sysfs directory and cache > level/type information. In ARM processor, these information can be > obtained from the register even without PPTT. > > This patch set the cpu_map_populated to true if the machine doesn't > have PPTT. It use only the level/type information obtained from > CLIDR_EL1, and don't use CCSIDR information. > > Signed-off-by: Kohei Tarumizu > --- > arch/arm64/kernel/cacheinfo.c | 29 +++++++++++++++++++++++++++++ > 1 file changed, 29 insertions(+) > > diff --git a/arch/arm64/kernel/cacheinfo.c b/arch/arm64/kernel/cacheinfo.c > index 587543c6c51c..039ec32d0b3d 100644 > --- a/arch/arm64/kernel/cacheinfo.c > +++ b/arch/arm64/kernel/cacheinfo.c > @@ -43,6 +43,21 @@ static void ci_leaf_init(struct cacheinfo *this_leaf, > this_leaf->type = type; > } > > +#if defined(CONFIG_HWPF_CONTROL) Please do not put #if in .c files. > +static bool acpi_has_pptt(void) > +{ > + struct acpi_table_header *table; > + acpi_status status; > + > + status = acpi_get_table(ACPI_SIG_PPTT, 0, &table); > + if (ACPI_FAILURE(status)) > + return false; > + > + acpi_put_table(table); > + return true; > +} > +#endif > + > int init_cache_level(unsigned int cpu) > { > unsigned int ctype, level, leaves, fw_level; > @@ -95,5 +110,19 @@ int populate_cache_leaves(unsigned int cpu) > ci_leaf_init(this_leaf++, type, level); > } > } > + > +#if defined(CONFIG_HWPF_CONTROL) > + /* > + * Hardware prefetch functions need cache sysfs directory and cache > + * level/type information. In ARM processor, these information can be > + * obtained from registers even without PPTT. Therefore, we set the > + * cpu_map_populated to true to create cache sysfs directory, if the > + * machine doesn't have PPTT. > + **/ > + if (!acpi_disabled) > + if (!acpi_has_pptt()) > + this_cpu_ci->cpu_map_populated = true; > +#endif Same here, no #if is needed if you do it properly in your .h file. thanks, greg k-h _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel