Message ID | 20230115154953.831-8-jszhang@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp800884wrn; Sun, 15 Jan 2023 08:03:22 -0800 (PST) X-Google-Smtp-Source: AMrXdXvdpSf97dvbcwEf+GNKUsUOZh+c1WYB0i9rexp/RkbN+K3P3bp5W0zfz+lnG7rlLLzh36K5 X-Received: by 2002:a17:907:2177:b0:86e:55f5:4c1c with SMTP id rl23-20020a170907217700b0086e55f54c1cmr4406172ejb.45.1673798602359; Sun, 15 Jan 2023 08:03:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673798602; cv=none; d=google.com; s=arc-20160816; b=IVn9ojK7qrJVMWRIAnY5YfNDqfArCdZTmqmclJhWzQeWI+RbvPHXig8+nmmMoDOzbY TxcSe2s8fFYCQs/owd5ZYbwgafCL8wWYuBJA8heV5GkggUNGfWsIgcVPMzKl7IcKejjy 3wOBeny317tkcx0/yaOACeEUdJ38GI5mtX1K6A1B3xK5M6Rkt0fDsc5lxayQwq304SyK kCJMVMI5B4hFgWv5/MfE+Wyfu0HuU8/CrviojL4UhVGGCc6pr1C/7+rA5/zDqtckxUSj UVAw0v/kBZiF/r4w8W62zjlwCZsV7zZ7knWbHPZFKQLmu+2ApX8CinuGlII0RcL631sD mYtw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=UUZCMDHT9ow9f6aA9hMHHMel+k/ZbW5eVbimycB0uhA=; b=xW4T/Fg35dGgtQpTAEE0Q4df+p0amvy58tXlnmJrqEChFTnTjtQNtINin1uOx6mP0w itCBUFcvMVjzgm4ewobAIkXKsqSlLbjA5P4sYAce5WScBAjU/KB5rn/O68EmKY1Vx05F 9wnDrtQifFn8EuDpB1JXu0njWpFcOVg7/907sxm71H/O/Ed3qRP+q3bc6k3gT6xi38yR ip7wPPIpoeDjq3RpO2QlOKlhWKztCdk0itp87x3QzGdL/LvM/9BQ4gloGYu69CsGD+dE mebVpPuWPJvnhYZ031ZVrmwNDtMmq5q65cPGBOraRKw4iNWEOhsh69/fnmSjB4Vpra6O SHdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=eeATq3Ge; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qw11-20020a1709066a0b00b008318885e1ddsi2706495ejc.616.2023.01.15.08.02.59; Sun, 15 Jan 2023 08:03:22 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=eeATq3Ge; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231500AbjAOQCN (ORCPT <rfc822;stefanalexe802@gmail.com> + 99 others); Sun, 15 Jan 2023 11:02:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59880 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231480AbjAOQBF (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sun, 15 Jan 2023 11:01:05 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7F7861352F; Sun, 15 Jan 2023 08:00:36 -0800 (PST) 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 ams.source.kernel.org (Postfix) with ESMTPS id 227FAB80B8B; Sun, 15 Jan 2023 16:00:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4123CC433D2; Sun, 15 Jan 2023 16:00:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1673798433; bh=a+5QZf9cRg0N2ZzfrrrGF2H31LP1zc5XIp+raVH9xP4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eeATq3GeOjDCnHtOuIlblgyo54bNCI8Be+rNhdZO3EH1ekeEJDMyGH66ChnMB+NWj I+ZhDDI8WeAibt7FSddSrGJuVDOdYgIVjVL8tfnyZ+h5JWyxroyMQOMIqrxpE1uO2Y l2EGhswWLUQM0+iDWNaX1hM7+KjMIx10mq5JVRhs7x+1iVddB9DLhpryCAsh+XaSLB tLjBCyWIXEpy8OuKgl+/a7qYz7DgQeJ9ssf9IosOGNqVsevHbCxuqLhCqoUSa1PveT mO71cZVCTOxn7pDzuJKFU4seP2uSYCYyx0FJS+EdPP54bTlJBKtb5jyz8lqJa2QIEh pHrgbTj3v8z7w== From: Jisheng Zhang <jszhang@kernel.org> To: Paul Walmsley <paul.walmsley@sifive.com>, Palmer Dabbelt <palmer@dabbelt.com>, Albert Ou <aou@eecs.berkeley.edu>, Anup Patel <anup@brainfault.org>, Atish Patra <atishp@atishpatra.org>, Heiko Stuebner <heiko@sntech.de>, Conor Dooley <conor.dooley@microchip.com>, Andrew Jones <ajones@ventanamicro.com> Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, kvm-riscv@lists.infradead.org Subject: [PATCH v4 07/13] riscv: fpu: switch has_fpu() to riscv_has_extension_likely() Date: Sun, 15 Jan 2023 23:49:47 +0800 Message-Id: <20230115154953.831-8-jszhang@kernel.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230115154953.831-1-jszhang@kernel.org> References: <20230115154953.831-1-jszhang@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1755105043215287477?= X-GMAIL-MSGID: =?utf-8?q?1755105043215287477?= |
Series |
riscv: improve boot time isa extensions handling
|
|
Commit Message
Jisheng Zhang
Jan. 15, 2023, 3:49 p.m. UTC
Switch has_fpu() from static branch to the new helper riscv_has_extension_likely(). Signed-off-by: Jisheng Zhang <jszhang@kernel.org> Reviewed-by: Andrew Jones <ajones@ventanamicro.com> Reviewed-by: Heiko Stuebner <heiko@sntech.de> Reviewed-by: Conor Dooley <conor.dooley@microchip.com> --- arch/riscv/include/asm/switch_to.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/arch/riscv/include/asm/switch_to.h b/arch/riscv/include/asm/switch_to.h index 11463489fec6..60f8ca01d36e 100644 --- a/arch/riscv/include/asm/switch_to.h +++ b/arch/riscv/include/asm/switch_to.h @@ -59,7 +59,8 @@ static inline void __switch_to_aux(struct task_struct *prev, static __always_inline bool has_fpu(void) { - return static_branch_likely(&riscv_isa_ext_keys[RISCV_ISA_EXT_KEY_FPU]); + return riscv_has_extension_likely(RISCV_ISA_EXT_f) || + riscv_has_extension_likely(RISCV_ISA_EXT_d); } #else static __always_inline bool has_fpu(void) { return false; }