Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp19561507rwd; Wed, 28 Jun 2023 10:55:39 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5W28Lc15lwiVCWF0Ed2dWfwiqnPVZpCYsxjdBVXAARM2DHjksKGAi6rns7Bw3yucBK1xn6 X-Received: by 2002:a05:6a20:8e07:b0:123:4ffe:4018 with SMTP id y7-20020a056a208e0700b001234ffe4018mr27619456pzj.60.1687974938752; Wed, 28 Jun 2023 10:55:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687974938; cv=none; d=google.com; s=arc-20160816; b=rgahdbHYLgGTFldPSNlbL15uJSmE6vLEH+9I9wy0cnGGDdVlEgyIgDsLR2Yv0IVQ5E C91d2Tyfv+rG6bRmdY8/l2z0dP27hB2t5hklKcmeqi7FLXoFRLqzrP1MDIGS/CB8vtpZ V+0RSQXPS0sdDvXkrJvhhTCVtJmsIduxhJV9H+lJfKOO2PhA4Nw6XdqbybigDnA3MPIo evEKEB+285Dc0od4SY+h5fMXTwGQrpXPHXC4TaH8P58DX1sU1r85ei1yV5B115p73GuY sYlSAnKUlGIYx9zgzWEFHCdgteMgGydZ+GQ++Ex1sF5mcROJKNGd/rK7sgaAhG3ZOId/ sLug== 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=UZ1agRpHfZoNxB5qdz9tToQ0PPQhQNk4FpeBYWUtzI4=; fh=ClFjAJawt7Ja6coA4yDQrCbcQC3rklqMTJhr8pB7p+U=; b=N2jf9978tfvanNJ8hGHy6Qkq/nUdkpCdtnpTU4oZds5AEokyOXgU3lAt2CrkU8Htlq b/CH7712G8fv1DsnC3hfqKhAi+hoxhuiWdW8luJhNs4gy2TB5k1FGAyzse3wqP7ui0Hm qhrKUjbf+bhE2tinW1OLF0lV0fZI9n+4HYTMguqM/lB3q9CmdtnJWsoNd3NFdXAt+5t6 mD7fszIuqsGFLn6YRu2BUxHKXnPSMba/KsxWOA/r2/f0/cAygaPqYxSv/Voo6gSSgkiU 9BBtENFKSNFip+hZSBno86ubV542yMvenJ7T62PhxI6Qpor626EvBwjCR1kokRkrdMnu jIrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VU27FEMG; 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 ca19-20020a056a00419300b0068226d4e8b4si109553pfb.316.2023.06.28.10.55.26; Wed, 28 Jun 2023 10:55:38 -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=VU27FEMG; 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 S231449AbjF1RnZ (ORCPT + 99 others); Wed, 28 Jun 2023 13:43:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45820 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229999AbjF1RnW (ORCPT ); Wed, 28 Jun 2023 13:43:22 -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 B24802123; Wed, 28 Jun 2023 10:43:21 -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 471A261374; Wed, 28 Jun 2023 17:43:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 10EEFC433C0; Wed, 28 Jun 2023 17:43:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687974200; bh=DigUiMepEKZdpHMPnpx95fJpEWDaT/7V9w+BxtVC7MY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=VU27FEMGNX7uLNDp3McHl6GNJMB5ErsahJsW4e9nUmvJxj0MpsU25chnCjvQ1uL0K 4GpFU2m7sSJO+j1nW2wWRD7jXl4G50U5jcGM4AW0e1kiKdQxl4TnLpjaJfVljtaKJN bspgesvLD/sPcVRNqAc/ujhS342ec46lPfoHu0OB0DmCnia/xQCQ8wjuDZgpSoCgu7 1dE0bCEezgL54Vn/yltVu9Aoe9w1DbZhKuMwfw9YcIo3jJGjMTlTKR56gSGbP1c39f 7RvYs+Dt6s9ZK9vJszZlui9OrDVZkFb+excIzKhfJ1bKnhCnNkMV9rsqJ50malblT6 QwaXTZrA7hV6w== Date: Wed, 28 Jun 2023 18:43:15 +0100 From: Conor Dooley To: Evan Green Cc: Conor Dooley , palmer@dabbelt.com, Rob Herring , Krzysztof Kozlowski , Paul Walmsley , Albert Ou , Andrew Jones , Heiko Stuebner , Sunil V L , linux-riscv@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v1 6/9] RISC-V: add single letter extensions to riscv_isa_ext Message-ID: <20230628-gizzard-trading-a5f9785128b5@spud> References: <20230626-provable-angrily-81760e8c3cc6@wendy> <20230626-sensuous-clothing-124f7ae0aedf@wendy> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="IEb0IsuCCuZUv+Ab" Content-Disposition: inline In-Reply-To: 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 --IEb0IsuCCuZUv+Ab Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jun 28, 2023 at 10:33:20AM -0700, Evan Green wrote: > On Mon, Jun 26, 2023 at 4:21=E2=80=AFAM Conor Dooley wrote: > > > > So that riscv_fill_hwcap() can use riscv_isa_ext to probe for single > > letter extensions, add them to it. riscv_isa_ext_data grows a new > > member, signifying whether an extension is multi-letter & thus requiring > > special handling. > > As a result, what gets spat out in /proc/cpuinfo will become borked, as > > single letter extensions will be printed as part of the base extensions > > and while printing from riscv_isa_arr. Take the opportunity to unify the > > printing of the isa string, using the new member of riscv_isa_ext_data > > in the process. > > > > Signed-off-by: Conor Dooley > > --- > > arch/riscv/include/asm/hwcap.h | 1 + > > arch/riscv/kernel/cpu.c | 36 ++++++---------------- > > arch/riscv/kernel/cpufeature.c | 56 +++++++++++++++++++++------------- > > 3 files changed, 46 insertions(+), 47 deletions(-) > > > > diff --git a/arch/riscv/include/asm/hwcap.h b/arch/riscv/include/asm/hw= cap.h > > index a35bee219dd7..6ad896dc4342 100644 > > --- a/arch/riscv/include/asm/hwcap.h > > +++ b/arch/riscv/include/asm/hwcap.h > > @@ -77,6 +77,7 @@ unsigned long riscv_get_elf_hwcap(void); > > struct riscv_isa_ext_data { > > const unsigned int id; > > const char *name; > > + const bool multi_letter; >=20 > Instead of defining a new member, could we just infer this by making a > macro like #define MULTI_LETTER(name) (name[0] && name[1])? Or don't even try to be clever like this and just call strnlen on the name & check if it is 1? It's only used in 2 places. --IEb0IsuCCuZUv+Ab Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRh246EGq/8RLhDjO14tDGHoIJi0gUCZJxxMwAKCRB4tDGHoIJi 0hp+AP91DhkjewdtfZP1vKzJeISjYAdB7Bdm2bRrgqMPsu3f1AD/VqublU31lGDa NFdXAaLNImqjgRoRJ3JGTBfpN5735AM= =udNR -----END PGP SIGNATURE----- --IEb0IsuCCuZUv+Ab--