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 057E0C27C76 for ; Sat, 28 Jan 2023 17:40:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233781AbjA1Rky (ORCPT ); Sat, 28 Jan 2023 12:40:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37112 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234900AbjA1Rkg (ORCPT ); Sat, 28 Jan 2023 12:40:36 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 66CE72C648; Sat, 28 Jan 2023 09:40:00 -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 5BD46B80B83; Sat, 28 Jan 2023 17:39:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 80EB3C433D2; Sat, 28 Jan 2023 17:39:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1674927581; bh=a+5QZf9cRg0N2ZzfrrrGF2H31LP1zc5XIp+raVH9xP4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bCOcZ4V9XDkJ5wWljeWU20Sde8cDhpniyQvi/aZWm1g2Y7jlYc4p11fL5Ie+we9ye CP8+Nluu5rOSahshmseQnNNFzEGH39khv+vGHVqcvkAvVZ4O6i41qg6FZFkpHwpdoa cvB4Jv/tlRWg5YxXtIpYv1g/ZU987OyFHVY4KeJJfKHmws9hJnSIFRamg4oOC+ZiOA /WcqKlKqc4hT3XrZTe8GH2BDWqzFPSyYORVkwvGNcuFM90s2z5VRvFbq7rbbw0D1ep SI7ZL1nI5C6B12p7Qso3JURdQQ6rZs2rxKSpqmnfPTFiU/TTxA9RhyYF37hmGR9ilm IK+0MTYUX1ptw== From: Jisheng Zhang To: Palmer Dabbelt , Paul Walmsley , Albert Ou , Anup Patel , Atish Patra , Heiko Stuebner , Andrew Jones , Conor Dooley Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, kvm-riscv@lists.infradead.org Subject: [PATCH v5 06/13] riscv: fpu: switch has_fpu() to riscv_has_extension_likely() Date: Sun, 29 Jan 2023 01:28:49 +0800 Message-Id: <20230128172856.3814-7-jszhang@kernel.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230128172856.3814-1-jszhang@kernel.org> References: <20230128172856.3814-1-jszhang@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Switch has_fpu() from static branch to the new helper riscv_has_extension_likely(). Signed-off-by: Jisheng Zhang Reviewed-by: Andrew Jones Reviewed-by: Heiko Stuebner Reviewed-by: Conor Dooley --- 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; } -- 2.38.1