Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp5583712rdb; Sun, 31 Dec 2023 07:28:48 -0800 (PST) X-Google-Smtp-Source: AGHT+IGeH57MNurZO0YtsTQaHhe/k6kMd2vnfu3q2XtIRki2csHaugjYwrKWE/dKUT4QfqZlaEgV X-Received: by 2002:a17:906:e2d3:b0:a23:320d:36d9 with SMTP id gr19-20020a170906e2d300b00a23320d36d9mr6779598ejb.106.1704036528685; Sun, 31 Dec 2023 07:28:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704036528; cv=none; d=google.com; s=arc-20160816; b=muawEwWvAJAbTLfuD7aGdvk0Q9Egs+Eh/wQzcaI+xlXFbBas9oZNRrV/2YquFk8JEx o22F6Qkv6h3PFXdwsKraR01STo5aeLINzQbBvqs+/7BFINoFwxA+Yvp/e3Sp6uTKBc41 NGCspMR+K/2dnnWkf8mUSSDbzoyIOg7reAAvLDxNVUGzkvw9qwerx1VBlvjl1uNe+vHY XFRf442GZN7EXmMJGm+sVX9RfBxRDnjKYVY7bGGWMJtcjcKQdxd8MyQAo0wPqnVilvng /jWiOIqu4kMU2xjjv8TkuMIWW+v73/85w1aXaohcds0gdrSfhc0lQF6Wm08XYKendjTk KuoQ== 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=XuCoCK+SW4zawUSFFv0erKPf4OwGQ3cihPvdb62nAAQ=; fh=EdrkxR6/0cUzdeRoIO4nQ0kc+YBaYAptqDtNOny9eFo=; b=vLScx09Qa/zxdG9H/8ha7O/HeVJyYkrJ+uSNS2ztsy57htl8BWp55bovl/lMJoAdaT xMgLBPsMd9RC3yGsFtT8QnYZTod9m3AhsEQ8ggCqs2sL2q/EOS9b5ebOIPJcanuGBGuN QRxEBbD/R88/sK8H/Nq5qwNA75SNpk/qguPTTAjWWwDOxCb0VxAxugxDIXF7H8j7fsq8 l51+LvaUhb+0rTi0GIxxpg3lMf/IE5wOTvuv5XxqioAN/Wbwt63nJ2rLgJC6WLWR70b3 AEEDNay0Yz41xmUow1puifFurzxyty5zf1ym2TXMmUkxd+/b9aEcUnLl+W4sX5wgNwT7 PLSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b=TGiNmJG7; spf=pass (google.com: domain of linux-crypto+bounces-1166-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-crypto+bounces-1166-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=sifive.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id t3-20020a17090605c300b00a276fb939a0si2658289ejt.729.2023.12.31.07.28.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 31 Dec 2023 07:28:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto+bounces-1166-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b=TGiNmJG7; spf=pass (google.com: domain of linux-crypto+bounces-1166-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-crypto+bounces-1166-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=sifive.com 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 71E941F215FF for ; Sun, 31 Dec 2023 15:28:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 26AFABE5F; Sun, 31 Dec 2023 15:28:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sifive.com header.i=@sifive.com header.b="TGiNmJG7" X-Original-To: linux-crypto@vger.kernel.org Received: from mail-pl1-f171.google.com (mail-pl1-f171.google.com [209.85.214.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BA3AFBA2B for ; Sun, 31 Dec 2023 15:28:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=sifive.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sifive.com Received: by mail-pl1-f171.google.com with SMTP id d9443c01a7336-1d3ea5cc137so63357165ad.0 for ; Sun, 31 Dec 2023 07:28:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; t=1704036483; x=1704641283; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=XuCoCK+SW4zawUSFFv0erKPf4OwGQ3cihPvdb62nAAQ=; b=TGiNmJG7kgiO6iwMkVvaOG55cZTPy7o/ffaBqUuSV7X3owlmL2WcNqb2+mRm9eUGok CqeySdUs1AaREkBpiYR80ANy8w1bmGixtosjtWS32TzZzGHm1A0UNdGMU9x3MxTl8xSB yRTurWDUnV9Kf3n3tT6Sl5xvBgJdjCt/0HZ5FJYLZm/Rc8X/v9Eq5xmU9er4t4K4UcqJ 6dJJEMaZOqsxSk0AK14HPj82am5teiZNlt5v4RD+WP2l4myQavcS3DtGMqKi2544/F1i EEXLBU7v9dNk5R2PwmsGEswSq7B1pz6WPAsopj20rwUWSPgSeM05L9SOTK/wAMPl6WxQ QjAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704036483; x=1704641283; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XuCoCK+SW4zawUSFFv0erKPf4OwGQ3cihPvdb62nAAQ=; b=l4Io6WPSyJjjBg97VO9fyhSnmKIsyUxNVs5+5QH4LGEfq/M6oJqg6PdWVM9n2Lxm+3 HBckKHP2PKpbTrbtUp+vWWdNmh9pMcjK7ykMdp3vwGjO60vOrAswvOyv2+k53TImvRSs Q6Fdc4Ct2v0SKNKH6u9gM094TQg4BrqaJ07aqjCpbik3C23imWzeyZay7uZsvx6T+n5b 0GV4TzKcXzspM5RX8WWrhgzYq5j5XgScTjevwHCCqP6zEuKN0lC6Q0MEG5B3y2UFs+mu bFCM8NuhKrBNPwWKRN+wfH4dj18KQgZntQ6DASyxYDx/lnybmwtH/NnYyT9QXopUmxt8 M3IQ== X-Gm-Message-State: AOJu0YyyJYJVWv2iVYhiS9PoHxjkcCt5BMU8g3PujGv8WRHhUA/vmsWG 92Cb+OPHKQzrFJ4pFXnJZw4phRaVe0hnOg== X-Received: by 2002:a17:903:1ca:b0:1d4:25ec:5975 with SMTP id e10-20020a17090301ca00b001d425ec5975mr20365331plh.10.1704036483091; Sun, 31 Dec 2023 07:28:03 -0800 (PST) Received: from localhost.localdomain ([49.216.222.63]) by smtp.gmail.com with ESMTPSA id n4-20020a170902e54400b001cc3c521affsm18624430plf.300.2023.12.31.07.28.00 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 31 Dec 2023 07:28:02 -0800 (PST) From: Jerry Shih To: paul.walmsley@sifive.com, palmer@dabbelt.com, aou@eecs.berkeley.edu, herbert@gondor.apana.org.au, davem@davemloft.net, conor.dooley@microchip.com, ebiggers@kernel.org, ardb@kernel.org Cc: heiko@sntech.de, phoebe.chen@sifive.com, hongrong.hsu@sifive.com, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org Subject: [PATCH v4 03/11] RISC-V: add TOOLCHAIN_HAS_VECTOR_CRYPTO in kconfig Date: Sun, 31 Dec 2023 23:27:35 +0800 Message-Id: <20231231152743.6304-4-jerry.shih@sifive.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20231231152743.6304-1-jerry.shih@sifive.com> References: <20231231152743.6304-1-jerry.shih@sifive.com> Precedence: bulk X-Mailing-List: linux-crypto@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit LLVM main and binutils master now both fully support v1.0 of the RISC-V vector crypto extensions. Check the assembler capability for using the vector crypto asm mnemonics in kernel. Co-developed-by: Eric Biggers Signed-off-by: Eric Biggers Signed-off-by: Jerry Shih --- arch/riscv/Kconfig | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig index 0a03d72706b5..8647392ece0b 100644 --- a/arch/riscv/Kconfig +++ b/arch/riscv/Kconfig @@ -636,6 +636,14 @@ config TOOLCHAIN_NEEDS_OLD_ISA_SPEC versions of clang and GCC to be passed to GAS, which has the same result as passing zicsr and zifencei to -march. +# This option indicates that the toolchain supports all v1.0 vector crypto +# extensions, including Zvk*, Zvbb, and Zvbc. The LLVM added all of these at +# once. The 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 FPU bool "FPU support" default y -- 2.28.0