Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp320965rwd; Mon, 12 Jun 2023 14:11:08 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6kyVP7BGGGeb0jdRtHi4ykZrwPwjNqGqixS8N5XwXDQpHjcaZpWMtEAWW5VfZgNEUxWSbq X-Received: by 2002:a17:906:5188:b0:977:c446:3a24 with SMTP id y8-20020a170906518800b00977c4463a24mr9146388ejk.7.1686604267770; Mon, 12 Jun 2023 14:11:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686604267; cv=none; d=google.com; s=arc-20160816; b=MuzSDH8OFTWDCC4Aaj00GbPK48LDabKC2n6rezwbbDxAcn+Aub92Zz9pQyPF5ypFJV PkyvhItY9BYyzHNy/i0jODpcnvX0xxDs/tqGyIcKvLTG1XwpIHQCMetN95xcKNN2fjAo Fom8xPUib7yxc/KbnhQUCXm0Z5s8WPlMAUs0z7G6lzjnmUopXj4BARbZ25GVx+aNoZaR uzEtiT4QxkBTbAvRmTBqtzTL1zRaJIvdtNH3Qn2JMwi8j4uX6gPcVUm4/j0uDdk8cTvE LxUzxB1NkVShGspX69xG2q6LB1b3om2kQl4+2NTuEQG9MjTeBXqLkv/KwgVr2qNXguXB lqhQ== 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; bh=Gd4cKlKpylVvZFuQR6GBfsih6PyjWcpFb67UJXrlIK8=; b=u2w96Iz4VyVMPddqU+sexbpBMnyzB67Jv8JcmyaUVQMbRmLdBaxMBmZN+G0mHcw3QI WC0NshwqcRmiCVv0KedOxJ8VfpfPai57E56L8aRAk8stNTIFFYtyTRSXuv3Rg73jA5TV Q2Xg0IT0HY2vKKnqKzc7ofdk4LQSWCA+FY8cg0BEpxpozWJp8qrlWHmnwMDr7GblF0hC nLJYTS2ae024IGVwHBr+kSVOrEHSHVERGAhEN88NHT/YJGQURfrkb0rpxiwfu5mLmHap QMzXq/QAjJ+0bhbVt5WY5h5WAXE9zIFuyC+GWQSUvEFoEqYAs+ZzhbrqdMRHFNo3TKwt PF/w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=sntech.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w21-20020a17090633d500b00966228ee758si5101762eja.467.2023.06.12.14.10.41; Mon, 12 Jun 2023 14:11:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-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; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=sntech.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232304AbjFLVI3 (ORCPT + 99 others); Mon, 12 Jun 2023 17:08:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58042 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238260AbjFLVHz (ORCPT ); Mon, 12 Jun 2023 17:07:55 -0400 Received: from gloria.sntech.de (gloria.sntech.de [185.11.138.130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C36C112A; Mon, 12 Jun 2023 14:05:01 -0700 (PDT) Received: from i53875b22.versanet.de ([83.135.91.34] helo=phil.lan) by gloria.sntech.de with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1q8oib-0005fR-NU; Mon, 12 Jun 2023 23:04:53 +0200 From: Heiko Stuebner To: palmer@dabbelt.com, paul.walmsley@sifive.com Cc: heiko@sntech.de, aou@eecs.berkeley.edu, herbert@gondor.apana.org.au, davem@davemloft.net, conor.dooley@microchip.com, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org, christoph.muellner@vrull.eu, Heiko Stuebner Subject: [PATCH v5 2/4] RISC-V: add Zbkb extension detection Date: Mon, 12 Jun 2023 23:04:40 +0200 Message-Id: <20230612210442.1805962-3-heiko.stuebner@vrull.eu> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230612210442.1805962-1-heiko.stuebner@vrull.eu> References: <20230612210442.1805962-1-heiko.stuebner@vrull.eu> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_PASS, T_SCC_BODY_TEXT_LINE,T_SPF_HELO_TEMPERROR 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-crypto@vger.kernel.org From: Heiko Stuebner Add detection for Zbkb extension. Zbkb is part of the set of scalar cryptography extensions and provides bitmanip instructions for cryptography, with them being a "subset of the Zbb extension particularly useful for cryptography". Zbkb was ratified in january 2022. Expect code using the extension to pre-encode zbkb instructions, so don't introduce special toolchain requirements for now. Signed-off-by: Heiko Stuebner --- arch/riscv/include/asm/hwcap.h | 1 + arch/riscv/kernel/cpu.c | 1 + arch/riscv/kernel/cpufeature.c | 1 + 3 files changed, 3 insertions(+) diff --git a/arch/riscv/include/asm/hwcap.h b/arch/riscv/include/asm/hwcap.h index e48ac52b9174..3d4820648a14 100644 --- a/arch/riscv/include/asm/hwcap.h +++ b/arch/riscv/include/asm/hwcap.h @@ -48,6 +48,7 @@ #define RISCV_ISA_EXT_SMAIA 35 #define RISCV_ISA_EXT_SSAIA 36 #define RISCV_ISA_EXT_ZBC 37 +#define RISCV_ISA_EXT_ZBKB 38 #define RISCV_ISA_EXT_MAX 64 #define RISCV_ISA_EXT_NAME_LEN_MAX 32 diff --git a/arch/riscv/kernel/cpu.c b/arch/riscv/kernel/cpu.c index bbff98d4712a..a4ee61c18578 100644 --- a/arch/riscv/kernel/cpu.c +++ b/arch/riscv/kernel/cpu.c @@ -188,6 +188,7 @@ static struct riscv_isa_ext_data isa_ext_arr[] = { __RISCV_ISA_EXT_DATA(zicboz, RISCV_ISA_EXT_ZICBOZ), __RISCV_ISA_EXT_DATA(zihintpause, RISCV_ISA_EXT_ZIHINTPAUSE), __RISCV_ISA_EXT_DATA(zbb, RISCV_ISA_EXT_ZBB), + __RISCV_ISA_EXT_DATA(zbkb, RISCV_ISA_EXT_ZBKB), __RISCV_ISA_EXT_DATA(zbc, RISCV_ISA_EXT_ZBC), __RISCV_ISA_EXT_DATA(smaia, RISCV_ISA_EXT_SMAIA), __RISCV_ISA_EXT_DATA(ssaia, RISCV_ISA_EXT_SSAIA), diff --git a/arch/riscv/kernel/cpufeature.c b/arch/riscv/kernel/cpufeature.c index f46281f1e439..fceec9c60e07 100644 --- a/arch/riscv/kernel/cpufeature.c +++ b/arch/riscv/kernel/cpufeature.c @@ -262,6 +262,7 @@ void __init riscv_fill_hwcap(void) SET_ISA_EXT_MAP("svpbmt", RISCV_ISA_EXT_SVPBMT); SET_ISA_EXT_MAP("zbb", RISCV_ISA_EXT_ZBB); SET_ISA_EXT_MAP("zbc", RISCV_ISA_EXT_ZBC); + SET_ISA_EXT_MAP("zbkb", RISCV_ISA_EXT_ZBKB); SET_ISA_EXT_MAP("zicbom", RISCV_ISA_EXT_ZICBOM); SET_ISA_EXT_MAP("zicboz", RISCV_ISA_EXT_ZICBOZ); SET_ISA_EXT_MAP("zihintpause", RISCV_ISA_EXT_ZIHINTPAUSE); -- 2.39.0