Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp6383042rdb; Mon, 1 Jan 2024 22:51:21 -0800 (PST) X-Google-Smtp-Source: AGHT+IHJWvWeXCLWtKKEIxIzGmuVKbEBdeuxJdIqt5C3Z4UlzXnMPCmkEo3ihRzD3u7aiT9mRHsB X-Received: by 2002:a05:6871:5223:b0:1fa:548:5124 with SMTP id ht35-20020a056871522300b001fa05485124mr21645074oac.15.1704178281411; Mon, 01 Jan 2024 22:51:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704178281; cv=none; d=google.com; s=arc-20160816; b=p2725LRtd3ukRwf5M702vWRLlX5robGYPgrNbrH/CQLteNChaPhdzM+UuU0NNwBWyF MH4Aj/Ev8WQGilgavYOLS9Jq4UYQb0cQ6uCbKv5OA8QErnQLQHWsfidQM5VJIh47P3AY /ARX5zDKi9pQE6BS2fToy9V0KTNG85MDaJs1h19qvy+s8Dxl6Ticeqv4sIEVBBYD65x8 11h6BHMcC1E6Gjro3fvC5k9M31aT/CejDrKqYEHi67647anRdALTDNmxhfoFipmytVQJ DjK/hyH2ulHEejVPtBz7EjotijzmnlYAq0uoKYdCAAebLyl3s8RLNFqu2USNqP9wY5Kh G+UA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=M1G1xiuJRfNlpll7jQs5A3Y0kTi7mOnXEku/hKNTgvE=; fh=LNoNlzae7ymNdSjZKhSWIge+RJDIohN5ZpEu5iSh3fE=; b=dnYKEjOdKENbRKOISDf+Hjkh18OkXzqcY0bV7ZpkmIauPEhkcEDhyHcLCCHnLqWjs4 ZagDvRJ3z396kzKSTGsO4kN9ki4ifboZXPfHBaAIOTbak0JFU3w5u5Vpuz0tuaAhTNvD +4qyxW21SWfM54wWh8qQUEjuZpXwgsou1jWwo5gKR3nv3KuPdnmHbHuQgyqH2ct73+C3 dh0aBf9eEpktNaBJX/DZ1a1J/ssBNq0y2yMAFZL3FXtsDRFewg+6TV7chaQILnNh1Gwu ceCkcoyTJxKqY093XFN9MWl+R0rRyPd6X4Zdi6mwSeywqBnqb0BoD3Ge7MWOocu5qWaG j26g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=LekdIHCl; spf=pass (google.com: domain of linux-crypto+bounces-1183-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-crypto+bounces-1183-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id e7-20020a656487000000b005c6faf0a670si17447714pgv.257.2024.01.01.22.51.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Jan 2024 22:51:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto+bounces-1183-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=LekdIHCl; spf=pass (google.com: domain of linux-crypto+bounces-1183-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-crypto+bounces-1183-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 10D8F28221C for ; Tue, 2 Jan 2024 06:51:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 23D7FCA64; Tue, 2 Jan 2024 06:50:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="LekdIHCl" X-Original-To: linux-crypto@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DCBDCC8C4; Tue, 2 Jan 2024 06:50:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EE451C433C7; Tue, 2 Jan 2024 06:50:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1704178223; bh=27H198mfFlg5dXLC/oksp1mcpXEcuJokQDeBYx0aQoY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LekdIHClfL7jGei4zMmYx7yDpqNzFa2vP41Ce7SFYItp8gfUQdUpWnX2Npp2Y14Vj NAFhqo1z54zhnN5Kt4cEkBdD1kg18yjObC/MLNDPAAQIb38m/5leZdC81QjrARzgSi 49HQ+EbrqW8Q4WBk2mDbdf5IshVRs1h9CW4ecEz4rpll99jfFaRrOoRerFKKRbZve7 wnSCF+q7X3scrxXMaoR/7qSlT6AyxL3uyr4ZEUg4r9/madgi7jvNX+L5hK/UO37lG6 8s4wJK67VNVruoC2b3k3jO1oQ2lGVK/wt/JnAlvQLfyuuzTz9STtkqZ2h4hGxrBKKs k0mt6rGUOIu1w== From: Eric Biggers To: linux-crypto@vger.kernel.org, linux-riscv@lists.infradead.org, Jerry Shih Cc: linux-kernel@vger.kernel.org, Ard Biesheuvel , Heiko Stuebner , Phoebe Chen , hongrong.hsu@sifive.com, Paul Walmsley , Palmer Dabbelt , Albert Ou , Andy Chiu Subject: [RFC PATCH 04/13] RISC-V: add TOOLCHAIN_HAS_VECTOR_CRYPTO Date: Tue, 2 Jan 2024 00:47:30 -0600 Message-ID: <20240102064743.220490-5-ebiggers@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240102064743.220490-1-ebiggers@kernel.org> References: <20240102064743.220490-1-ebiggers@kernel.org> Precedence: bulk X-Mailing-List: linux-crypto@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Eric Biggers Add a kconfig symbol that indicates whether the toolchain supports the vector crypto extensions. This is needed by the RISC-V crypto code. Signed-off-by: Eric Biggers --- arch/riscv/Kconfig | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig index 95a2a06acc6a6..bf275a713b1b5 100644 --- a/arch/riscv/Kconfig +++ b/arch/riscv/Kconfig @@ -526,20 +526,27 @@ config RISCV_ISA_V_DEFAULT_ENABLE If you don't know what to do here, say Y. config TOOLCHAIN_HAS_ZBB bool default y depends on !64BIT || $(cc-option,-mabi=lp64 -march=rv64ima_zbb) depends on !32BIT || $(cc-option,-mabi=ilp32 -march=rv32ima_zbb) depends on LLD_VERSION >= 150000 || LD_VERSION >= 23900 depends on AS_HAS_OPTION_ARCH +# This symbol indicates that the toolchain supports all v1.0 vector crypto +# extensions, including Zvk*, Zvbb, and Zvbc. LLVM added all of these at once. +# binutils added all except Zvkb, then added Zvkb. So we just check for Zvkb. +config TOOLCHAIN_HAS_VECTOR_CRYPTO + def_bool $(as-instr, .option arch$(comma) +zvkb) + depends on AS_HAS_OPTION_ARCH + config RISCV_ISA_ZBB bool "Zbb extension support for bit manipulation instructions" depends on TOOLCHAIN_HAS_ZBB depends on MMU depends on RISCV_ALTERNATIVE default y help Adds support to dynamically detect the presence of the ZBB extension (basic bit manipulation) and enable its usage. -- 2.43.0