Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp18131649rwd; Tue, 27 Jun 2023 12:06:49 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4pLH2d7kHTHTFUxeUtEfcmat9oGAUvsm7Y2BH6OOYtY2RnA8ZgboAgCY+DQFaj083wiuaU X-Received: by 2002:a2e:a175:0:b0:2b3:47b3:3c39 with SMTP id u21-20020a2ea175000000b002b347b33c39mr21272552ljl.23.1687892809204; Tue, 27 Jun 2023 12:06:49 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1687892809; cv=pass; d=google.com; s=arc-20160816; b=RvdUPOSdf88dLH7e4Vb19/crukOUqsecIDxrIsJwcAUm04V56QyoOC9Z9ggbt9cxki C6rbIjMAz1ZtqgJCntqhVoHo7Sn1HzAtP7Tt+wQhQfljfuD4mcAFiCkk7y1xVSBkjUnI rg7pl/iGb1kWmUXRXqjmJzq1Pw6Ky8z2X/HOa8tu3gVV+lQ1+Phbob0F3b7c9QPzz7Ed t836IbxXHdc5mB5lp5G5zu6KOmUj2+sVIySU/3rG6dyLTEYNW4CzGfsjcbCe0Ovq0Odz 2FKF/VAzH6LNgIILAXwtrP+aIsBa81R/YByNmd4GbFAxwNWHaXEabCApS/oYewQh8zcq W+dw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:in-reply-to :content-transfer-encoding:content-disposition:references:message-id :subject:cc:to:from:date:dkim-signature; bh=XWLzb8ymI1XpiIC4jC60HepCFIyP9RRhpO3sH9SrIj0=; fh=bHZqJhC1W8NFuR+X0lehLxaA6LvR0FEs8JU18E9Xpm4=; b=Gl/SxUHzVaDAvPbTOIHId2T6YeesgrpjDE1pDVZTNMQQjrCHfR9zMOGJIpMQo+FBoJ fMMEX6Cig/LsTyIdFOFjowrvzngDf7U3oK9dl3U5Exdw1Wn+CZ9v7+nnrToSii+pXaUl WW18r+dOTVsTIdIrSTn/PHi6303c7F4HPkRZDdoJxqHhCek0QivmubIk7J0U6cVfsobq vTmybINIbbP6fHutq9okvGW5nQ3CSOhIMxdGS0Wm3r50J4UnpUS04QztDkRlKbkTcOID 1Q6wxuZNBS9oBlT9mUc7J9l+FHSCmvCe3cD1hbKSv9v1JKERwXDjZkioLeGYvzSJsXC5 PBag== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@zenithal.me header.s=selector1 header.b=hZtufxte; arc=pass (i=1 spf=pass spfdomain=zenithal.me dkim=pass dkdomain=zenithal.me dmarc=pass fromdomain=zenithal.me); 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=zenithal.me Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s18-20020aa7d792000000b005164372d51esi4138249edq.140.2023.06.27.12.06.23; Tue, 27 Jun 2023 12:06:49 -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=@zenithal.me header.s=selector1 header.b=hZtufxte; arc=pass (i=1 spf=pass spfdomain=zenithal.me dkim=pass dkdomain=zenithal.me dmarc=pass fromdomain=zenithal.me); 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=zenithal.me Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230327AbjF0TEO (ORCPT + 99 others); Tue, 27 Jun 2023 15:04:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40996 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231558AbjF0TEK (ORCPT ); Tue, 27 Jun 2023 15:04:10 -0400 Received: from JPN01-OS0-obe.outbound.protection.outlook.com (mail-os0jpn01on2103.outbound.protection.outlook.com [40.107.113.103]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4405D1FC3 for ; Tue, 27 Jun 2023 12:04:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nCRQxHMnDoLvJNHvTUfeCBZup2eZo3KlNN2ZkoQAwdL0fgDzmS/ZubBW0ERI7TpIua/2TtSkSjAS5vuCf1fDaTTHsnPiB/nVPVnShx9+hyM4XFhug8VsfE9pE+/M87ArhWcwiG7iX3x5VaE2aBnNA3zcaGE+WiGr5JXMtNuZl1PZZrgJzU65tpFwBD52JXeyXspTr0H3ZTFcSkACQzdv+JoSbG10yOU6XqxqVpXp293IUyLoakgCB66NUSubR3H5XiUhH49A3E7GDdT0ecIp2IoBXP6QEZyFWcKbMI7TTUlxL1DifkffKXMyJJ8qXofMBRk0nZCheZg3Sk3ncCTdAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=XWLzb8ymI1XpiIC4jC60HepCFIyP9RRhpO3sH9SrIj0=; b=bF+ZlwmT3WAlB5SRXUdMlAu/2bMvHylONS7hISRzGtjfcm+EW/10UiaU0l6MH4l+ZUKuHG9xtoXmo8IPzyI7iRECpMAI9IvyaW93jw46OqDW9K/+7GME6Qdi3ZmqoH8E+8qQZyE7i+h/qTpmKMNx1PYf1s3BARuxvOGw8z6fyqYOXlM83bk+kvsmZka5SNjxkZiBLFjVkgRalRNJN3FGy0Bg00xyLzIu4wlxYG5/fhQrMJ9vUvp417Xo63nqluLDoN+yRe6VE6UA4KwlykzTzGoHKwpUaVrvOJwb9pXjiaEmZigLn/V43aRbKiNU0L06XH4tpKyStriPPqBhKYlRAQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=zenithal.me; dmarc=pass action=none header.from=zenithal.me; dkim=pass header.d=zenithal.me; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zenithal.me; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=XWLzb8ymI1XpiIC4jC60HepCFIyP9RRhpO3sH9SrIj0=; b=hZtufxtecwP9VWhq3rcA64x+cKslpXAPkm9EbtULrGBwEWwysFdUTuUrPhCMIuRLcpc7g4fzF4Nk8hg8k43dQB2CmVe5EhqbYfw7ukOccjbOPIMXGXES6Iq4YLK7TNCYFXuqXxa0tvV2k/3y2q94qw4QXzXD5XSAIx1S3Y3migw= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=zenithal.me; Received: from TYCP286MB1393.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:c0::6) by OS3P286MB2246.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:199::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.26; Tue, 27 Jun 2023 19:04:06 +0000 Received: from TYCP286MB1393.JPNP286.PROD.OUTLOOK.COM ([fe80::d5aa:e14:adea:f392]) by TYCP286MB1393.JPNP286.PROD.OUTLOOK.COM ([fe80::d5aa:e14:adea:f392%3]) with mapi id 15.20.6521.026; Tue, 27 Jun 2023 19:04:05 +0000 Date: Wed, 28 Jun 2023 03:03:58 +0800 From: "Hongren (Zenithal) Zheng" To: Conor Dooley Cc: Evan Green , Samuel Ortiz , Paul Walmsley , Palmer Dabbelt , Albert Ou , linux-riscv@lists.infradead.org, linux@rivosinc.com, Conor Dooley , Andrew Jones , Heiko Stuebner , Anup Patel , linux-kernel@vger.kernel.org, Guo Ren , Atish Patra , =?iso-8859-1?Q?Bj=F6rn_T=F6pel?= , Jiatai He Subject: Re: [PATCH 1/3] RISC-V: add Bitmanip/Scalar Crypto parsing from DT Message-ID: References: <20230627143747.1599218-1-sameo@rivosinc.com> <20230627143747.1599218-2-sameo@rivosinc.com> <20230627-debating-twelve-da2c1ed60948@spud> Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20230627-debating-twelve-da2c1ed60948@spud> X-Operating-System: Linux Sun 5.15.67 X-Mailer: Mutt 2.2.7 (2022-08-07) X-ClientProxiedBy: SJ0PR13CA0037.namprd13.prod.outlook.com (2603:10b6:a03:2c2::12) To TYCP286MB1393.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:c0::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCP286MB1393:EE_|OS3P286MB2246:EE_ X-MS-Office365-Filtering-Correlation-Id: 2715dfc8-1f63-427f-78f3-08db77414739 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: eXL37YLASBR8+hwqk85DqmZ5ewl42TojaDi5sQ2q+9bDPRbI0E41r/3iRbXZZgK308v/dE3KAWXhEYGdMAHRRW2o/9CM0R1o392m4FP0FnuKeTkEF5jfNAXnPa8pFnaA5lks6p7rkParXh6GlrA0P8MZsgMvf3eWuNTYImYDkee0ewRkuvvNRDibfqSiaGwCC+bMa8Q3f3B7Oh8h5KfOjbMmbdCK3vt42TW6nquPlBIN8QcC6xUmY0RIZiLMq23NjZov7HdDhd2DzCR5wQ0v7cOcaQK7AxnJxoB5Qkte1TSegO7+c/V/OZr0Qde6Aq9qaki+NSVFIZir0Ks3Y/Nj8BgPiPAUZuuynNAfZ4q1Jvx/qhOEGvchorvjsoJ7JH/ooctowKpbABd29cF2f7nuW7NIhIkoKJgpBWCbpl1Q+hit+CP4TqQXPO6xjLPOdfQXuL4Q5pvCtQGDWgSextSWg/YneTWCTBq9xBBHwcm40YPX7YbptNiwUCC5L6ZRZqWqGY07kInzX5/AJp8O/KdrtoipSBy2Rd6uNuwf0NJHOMqEqoACtf0BYFIrkRVFN9lfwz9b/a7OnQOECPLGs9/mZEzgkdRlwpG0qUcOCTllzJk= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:TYCP286MB1393.JPNP286.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230028)(7916004)(396003)(346002)(39830400003)(136003)(366004)(376002)(451199021)(66556008)(66476007)(6506007)(966005)(6666004)(41320700001)(54906003)(478600001)(83380400001)(9686003)(186003)(53546011)(2906002)(6486002)(5660300002)(33716001)(7416002)(6916009)(66946007)(786003)(38100700002)(8676002)(86362001)(316002)(4326008)(41300700001)(8936002)(6512007)(49092004);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?Vmdqc0wvc3p6WXkxeWFQWENuRDJ4aWJ2ZTEyeVFxRXJUZkFYMVZyQm5yR0hz?= =?utf-8?B?WVM5RHhvWG9XdlRrbzRLWkdWSHk5NlJnVnhxOVdXb1ZwZHJwb3VnRVVycldJ?= =?utf-8?B?OW8wd0lYc3Q4aTRXWG9sK1pJQVk4aWV3a1ExdVdPNjM4ZkxDZ2hWS25rQzR6?= =?utf-8?B?OWNqM0IrMHpKUlROSnhlQ1V3Mmkwd01Zc0pCWm9uU0hNY00vbHVEcFdyTklB?= =?utf-8?B?NzVQUWdKMkJxRWlsL2x2MnJMU1gvWlkxS3VvOEdidG01RkNRQWlmeVJLK2Vr?= =?utf-8?B?M1lXTkJ3d0RZWDl1MWhDWFFBWkdwcDFGUnpHem1KWjkrUFN2Vlp1TDU3S2JT?= =?utf-8?B?dEFPSVN5enp0US9IQWVwaXhmNkZKaC9pNDJrbFhJQ0YyWkdNW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414739 X-MS-Exchange-CrossTenant-AuthSource: TYCP286MB1393.JPNP286.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jun 2023 19:04:05.5375 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 436d481c-43b1-4418-8d7f-84c1e4887cf0 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: iVFFTgUqFyVpisNEzkCAyp2AkGdZ1+5E/X3Dl41inTCmx7zqOk5mX7l3BoULH+mL X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS3P286MB2246 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED 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 On Tue, Jun 27, 2023 at 07:48:15PM +0100, Conor Dooley wrote: > On Tue, Jun 27, 2023 at 11:14:30AM -0700, Evan Green wrote: > > On Tue, Jun 27, 2023 at 7:38 AM Samuel Ortiz wrote: > > > > > > From: "Hongren (Zenithal) Zheng" > > > > > > This patch parses Zb/Zk related string from DT and > > %s/This patch// > > > > output them in cpuinfo > > > > > > One thing worth noting is that if DT provides zk, > > > all zbkb, zbkc, zbkx and zkn, zkr, zkt would be enabled. > > Please explain why this is okay. From riscv scalar crypto spec, zk is a shorthand for zkn, zkr and zkt and zkn also includes zbkb, zbkc and zbkx. > > > > Note that zk is a valid extension name and the current > > > DT binding spec allows this. > > > > > > This patch also changes the logical id of > > > existing multi-letter extensions and adds a statement > > > that instead of logical id compatibility, the order > > > is needed. > > Does it? That is in the old version of this patch, should be removed now see https://lore.kernel.org/linux-riscv/YqY0aSngjI0Hc5d4@Sun/ > > > > There currently lacks a mechanism to merge them when > > > producing cpuinfo. Namely if you provide a riscv,isa > > > "rv64imafdc_zk_zks", the cpuinfo output would be > > > "rv64imafdc_zbkb_zbkc_zbkx_zknd_zkne_zknh_zkr_zksed > > > _zksh_zkt" > > I think this is fine. > > Please re-wrap this all to 72 characters. > > > > > > > Tested-by: Jiatai He > > > Signed-off-by: Hongren (Zenithal) Zheng > > This is missing your SoB Samuel. > > > > --- > > > arch/riscv/include/asm/hwcap.h | 11 +++++++++++ > > > arch/riscv/kernel/cpu.c | 11 +++++++++++ > > > arch/riscv/kernel/cpufeature.c | 30 ++++++++++++++++++++++++++++++ > > > 3 files changed, 52 insertions(+) > > > > > > diff --git a/arch/riscv/include/asm/hwcap.h b/arch/riscv/include/asm/hwcap.h > > > index f041bfa7f6a0..b80ca6e77088 100644 > > > --- a/arch/riscv/include/asm/hwcap.h > > > +++ b/arch/riscv/include/asm/hwcap.h > > > @@ -53,6 +53,17 @@ > > > #define RISCV_ISA_EXT_ZICSR 40 > > > #define RISCV_ISA_EXT_ZIFENCEI 41 > > > #define RISCV_ISA_EXT_ZIHPM 42 > > > +#define RISCV_ISA_EXT_ZBC 43 > > > +#define RISCV_ISA_EXT_ZBKB 44 > > > +#define RISCV_ISA_EXT_ZBKC 45 > > > +#define RISCV_ISA_EXT_ZBKX 46 > > > +#define RISCV_ISA_EXT_ZKND 47 > > > +#define RISCV_ISA_EXT_ZKNE 48 > > > +#define RISCV_ISA_EXT_ZKNH 49 > > > +#define RISCV_ISA_EXT_ZKR 50 > > > +#define RISCV_ISA_EXT_ZKSED 51 > > > +#define RISCV_ISA_EXT_ZKSH 52 > > > +#define RISCV_ISA_EXT_ZKT 53 > > > > > > #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 a2fc952318e9..10524322a4c0 100644 > > > --- a/arch/riscv/kernel/cpu.c > > > +++ b/arch/riscv/kernel/cpu.c > > > @@ -215,7 +215,18 @@ static struct riscv_isa_ext_data isa_ext_arr[] = { > > > __RISCV_ISA_EXT_DATA(zihpm, RISCV_ISA_EXT_ZIHPM), > > > __RISCV_ISA_EXT_DATA(zba, RISCV_ISA_EXT_ZBA), > > > __RISCV_ISA_EXT_DATA(zbb, RISCV_ISA_EXT_ZBB), > > > + __RISCV_ISA_EXT_DATA(zbc, RISCV_ISA_EXT_ZBC), > > > + __RISCV_ISA_EXT_DATA(zbkb, RISCV_ISA_EXT_ZBKB), > > > + __RISCV_ISA_EXT_DATA(zbkc, RISCV_ISA_EXT_ZBKC), > > > + __RISCV_ISA_EXT_DATA(zbkx, RISCV_ISA_EXT_ZBKX), > > > __RISCV_ISA_EXT_DATA(zbs, RISCV_ISA_EXT_ZBS), > > > + __RISCV_ISA_EXT_DATA(zknd, RISCV_ISA_EXT_ZKND), > > > + __RISCV_ISA_EXT_DATA(zkne, RISCV_ISA_EXT_ZKNE), > > > + __RISCV_ISA_EXT_DATA(zknh, RISCV_ISA_EXT_ZKNH), > > > + __RISCV_ISA_EXT_DATA(zkr, RISCV_ISA_EXT_ZKR), > > > + __RISCV_ISA_EXT_DATA(zksed, RISCV_ISA_EXT_ZKSED), > > > + __RISCV_ISA_EXT_DATA(zksh, RISCV_ISA_EXT_ZKSH), > > > + __RISCV_ISA_EXT_DATA(zkt, RISCV_ISA_EXT_ZKT), > > > __RISCV_ISA_EXT_DATA(smaia, RISCV_ISA_EXT_SMAIA), > > > __RISCV_ISA_EXT_DATA(ssaia, RISCV_ISA_EXT_SSAIA), > > > __RISCV_ISA_EXT_DATA(sscofpmf, RISCV_ISA_EXT_SSCOFPMF), > > > diff --git a/arch/riscv/kernel/cpufeature.c b/arch/riscv/kernel/cpufeature.c > > > index bdcf460ea53d..447f853a5a4c 100644 > > > --- a/arch/riscv/kernel/cpufeature.c > > > +++ b/arch/riscv/kernel/cpufeature.c > > > @@ -309,10 +309,40 @@ void __init riscv_fill_hwcap(void) > > > SET_ISA_EXT_MAP("svpbmt", RISCV_ISA_EXT_SVPBMT); > > > SET_ISA_EXT_MAP("zba", RISCV_ISA_EXT_ZBA); > > > SET_ISA_EXT_MAP("zbb", RISCV_ISA_EXT_ZBB); > > > + SET_ISA_EXT_MAP("zbc", RISCV_ISA_EXT_ZBC); > > > SET_ISA_EXT_MAP("zbs", RISCV_ISA_EXT_ZBS); > > > + SET_ISA_EXT_MAP("zbkb", RISCV_ISA_EXT_ZBKB); > > This order does not look correct, please add them in alphanumerical > order as the comment these SET_ISA_EXT_MAP()s requests. Ditto below. Agreed. Seems that I did not worked carefully for this part. > > > > + SET_ISA_EXT_MAP("zbkc", RISCV_ISA_EXT_ZBKC); > > > + SET_ISA_EXT_MAP("zbks", RISCV_ISA_EXT_ZBKX); > > > > Should "zbks" be "zbkx"? > > > > > 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); > > > + SET_ISA_EXT_MAP("zksed", RISCV_ISA_EXT_ZKSED); > > > + SET_ISA_EXT_MAP("zksh", RISCV_ISA_EXT_ZKSH); > > > + SET_ISA_EXT_MAP("zkr", RISCV_ISA_EXT_ZKR); > > > + SET_ISA_EXT_MAP("zkt", RISCV_ISA_EXT_ZKT); > > > + SET_ISA_EXT_MAP("zkn", RISCV_ISA_EXT_ZBKB); > > > + SET_ISA_EXT_MAP("zkn", RISCV_ISA_EXT_ZBKC); > > > + SET_ISA_EXT_MAP("zkn", RISCV_ISA_EXT_ZBKX); > > > + SET_ISA_EXT_MAP("zkn", RISCV_ISA_EXT_ZKND); > > > + SET_ISA_EXT_MAP("zkn", RISCV_ISA_EXT_ZKNE); > > > + SET_ISA_EXT_MAP("zkn", RISCV_ISA_EXT_ZKNH); > > > + SET_ISA_EXT_MAP("zknd", RISCV_ISA_EXT_ZKND); > > > + SET_ISA_EXT_MAP("zkne", RISCV_ISA_EXT_ZKNE); > > > + SET_ISA_EXT_MAP("zknh", RISCV_ISA_EXT_ZKNH); > > > + SET_ISA_EXT_MAP("zks", RISCV_ISA_EXT_ZBKB); > > > + SET_ISA_EXT_MAP("zks", RISCV_ISA_EXT_ZBKC); > > > + SET_ISA_EXT_MAP("zks", RISCV_ISA_EXT_ZBKX); > > > + SET_ISA_EXT_MAP("zks", RISCV_ISA_EXT_ZKSED); > > > + SET_ISA_EXT_MAP("zks", RISCV_ISA_EXT_ZKSH); > > > + SET_ISA_EXT_MAP("zk", RISCV_ISA_EXT_ZBKB); > > > + SET_ISA_EXT_MAP("zk", RISCV_ISA_EXT_ZBKC); > > > + SET_ISA_EXT_MAP("zk", RISCV_ISA_EXT_ZBKX); > > > + SET_ISA_EXT_MAP("zk", RISCV_ISA_EXT_ZKND); > > > + SET_ISA_EXT_MAP("zk", RISCV_ISA_EXT_ZKNE); > > > + SET_ISA_EXT_MAP("zk", RISCV_ISA_EXT_ZKNH); > > > + SET_ISA_EXT_MAP("zk", RISCV_ISA_EXT_ZKR); > > > + SET_ISA_EXT_MAP("zk", RISCV_ISA_EXT_ZKT); > > > > It would be nice to consolidate the ones together that search for a > > single string and set multiple bits, though I don't have any super > > elegant ideas for how off the top of my head. > > I've got a refactor of this code in progress, dropping all of these > copy-paste in place of a loop. It certainly looks more elegant than > this, but it will fall over a bit for these "one string matches many > extensions" cases. See here: > https://patchwork.kernel.org/project/linux-riscv/patch/20230626-thieving-jockstrap-d35d20b535c5@wendy/ > My immediate thought is to add another element to riscv_isa_ext_data, > that contains "parent" extensions to check for. Should be fairly doable, > I'll whip something up on top of that... > > Cheers, > Conor.