Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp9767986rwl; Wed, 11 Jan 2023 09:40:00 -0800 (PST) X-Google-Smtp-Source: AMrXdXtIk4RnoEeYZqIwkJYNs5LuZ3mz8MKVGXTORb3Am6PBFFgAnaP9GB1/+nEivuYnfMpDsysC X-Received: by 2002:a05:6a20:bb11:b0:a5:7e02:4e0 with SMTP id fc17-20020a056a20bb1100b000a57e0204e0mr3220024pzb.3.1673458800684; Wed, 11 Jan 2023 09:40:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673458800; cv=none; d=google.com; s=arc-20160816; b=D40SOuVCbKxx0Pj2iqNNDMKbo0sxVynx8omRrn5N+tsWm8/Yxq0Tsn1dhBn4wrwvtA RytAd7ZGwHGcQh49F3fNLxT5vpCdNI0SGzni6kp+q6mcZ/h6p2IlYwv7k31OObCX0+3F qJ0wDenzAoTHE+HiAmCvqjGI01nS8vzIWtEIbDp3BX4s4IzQZDd8LtZSBOsIyizmGmFR YbeLsWPZgHMWvi9/7DJ5XhNxX2QVGrcjejfQ43RhXOrMdM6eFcO3wKG9qf2F7at/BYne xrWXe7vrFhBR1oJNYsRARS4KEO3bWed4QgfXDkKFMOAk1Z04KHjNzt8JJEhTkMFLBiQ7 ppyw== 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=j2TXOjSg9GHoRYtj2R6+T7ltrHIgYveRtt15PcJBKI4=; b=RPbTeHFRj3zxv1PDaNhXq9hDk11GT+nGaPq1vuVRTqh3EhU/b1qCHRa0dJBwmCmARp QdBRJ0ymMq84Go/5XVkQRyV8RwjU22fwmt2QT1p3MwRGqxA9LiUvJKBXP6x6nuUp1Bp+ oNVG8S/RxdwfSNSx6oWioqWuFJiwMnxaTZy86fzDU112voqwCu3Ols03BoYeh7ol/4Om fQJDyIKl91lru/ci8hIksC6Jt/gXu+y89U0Y2gVG09sMrYTHBz9qnH9k+8tmOjNFpiYX VnMfFOjOnBPNVg5svbe8mwfJHeHk1G2VwfQh33bp5IfgqTSQnACC+7XwfZMHWXmWsVdG SKNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="KKs/0/VF"; 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 e16-20020a170903241000b001892c399f03si14135802plo.365.2023.01.11.09.39.54; Wed, 11 Jan 2023 09:40:00 -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="KKs/0/VF"; 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 S232768AbjAKRV5 (ORCPT + 51 others); Wed, 11 Jan 2023 12:21:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49740 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234813AbjAKRVV (ORCPT ); Wed, 11 Jan 2023 12:21:21 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 987B3165BC; Wed, 11 Jan 2023 09:21:20 -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 316D561D89; Wed, 11 Jan 2023 17:21:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C0EE5C433F2; Wed, 11 Jan 2023 17:21:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1673457679; bh=An7932QyRN88UCepeRWQ6p08wUO6xw7m46s6odwiow0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KKs/0/VFSvU2SnllZ+uG+nxnYXbVkIe8lRcr3KSHKo6td8KIyNPrEPYX+QoGpC/0v IEbh7jBwyWqO20/l1BHxElXPwMPMBVvoezH1TdXTGQoiHcIwGQpsHFy0v3rlQqddgY By77PW+uxHCcFntfWDM/+0mG7/riTiw+S30o/6l2ZOJUBQO0YoFdFC9aEcmFfeRvmM bJTABO8ubZBVg0mlVot9/EPqeoJcuk/QIINFGIiQ/ueeC+sMXAXsIOSDWnLhZ/2L5J irN93MKeyPBSmq6NGqqcrtZ2sLqS2WNNOmDUEKlKjfKfsxSz/V8vsHWLrURyC51ALz y0y3ESvmyldoA== 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 , Guo Ren Subject: [PATCH v3 11/13] riscv: cpu_relax: switch to riscv_has_extension_likely() Date: Thu, 12 Jan 2023 01:10:25 +0800 Message-Id: <20230111171027.2392-12-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 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 --- 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