Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp26525944rwd; Mon, 3 Jul 2023 10:53:40 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4wt05YhyFvp0DJZA9h46jQ1ndA5Id+P6iteR7E8TKhWuxi0GL3I8U07gBF623gWpVeQjz4 X-Received: by 2002:a05:6a21:7886:b0:12b:1665:d697 with SMTP id bf6-20020a056a21788600b0012b1665d697mr15740097pzc.41.1688406819785; Mon, 03 Jul 2023 10:53:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688406819; cv=none; d=google.com; s=arc-20160816; b=AmMDpvyTL0vBlORqR4zAAm/X+wvfSWf5HcHJp+GJze2slj4jJM75zlrJ6IILB3dGAc /VqgU4yQPIVYxkaW1T2+kwPaEJbGbFqkeLO3cSC5KbUuZNks1FC7Dpa0F2I2RBtnNn9U mue+1lOWGFUSp5VVf4JAfKNQUMIlmGAfQDYQq8j1sHuOjJvg/IwTi2cY0rqfz2d1bAyr 0YHM8V5egHuLM9anCePfDSCCdfOLdoW4c9pjx7habqDCEP98BMJw3EdIm59iQ+D7ntNJ c2CQTmyOBj3ur+d+Rr5Zg3gEfI0/oLFLYKCtJ0QG6cAvJS25BIjakdFkfctDd4qAUWns 1XgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=fqEzCQR3Ky2uxyowOTJSpZk+xLCRHsXzgiFQujQ7Yqc=; fh=TsLxEesd2V1hZu4cy6IoN2K6XxyU0YwytCHfyIpLxx4=; b=jUNcQLsTsQUw5RZd3CEZgmblrECsUMSfRCmJNKuNL2RGcUsdzNwmaVC+E+3I9anhGw 3tiw6UG/Z158788SStxtLJeT1UDyLSFjqhIqArn3h2hZMbxWwKfln9lBzeTxmBwKiX3F RiaW0h4E7S5BaT5X1InJTkJ8tDek+5OTDA0FHxX9neaFjhOxGNOU4sdGAdUcK/hoiIxd GZmwJqG7XXKIvz+RXh0i16AgvPXKoGOrY02kDW8a6mNFcNre9483HojzKQujcjGzMGnk Vc4M9go9l1N5JcPAgPELeDRtlTbJ+wpJ2aGkUO04eYhSWu6o+Yw5/waf5lARzjWf1TML gBow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=CmrFmh5l; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x31-20020a056a00189f00b0066db06a5cf1si18908259pfh.43.2023.07.03.10.53.25; Mon, 03 Jul 2023 10:53:39 -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=@kernel.org header.s=k20201202 header.b=CmrFmh5l; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230334AbjGCRjw (ORCPT + 99 others); Mon, 3 Jul 2023 13:39:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51248 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229978AbjGCRjv (ORCPT ); Mon, 3 Jul 2023 13:39:51 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 779F8CE for ; Mon, 3 Jul 2023 10:39:50 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 0CA3960FEF for ; Mon, 3 Jul 2023 17:39:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3945DC433C7; Mon, 3 Jul 2023 17:39:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688405989; bh=OntLpPnFpu6a5AZn6p9k4IDUTa9DeesaKC3dsarBEQU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=CmrFmh5lmxYbn4ure2V67iG4eEuApA+cAlmqBLLlcm22Zr08WKxQHX28dD2UKLsjd DP+rbcQDXn3UG4NI77qkloLUuYM7fnmFG7citty9W43xTWEfujhRokN0XnVCTrEGSl +s+hFLWXSRReOk0GYeB4H1sfXuFS5SYtVcdj2dFDXj+FWNkYQAkaih8GJVBwHN+U/e BRv5FkW5UqRxzuussLA9sDCiLF7Q29Q5GHLyox7pAPttgayI8CuAD6RLZWMTswWaSy yLFcxHVZT0QRlQpWQL/hSfB4BGXEx15i67N+6yqO0ZNIdEbFUTISuT79ubCc2ybOzL R8pY7TlcX5mkA== Date: Mon, 3 Jul 2023 18:39:43 +0100 From: Conor Dooley To: Evan Green Cc: Conor Dooley , Samuel Ortiz , Paul Walmsley , Palmer Dabbelt , Albert Ou , linux-riscv@lists.infradead.org, "Hongren (Zenithal) Zheng" , linux@rivosinc.com, 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: <20230703-mangle-panning-75909ebbe30c@spud> References: <20230627143747.1599218-1-sameo@rivosinc.com> <20230627143747.1599218-2-sameo@rivosinc.com> <20230627-debating-twelve-da2c1ed60948@spud> <20230628-unfeeling-tavern-edd4f58396fa@wendy> <20230628-dragonish-lullaby-b44d2df09d66@spud> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="JgFm48JGbULM0hnk" Content-Disposition: inline In-Reply-To: <20230628-dragonish-lullaby-b44d2df09d66@spud> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 --JgFm48JGbULM0hnk Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jun 28, 2023 at 06:24:40PM +0100, Conor Dooley wrote: > On Wed, Jun 28, 2023 at 10:18:34AM -0700, Evan Green wrote: > > On Wed, Jun 28, 2023 at 4:10=E2=80=AFAM Conor Dooley wrote: > > > > > > On Wed, Jun 28, 2023 at 12:01:11PM +0200, Samuel Ortiz wrote: > > > > 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=E2=80=AFAM Samuel Ortiz wrote: > > > > > > > > > It would be nice to consolidate the ones together that search f= or a > > > > > > single string and set multiple bits, though I don't have any su= per > > > > > > elegant ideas for how off the top of my head. > > > > > > > > > > I've got a refactor of this code in progress, dropping all of the= se > > > > > copy-paste in place of a loop. It certainly looks more elegant th= an > > > > > this, but it will fall over a bit for these "one string matches m= any > > > > > extensions" cases. See here: > > > > > https://patchwork.kernel.org/project/linux-riscv/patch/20230626-t= hieving-jockstrap-d35d20b535c5@wendy/ > > > > > My immediate thought is to add another element to riscv_isa_ext_d= ata, > > > > > that contains "parent" extensions to check for. Should be fairly = doable, > > > > > I'll whip something up on top of that... > > > > > > > > Nice, and thanks for the review. > > > > > > > Should I wait for your refactor to be merged before pushing this on= e? > > > > > > I don't know. I think that you should continue on with your series he= re, > > > and whichever goes in second gets rebased on top of the other. > > > I don't think it makes material difference to review of this patchset= as > > > to whether you rebase on top of what I'm working on, so I wouldn't > > > bother until it gets merged. > > > > > > Rather hacky, had less time than expected this morning: > > > https://git.kernel.org/pub/scm/linux/kernel/git/conor/linux.git/commi= t/?h=3Driscv-extensions-strings-supersets > > > Clearly there's issues with looping to RISCV_ISA_MAX_SUPERSETS & I ju= st > > > repurposed Zicsr for the sake of testing something in the time I had. > > > > > > Evan, at a high level, does that look more elegant to you, or have I = made > > > things worse? > > > > >=20 > > I see what you're going for at least. It's unfortunate that when > > someone bumps up RISCV_ISA_MAX_SUPERSETS it squares the whole array. > > Another way to go might be to define the elements in a separate array, > > like: > >=20 > > unsigned int riscv_zks_exts[] =3D { > > RISCV_ISA_EXT_ZBKB, > > RISCV_ISA_EXT_ZBKC, > > .... > > }; > >=20 > > then the macro entry looks like: > >=20 > > SET_ISA_EXT_MAP_MULTI("zks", riscv_zks_exts), > >=20 > > where the SET_ISA_EXT_MAP_MULTI() could use ARRAY_SIZE() to stash both > > the pointer to the array and the number of elements. >=20 > Yup, I like the sound of that. I like the variadic stuff as it'd not > require defining a bunch of sub-arrays of supersets. I guess if it grows > too badly, we can just dump it off into another file or w/e. Also, I realised the other day that I had a bug in my series - I was using "name" to read the property, not "property", which is what required the extra "supersets" property. The simplest thing to do actually seems to be to expand the "property" member to an array of strings named "properties", rather than introducing a "supersets" or similar. Perhaps I am forgetting a good reason for why I had it split, but I'll give it a whirl and see what I think... Cheers, Conor. --JgFm48JGbULM0hnk Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRh246EGq/8RLhDjO14tDGHoIJi0gUCZKMH3wAKCRB4tDGHoIJi 0t+YAQCaAdQcKzF/7Wkkp8B3/aBhZXO+q4AFQeKrzR3oAw54bwD9G6x/Upc4snIB z7KVmZAXIYejb0tOCXe33BZlBfBWUAg= =UEKI -----END PGP SIGNATURE----- --JgFm48JGbULM0hnk--