Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp9751181rwl; Wed, 11 Jan 2023 09:27:42 -0800 (PST) X-Google-Smtp-Source: AMrXdXsAunl3IWXo/X8E78mQUn6Lry5bkieC97zzW2GNYeVX1xemAsYBDubbYeOnif/Gu9JD6Zx2 X-Received: by 2002:a17:902:7089:b0:192:549b:97c3 with SMTP id z9-20020a170902708900b00192549b97c3mr3007407plk.42.1673458062493; Wed, 11 Jan 2023 09:27:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673458062; cv=none; d=google.com; s=arc-20160816; b=L4aeWmA9vmgOUdvL9Qn4v6N/LolSITAszJkeOjuy85C1a9iAdvQh+LzB3NdLW8VwL2 QRAe+igDNRcrSI1pQ7nDFbR9FKpwHF/k6+zcUk2DCJaRztitoYNSX36wvC8UeONrsqQ1 9BdOs33MXpKFAxK/6o/WjO//f+DpMGcJ3vRkn0wdQe0I5NIwpz7lW/hfkig7gYzA99ry 6Sx7yWXHAlZtRVFzCJN3Hu5tVQhTFlaz5qphvCEVcxsEllqhZM+zpgpDUu6shczse8Gg F/8khpxHsOy+kJNI4HeeuDXCwWnAlTtFSxlMD9KYNEKf891YTJFQm9HFoURaFT9amD0B YBSg== 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=NvNXzoVwX2zGq2mKLiZOcFUL6u3VF6Y8C/dSc+qNGD0=; b=yvV1kuCF3ngrwa6YjbOzrS7I1VkRRZOHiDXqjprfsK9rXi1NxBDIG1gy6pnU46Bh2O YLdzRFrn0AXWxQfJ9jXBia3A8HIJQ8gcSgCji57VFslXlyOgeg0bCc102M5r4/OkmLkj uwdRO8khHKy/YnJtvTlwNrHP5LP+9OG50wGnKhupB+evyOx3uIkkSUqfjUI95BxpPLOy 08FVZiru7rJHBecjjYucELk7JS+OgBJjduF5bMqHM18eVeHGONIHiAY0kDDA8i+iKjd7 tOrqxDcoO3oNIfij/c/BHaJPyrOGr0uXxt7JG3cQpKXoPrLbHX/GFeJ4oi/2bffyKtvj DWDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=u1gsJ0Zp; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q23-20020a170902b11700b001932c1921c4si9252102plr.410.2023.01.11.09.27.35; Wed, 11 Jan 2023 09:27:42 -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=u1gsJ0Zp; 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 S239284AbjAKRVg (ORCPT + 51 others); Wed, 11 Jan 2023 12:21:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49658 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238284AbjAKRVK (ORCPT ); Wed, 11 Jan 2023 12:21:10 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D47D3164B7; Wed, 11 Jan 2023 09:21:09 -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 85B1AB81B79; Wed, 11 Jan 2023 17:21:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C764EC433F1; Wed, 11 Jan 2023 17:21:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1673457667; bh=ZZbNK1MSY8P4rukKkUHVGmvzf9kfXc1zq+8A+JZHFy4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=u1gsJ0ZpyP7xSdrHXOtzajlWsoeDRdoq0kC7WCc/j084lmL33+LWIDjc8kZ+DBFAv 7V7nETI9PWsBz6XDcxxpXogkfBxx4BXKXdSuUV8R2mGo5RzRfucP5qxNl5xl5SKDbU AfKARehtE7S77bev8DMfOL5Q367VEFp2vXobvBxiRTVyM+5fvgExVytYF6gVj99vFM wIVEcf2E7iGhjtxCfzW7Hbqvi1Aw8dKOHgz8o9H1N5X9IU+xpz2M89sxgPfAI4oCHv ny6h3H9ejIT1bKEDqADSEYemvJkq/HGJuVSUfTZzyPcFnfQ9U/wxXA3OYLUiv29dRM GfCO2qYI7uyVw== From: Jisheng Zhang To: Paul Walmsley , Palmer Dabbelt , Albert Ou , Anup Patel , Atish Patra , Heiko Stuebner Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, kvm-riscv@lists.infradead.org, Andrew Jones Subject: [PATCH v3 07/13] riscv: fpu: switch has_fpu() to riscv_has_extension_likely() Date: Thu, 12 Jan 2023 01:10:21 +0800 Message-Id: <20230111171027.2392-8-jszhang@kernel.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230111171027.2392-1-jszhang@kernel.org> References: <20230111171027.2392-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: X-Mailing-List: linux-kernel@vger.kernel.org Switch has_fpu() from statich branch to the new helper riscv_has_extension_likely(). Signed-off-by: Jisheng Zhang Reviewed-by: Andrew Jones Reviewed-by: Heiko Stuebner --- 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