From patchwork Sun Jan 15 15:49:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jisheng Zhang X-Patchwork-Id: 13102322 X-Patchwork-Delegate: palmer@dabbelt.com 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 03B3EC63797 for ; Sun, 15 Jan 2023 16:01:09 +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:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=5+5GaLkvbYgfWgRSFHwm7EAwxgzv5a2u+AiWtG6aAJg=; b=eks5OrSbkdCwjV YaSmpgBl7W1jIS6/Cm6ll5ohoCNZgrWY/PwVIVulWke8W2wbjb0n3budPpFEJqboend0oJVHjQTX9 TTKaoZNrAj/frOsc1bpiggUxwqBAz1XRhWqcYE58IX4wR0Hy0zdU4X7FgZULUUvsObP2K02KH4gP6 gZ7PwkKctB6z+O9ZArj23QLbKBGrvMH1Dyp9KPYzluElhsgy56gHgADhWOC3D0h6kYpY2us/Ru+t+ dPFZYVHvVNM0qHJFcF/YWX+cTv//b4kIgB7T/c+2iZJxh1Zj6kzLxr0nYiFII2+S2ERelm8boflKn dxJxi8e0SbFTogypUaGw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pH5RK-007cGt-QA; Sun, 15 Jan 2023 16:00:58 +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 1pH5RA-007c3D-0x; Sun, 15 Jan 2023 16:00:50 +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 8CBC160DB4; Sun, 15 Jan 2023 16:00:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 44865C433F0; Sun, 15 Jan 2023 16:00:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1673798447; bh=s7J/q6ens2rvlMJbJ7trLTcT6RXo2JnK5jMkTSfRtMo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pQqMj/xHEQwbw+5FY9+0PCbjT5rLLxbuoK4DmTfSFXurT3Rag8x+BAzog2vcqFeMw 6U2jKpV0OwE4QfTGaQkyCUdJUMf/73j6xR93psfXCrVvbfPpeAw6LkSz0A4GRX64tr aG3tyewFjywmsFtWBDriVSfzmUCXUg8LCDH+7KKYecXx6XJx6HJdLhyKbTyx29Wa5p onS52FZ6zDvxHF6VCjAI17qmsX2pvjfYuH9B2MjfQlHay5FcUtZSc0bJuBErg5EdiV 8isVTjjJyTfBZ54y3Wlv7uOd4b6aGOQLFDi/k/RuCiohdrq67LB7z5yGqvMaH1XsKj At9z/v8HpdVaw== From: Jisheng Zhang To: Paul Walmsley , Palmer Dabbelt , Albert Ou , Anup Patel , Atish Patra , Heiko Stuebner , Conor Dooley , Andrew Jones Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, kvm-riscv@lists.infradead.org, Guo Ren Subject: [PATCH v4 11/13] riscv: cpu_relax: switch to riscv_has_extension_likely() Date: Sun, 15 Jan 2023 23:49:51 +0800 Message-Id: <20230115154953.831-12-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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230115_080048_146186_B36F1D32 X-CRM114-Status: GOOD ( 11.89 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Switch cpu_relax() 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: Guo Ren Reviewed-by: Conor Dooley --- arch/riscv/include/asm/vdso/processor.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/riscv/include/asm/vdso/processor.h b/arch/riscv/include/asm/vdso/processor.h index fa70cfe507aa..edf0e25e43d1 100644 --- a/arch/riscv/include/asm/vdso/processor.h +++ b/arch/riscv/include/asm/vdso/processor.h @@ -10,7 +10,7 @@ static inline void cpu_relax(void) { - if (!static_branch_likely(&riscv_isa_ext_keys[RISCV_ISA_EXT_KEY_ZIHINTPAUSE])) { + if (!riscv_has_extension_likely(RISCV_ISA_EXT_ZIHINTPAUSE)) { #ifdef __riscv_muldiv int dummy; /* In lieu of a halt instruction, induce a long-latency stall. */