Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp548367rwb; Thu, 6 Oct 2022 00:36:38 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7ko5Oq/YdF+0uCYbbvqkaXye2YXwh4TNw0bwlo2hO/JWWRmhMY52nnoOQdhYxL4QIfCpdo X-Received: by 2002:a17:907:7f02:b0:73d:dffa:57b3 with SMTP id qf2-20020a1709077f0200b0073ddffa57b3mr2988775ejc.19.1665041797915; Thu, 06 Oct 2022 00:36:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665041797; cv=none; d=google.com; s=arc-20160816; b=yy4/Z5YTTXv5niP22ZR4i49ekm3fxzbQtpFbjuaSWSxPklqKxeF/m396clfKFaJzM6 4htycAGRYJ8k/1Orcta46P5JspIIMtifplWChiDG8gXbUWe2EWv7Z7QY3cbCzfLGzkqJ /zhBiLNDdvk/ToxXH1KCUrG08qDRtDWgdd348MN5D+N0zTBBe1HGzej6x3s802SPhcJv IhiIYfYdw6MHnsfhisNl+1wtBx9uXGTq4ghp26ClWMByRaXfIHNIpJ2u6LZNacRP96O6 7nE3PS3YC9+7r+m0cTipY1vDX9G2Z+wsD0SWSb8TXB1uOLaLbgOX9pFMRmJ7+vkZGML/ bN7g== 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=Mq55OLPMv+9Q5Eqh1U8E4eGpL6/CAwdi0xAp6MjSWtE=; b=nzBBkRVaMZpkZco66arJ2vWtt2Yoa+RktENaqBJChyKYd0NySqtiQc+TgOxfKqKFQ7 dGfA3L08bO3kha924e8jhtkrGzd+qzdzbjvP08YLjt1Rzmufaf7wCnpdSG/tMDijOTvl 2lzJkhhOHPQ/CLHruC/j7lOoU6HZKas9C1c0vKLD5NKGckLVav678bpCbrX+M4WAGblx oJLKJ7xcakSiUGp1GCx1La4vwsqcJc+NOkTmJvOMLlRt0P1V6L3AQQa2e8cXm6FmIVpt aoauAs2b1iv2F1KG4he+iAGAruvZ9gTMtqhr7zHIwey3CwWRXbxjH5a+0HcmzImDVqa4 Rwtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=qRm9LVZB; 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 hb43-20020a170907162b00b00781bf46536bsi18587630ejc.4.2022.10.06.00.36.13; Thu, 06 Oct 2022 00:36:37 -0700 (PDT) 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=qRm9LVZB; 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 S230294AbiJFHSc (ORCPT + 99 others); Thu, 6 Oct 2022 03:18:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33466 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230288AbiJFHSW (ORCPT ); Thu, 6 Oct 2022 03:18:22 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 519268E0D0 for ; Thu, 6 Oct 2022 00:18:04 -0700 (PDT) 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 5ADBF61871 for ; Thu, 6 Oct 2022 07:18:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A24A9C433C1; Thu, 6 Oct 2022 07:18:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1665040682; bh=CDY3LOHif93dA/5GcjxLOgr3s2+BMCkMTymaYNZuiyA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qRm9LVZBrunvLnYytd4pxa3rFq57nHfJ9HsOwpVTeWPTZL9sFAJFrYSAejIdUkx2+ +YWVA9Eo3yES9EQw9vR36Re1DZf8dhjtceMd03N6u3RCK+4X2qLONGZEcfnYBLpDKL hwPWSOWrkWM9W32TBw54oRrYC8Dk0URo+cdsVvMIqxw3t3RKe5+AQWn+M4rwwHOyS9 LCNF+pVn+aEpOcKXGNhIhkrtPk6VZs8B8J/PSxyZ/1pv4uwg9411eHxebQnt0XrWbb yGu+Tcq7FLQy8KgWezDl4mFSASslMOxJxrPovxMLCwChU97FyjTPIc0grP8kx8o+cM BxDCWLzehBhzQ== From: Jisheng Zhang To: Paul Walmsley , Palmer Dabbelt , Albert Ou Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 8/8] riscv: remove riscv_isa_ext_keys[] array and related usage Date: Thu, 6 Oct 2022 15:08:18 +0800 Message-Id: <20221006070818.3616-9-jszhang@kernel.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20221006070818.3616-1-jszhang@kernel.org> References: <20221006070818.3616-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 All users have switched to riscv_has_extension_*, removed unused definitions, vars and related setting code. Signed-off-by: Jisheng Zhang --- arch/riscv/include/asm/hwcap.h | 28 ---------------------------- arch/riscv/kernel/cpufeature.c | 9 --------- 2 files changed, 37 deletions(-) diff --git a/arch/riscv/include/asm/hwcap.h b/arch/riscv/include/asm/hwcap.h index 54b88ee6cae1..f52fbc121ebe 100644 --- a/arch/riscv/include/asm/hwcap.h +++ b/arch/riscv/include/asm/hwcap.h @@ -62,18 +62,6 @@ enum { extern unsigned long elf_hwcap; - -/* - * This enum represents the logical ID for each RISC-V ISA extension static - * keys. We can use static key to optimize code path if some ISA extensions - * are available. - */ -enum riscv_isa_ext_key { - RISCV_ISA_EXT_KEY_FPU, /* For 'F' and 'D' */ - RISCV_ISA_EXT_KEY_ZIHINTPAUSE, - RISCV_ISA_EXT_KEY_MAX, -}; - struct riscv_isa_ext_data { /* Name of the extension displayed to userspace via /proc/cpuinfo */ char uprop[RISCV_ISA_EXT_NAME_LEN_MAX]; @@ -81,22 +69,6 @@ struct riscv_isa_ext_data { unsigned int isa_ext_id; }; -extern struct static_key_false riscv_isa_ext_keys[RISCV_ISA_EXT_KEY_MAX]; - -static __always_inline int riscv_isa_ext2key(int num) -{ - switch (num) { - case RISCV_ISA_EXT_f: - return RISCV_ISA_EXT_KEY_FPU; - case RISCV_ISA_EXT_d: - return RISCV_ISA_EXT_KEY_FPU; - case RISCV_ISA_EXT_ZIHINTPAUSE: - return RISCV_ISA_EXT_KEY_ZIHINTPAUSE; - default: - return -EINVAL; - } -} - static __always_inline bool riscv_has_extension_likely(const unsigned long ext) { diff --git a/arch/riscv/kernel/cpufeature.c b/arch/riscv/kernel/cpufeature.c index 2b1f18f97253..6bc3fb749274 100644 --- a/arch/riscv/kernel/cpufeature.c +++ b/arch/riscv/kernel/cpufeature.c @@ -28,9 +28,6 @@ unsigned long elf_hwcap __read_mostly; /* Host ISA bitmap */ static DECLARE_BITMAP(riscv_isa, RISCV_ISA_EXT_MAX) __read_mostly; -DEFINE_STATIC_KEY_ARRAY_FALSE(riscv_isa_ext_keys, RISCV_ISA_EXT_KEY_MAX); -EXPORT_SYMBOL(riscv_isa_ext_keys); - /** * riscv_isa_extension_base() - Get base extension word * @@ -242,12 +239,6 @@ void __init riscv_fill_hwcap(void) if (elf_hwcap & BIT_MASK(i)) print_str[j++] = (char)('a' + i); pr_info("riscv: ELF capabilities %s\n", print_str); - - for_each_set_bit(i, riscv_isa, RISCV_ISA_EXT_MAX) { - j = riscv_isa_ext2key(i); - if (j >= 0) - static_branch_enable(&riscv_isa_ext_keys[j]); - } } #ifdef CONFIG_RISCV_ALTERNATIVE -- 2.37.2