Received: by 2002:a05:7412:7c14:b0:fa:6e18:a558 with SMTP id ii20csp38615rdb; Sun, 21 Jan 2024 16:23:14 -0800 (PST) X-Google-Smtp-Source: AGHT+IEZLO5cuOTgqhJ5InnP1kXQsP47admzyvsWT87V/wD8C83LKFWJFGaAvwcgTB4hsp20IWaV X-Received: by 2002:a17:902:7c93:b0:1d5:693a:88e2 with SMTP id y19-20020a1709027c9300b001d5693a88e2mr1075537pll.37.1705882994187; Sun, 21 Jan 2024 16:23:14 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705882994; cv=pass; d=google.com; s=arc-20160816; b=XJLHth2/KV2ILk7eRbekY3Qrxz5jxAiSCJ61dKKeQaQOwIafmIiaI/lodHryqEF13y 77VwJDHdCZ+A/378lXURbB1OfmS6QwayE0rhTidocAtU9G7fN97aA3GSXlB+YHbI4V9V DhC6PRpLD1t2aHqR1EfNQukj6A+ZsZ2jl0PlQirSAGnHQstNiTYfedsvODOR/y4F/cZF PnFu4a5fbsbzfY9rOLtBdWJ36RjGNpMQNkzmS6tGS95POdzlf3zZBxTUk9XyvVshIRfg Q8D10l/n8+qbDyDHbh1V2VjYV2j10qs3BjzKIwa6b6y9FrgI8Lv6HUtMqUYk21AuEKeV sJHQ== ARC-Message-Signature: i=2; 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=cyjLIJnhRX+Tn6nZNa4iRdWa8RQ7fHmwunUP3JVfPhQ=; fh=/pdiLwrzeGylF3AZCw3Q15BIKH/FbQ2tONl/uW4EGIM=; b=LWCGCqvvQvCqto51zlexp/VaFmkgkRyqoIvQhd81ifEKmxwHQIOzeFmd06DMKD89gE daDrOferRgcaXUV2hnahS4WD7DKoEBFEBt+Uw68TMs55jMl6lMjD/+Wug25ZFASqFom0 J0NKfg69wXQbiCT2opEFQV9BQ1+RTWe4UZzrAT9efmgGA0OBzbUMfZB9CLSBZRs9X1wA k8pIYbNbT8gnvF4+5wbm8j8udP07p1iKchjmMFXsiffSL+0ilRiaeU83Vkc3+onrDxrd NIdry5TGwCS2NJJGgR4SLkWlqBA1iGWcHOsbl4L24qclBsh0TLmbTlsmEDy5L+kws8sA cZjw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FTtQ7CnR; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-crypto+bounces-1524-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-crypto+bounces-1524-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. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id h4-20020a170902f7c400b001d720fe91basi4839835plw.389.2024.01.21.16.23.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 21 Jan 2024 16:23:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto+bounces-1524-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FTtQ7CnR; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-crypto+bounces-1524-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-crypto+bounces-1524-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 CF2DC282347 for ; Mon, 22 Jan 2024 00:23:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 948CB7E6; Mon, 22 Jan 2024 00:22:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="FTtQ7CnR" 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 50DE637B; Mon, 22 Jan 2024 00:22:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705882979; cv=none; b=aaXvXbOUeg1kSIQmQiru7fAmeWgWRG4ITB1GXr3c0h0aQnYc8Kciqo0jfdxEoE0q12XUtutr9QC8VdWvPSRuPj/gOy5uQ4m1BtAKC87eDZEphdFv4NiAPoREuJm3fs/G0QWXxvjPXHVnuRnXeXhvDC3kHE7wp7l434v9GPZkIBw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705882979; c=relaxed/simple; bh=aVQvquY3/QZrbd8jHI67vn2mQbmidA09BUUPYfRdUOA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Tty0DWUiiHubVCiEJvButucwfP4lf36/o6POPT9Px243oFqQDCx3XkZT/JVNU4Jg6HdbAdNXtY5Zl1xI4i3QE0NSU44C5i3geUmLqdPIoE068NVkMiIgPctrhcbumRCJyuO4b+1k1sDDh49/yqJNGD+JiYSgosdVOnD4v5i7/jA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=FTtQ7CnR; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 64366C433A6; Mon, 22 Jan 2024 00:22:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1705882978; bh=aVQvquY3/QZrbd8jHI67vn2mQbmidA09BUUPYfRdUOA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FTtQ7CnRAUueJnnwKyKVtqaOwLHuwC50ol1N6VBH3F4bXANTK4yKJAw6z1Bd+7gnE 0IIJKaDyNCShEoILNDTHusQSstJiDlGlbnsDfmMniFSVrchtQUhYr3vI3l4khHjkKd h6LcwvPzGM+OP1JHcacDkJnkgZw9TagVLJx1zZXf3RfUMrSsM7aItVVFJokHuMGpmC q0Pw3Argq3++kZn2Cymq+WX+dr3xaTG8SFvmjka986TDgrZ7yZ/BegxfAUzFx6jJF1 jY8188HAgmTprMrmSOwzKr/UnrdXb2LuUYjSlIAZy/EkYhh97eiF4C50oT+MFjUr0s 44HlDYBKQ385A== From: Eric Biggers To: linux-crypto@vger.kernel.org, linux-riscv@lists.infradead.org Cc: linux-kernel@vger.kernel.org, Albert Ou , Andy Chiu , Ard Biesheuvel , =?UTF-8?q?Christoph=20M=C3=BCllner?= , Heiko Stuebner , Jerry Shih , Palmer Dabbelt , Paul Walmsley , Phoebe Chen , hongrong.hsu@sifive.com Subject: [PATCH v3 02/10] RISC-V: add TOOLCHAIN_HAS_VECTOR_CRYPTO Date: Sun, 21 Jan 2024 16:19:13 -0800 Message-ID: <20240122002024.27477-3-ebiggers@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240122002024.27477-1-ebiggers@kernel.org> References: <20240122002024.27477-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 bffbd869a0682..5613b2bb686ec 100644 --- a/arch/riscv/Kconfig +++ b/arch/riscv/Kconfig @@ -571,20 +571,27 @@ config RISCV_ISA_V_PREEMPTIVE consumption due to the allocation of per-task's kernel Vector context. 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