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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8E240C4332F for ; Sun, 4 Dec 2022 21:52:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230356AbiLDVwR (ORCPT ); Sun, 4 Dec 2022 16:52:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33864 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229949AbiLDVwQ (ORCPT ); Sun, 4 Dec 2022 16:52:16 -0500 Received: from gloria.sntech.de (gloria.sntech.de [185.11.138.130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 27B0A101C0; Sun, 4 Dec 2022 13:52:14 -0800 (PST) Received: from ip5b412258.dynamic.kabel-deutschland.de ([91.65.34.88] helo=diego.localnet) by gloria.sntech.de with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1p1wu6-0006zx-3Y; Sun, 04 Dec 2022 22:52:06 +0100 From: Heiko =?ISO-8859-1?Q?St=FCbner?= To: Palmer Dabbelt , Paul Walmsley , Albert Ou , Anup Patel , Atish Patra , Andrew Jones , Jisheng Zhang Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, kvm-riscv@lists.infradead.org, Conor Dooley Subject: Re: [PATCH v2 02/13] riscv: move riscv_noncoherent_supported() out of ZICBOM probe Date: Sun, 04 Dec 2022 22:52:03 +0100 Message-ID: <5629547.DvuYhMxLoT@diego> In-Reply-To: <20221204174632.3677-3-jszhang@kernel.org> References: <20221204174632.3677-1-jszhang@kernel.org> <20221204174632.3677-3-jszhang@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Am Sonntag, 4. Dezember 2022, 18:46:21 CET schrieb Jisheng Zhang: > It's a bit weird to call riscv_noncoherent_supported() each time when > insmoding a module. Move the calling out of feature patch func. > > Signed-off-by: Jisheng Zhang > Reviewed-by: Andrew Jones > Reviewed-by: Conor Dooley > --- > arch/riscv/kernel/cpufeature.c | 1 - > arch/riscv/kernel/setup.c | 2 ++ > 2 files changed, 2 insertions(+), 1 deletion(-) > > diff --git a/arch/riscv/kernel/cpufeature.c b/arch/riscv/kernel/cpufeature.c > index c743f0adc794..364d1fe86bea 100644 > --- a/arch/riscv/kernel/cpufeature.c > +++ b/arch/riscv/kernel/cpufeature.c > @@ -274,7 +274,6 @@ static bool __init_or_module cpufeature_probe_zicbom(unsigned int stage) > if (!riscv_isa_extension_available(NULL, ZICBOM)) > return false; > > - riscv_noncoherent_supported(); > return true; > } > > diff --git a/arch/riscv/kernel/setup.c b/arch/riscv/kernel/setup.c > index 86acd690d529..6eea40bf8c6b 100644 > --- a/arch/riscv/kernel/setup.c > +++ b/arch/riscv/kernel/setup.c > @@ -300,6 +300,8 @@ void __init setup_arch(char **cmdline_p) > riscv_init_cbom_blocksize(); > riscv_fill_hwcap(); > apply_boot_alternatives(); > + if (riscv_isa_extension_available(NULL, ZICBOM)) > + riscv_noncoherent_supported(); hmm, this changes the behaviour slightly. In the probe function there is the if (!IS_ENABLED(CONFIG_RISCV_ISA_ZICBOM)) return false; at the top, so with this change the second WARN_TAINT in arch_setup_dma_ops will behave differently Heiko