Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp2056957rwb; Sun, 15 Jan 2023 08:30:32 -0800 (PST) X-Google-Smtp-Source: AMrXdXtBBIniGhjHXbQAdSONOiC9eywp0oZVDvpviTSLwO79NcyP+Mm+/Jms3ybpCcYO/Mk9l9gO X-Received: by 2002:a05:6402:1cce:b0:472:1b3b:35f1 with SMTP id ds14-20020a0564021cce00b004721b3b35f1mr96551676edb.21.1673800231948; Sun, 15 Jan 2023 08:30:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673800231; cv=none; d=google.com; s=arc-20160816; b=LwM3tE23tTfXoPC3yknXXZFp9HbZ5moKnBIrY2VJG2rilyeWJiRnzIUywVVde0rD7C VynxqmDN85YBBuDiL2okbUulh23ag0JPCj5jDBVuyDi4jKwoxT5c4Ga58rJnirnk5xgy v8VKNDhU5/OkoPxkGC0YB5tCppOYupxC8x/m2lcE25ndO9xw7rN3rLKJE780xrKBochb mape3rLu9+JGk6PMTXQdMnD1uvRu8qeTUoyt58xASTNQ53PSJ6SipgMyIQuXuhEliH/x TA3lRh6cY+he7+bGD7umMdJpvpf9uZZkPo4G2HodTaX0m0p2Uc31Rpyg36vJsxLwkgGH /L+g== 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=lFz/KRjkijXC9iN3WExh7D+L6Y0+YBXVWQTLuoYUrOY=; b=PsrTkUO43SfMrP8oiCqLUiptFyAyfp4LjqOX0HSS2S3PREwRW46hRY3DP1rihZX9R6 JTFiTazdm1cMb6odAaiChS7QrqQS9cXH+nSB5ksJlyDUI8dW3rISHjbuxXI9I2QCuNar K9Yu808i7lrEDCxhIA8tIxe/gvIhAuoCG3EKKINnqTyprvx+Me7sERSTr3SksVyAHTCI +IIzvPiRK8ZLNoU+IL0A5nd/UHxbqZDnTDV4VGf+Zz/2iU1QMpwJhqQ5Skb2SEM50oDz so6dAnq+6t03ILd0xlH3rPkAz9z1PzYKwub0zTvy7vJWR4RSydD3pys0qA3Cq+kX8sNs JPSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="pQqMj/xH"; 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 i10-20020a05640242ca00b0049e160ce989si1406201edc.306.2023.01.15.08.30.19; Sun, 15 Jan 2023 08:30:31 -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="pQqMj/xH"; 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 S231406AbjAOQDL (ORCPT + 52 others); Sun, 15 Jan 2023 11:03:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59630 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231574AbjAOQCb (ORCPT ); Sun, 15 Jan 2023 11:02:31 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9DAF512F0B; Sun, 15 Jan 2023 08:01:04 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 9063360DB7; 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 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 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. */ -- 2.38.1