Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp9746345rwl; Wed, 11 Jan 2023 09:23:53 -0800 (PST) X-Google-Smtp-Source: AMrXdXtuMCZtgyfHoWuhaFgzQzEYydCJVrQ5r2Lxrzv8a0EC2pmtvTImMZ9BLNQjTJMIFxEvF7wl X-Received: by 2002:a62:d45b:0:b0:582:218b:651e with SMTP id u27-20020a62d45b000000b00582218b651emr38634096pfl.32.1673457833610; Wed, 11 Jan 2023 09:23:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673457833; cv=none; d=google.com; s=arc-20160816; b=Uk2BbE8kcs+232KmnibFO2v8hrTCTYHIkVcsWvbd4ly7rSHilbjlU885BGYdTXzzu2 jvbpbeqrQwOoUKmHgQ1zdeBL2axvju611e8L0BRRWxYfOnifjVj6U2zq+9ZVk6foQHM8 tgHJKXWCz92PP9N6tWIrTqKiIpXJfcf6y4kZyeqNy5ArkYLlW6Z3wf0ud6tI41syn3jT /4imJCmYb4Db1Lchqw4PD5KBEbboh6JGkXGf5Dr9pecqSGIgJaVvwZb67ZsQFDRwWEHr igx/vmzOvS6G30ngSgavdzz5do30glh3Oe5Qe4xiUiIxyfatwtLuXImNjA9d1OhbbYqw Z4jQ== 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=71tniFPbKqGIsTxWv1hQIHxzzx/z+pgP7TynAXCuppk=; b=sLMr+nnRORAVrmTexn+IXyM3XpzI5jX2xrCZUsfX8HF/mUcDcBCZyhrG+csVkxN3SL myV2nGhaGPmMk08ZhN7KKPYVb9fSsCFy6NHN/5Pc0l00Box003aFc9dgLWYKjB2iN7XJ JpgXcS+uE7VfYSZ3tinoQwUBV9b6Q/7UJrvCud8XBByKJ9koiqO7e8zeNg8axb8fgP+n qSEyLgcELYZMjQmMue+JfQcUIcvnKREjfk/3mjB41c2XijGi9sLel6rcpz19gSKIAXoP g14KBef7vWJy3Ylgkf6tXzXFs/oyT0rTC7/facWLWZvWrN9SS63sp21CfvY8XBabpI1k MPBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=QyqAUwJG; 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 h12-20020a056a00230c00b00561898445bdsi15950536pfh.273.2023.01.11.09.23.46; Wed, 11 Jan 2023 09:23:53 -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=QyqAUwJG; 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 S239610AbjAKRWC (ORCPT + 51 others); Wed, 11 Jan 2023 12:22:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49858 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238814AbjAKRVZ (ORCPT ); Wed, 11 Jan 2023 12:21:25 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 20FC8321B2; Wed, 11 Jan 2023 09:21:25 -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 C9786B81B79; Wed, 11 Jan 2023 17:21:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 10B50C433D2; Wed, 11 Jan 2023 17:21:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1673457682; bh=iakCU13SXpMb3pcvjfiiLXGeB5RnCPEYfg/spzK7YxA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QyqAUwJGdNtBpzR4nntbs1iPUTkBKiOHAmXK9MifYRWMELikATG4WriMLqpDgxpov cHYLSZFLH9EHn+oPMBvxgIhq8JwB69mMxlGzCWFVKKq5oUvR6NH/KoHX0MPpkBDaQu j4Z0J//elt3BJwT1UORJJ0DODp8Jh2NMZOlPbOeTRciGJfooU/7fF3FQLKz3+7BxtO YHcf4fCfc5HvTlUc8IQlW1PW5Nemzwft1lPPwWrdHYdLhltZif8x69g+9WgKM0ezE+ kjAConnZz54KiT8BYnQ/k4YcSufpdk1aw3s3x0HWqArA+muds8k8lw81cVsfeS4DLU XT5HZ9ozU1fdg== 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 12/13] riscv: KVM: Switch has_svinval() to riscv_has_extension_unlikely() Date: Thu, 12 Jan 2023 01:10:26 +0800 Message-Id: <20230111171027.2392-13-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 From: Andrew Jones Switch has_svinval() from static branch to the new helper riscv_has_extension_unlikely(). Signed-off-by: Andrew Jones Reviewed-by: Guo Ren --- arch/riscv/kvm/tlb.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/riscv/kvm/tlb.c b/arch/riscv/kvm/tlb.c index 309d79b3e5cd..aa3da18ad873 100644 --- a/arch/riscv/kvm/tlb.c +++ b/arch/riscv/kvm/tlb.c @@ -15,8 +15,7 @@ #include #include -#define has_svinval() \ - static_branch_unlikely(&riscv_isa_ext_keys[RISCV_ISA_EXT_KEY_SVINVAL]) +#define has_svinval() riscv_has_extension_unlikely(RISCV_ISA_EXT_SVINVAL) void kvm_riscv_local_hfence_gvma_vmid_gpa(unsigned long vmid, gpa_t gpa, gpa_t gpsz, -- 2.38.1