Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp19560290rwd; Wed, 28 Jun 2023 10:54:23 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7XxVB9JqA7DdmzOkvbK7hiL64bmgBqKeOna+sHjCkfhICGWjVzi0pUcBtXfrYyOWfV2CHU X-Received: by 2002:a92:dc45:0:b0:341:c8db:c8d4 with SMTP id x5-20020a92dc45000000b00341c8dbc8d4mr36961807ilq.11.1687974863371; Wed, 28 Jun 2023 10:54:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687974863; cv=none; d=google.com; s=arc-20160816; b=UsXigX/AOhN6uWHdZlMowFLhuqa59fxmQ0STYTOyEMlVpGW1w3iR3u05SGt9EFyycJ Efm75OtC57cHW0Nxjvp4TDeJr+5ZXGWwx9YpPgsBD1o/FPs5AqCkvg9z8tj4uFNDdbKF 9sYYLsuPYG0UaZqfZ+BRf7OD96FRSxgei38oI6rZM0O963FUoS5/LckBSnTCwo/bBGZT p2gtM21n0nSe224U2G2rajoMRY3kuGL6RtrRF65p3hJmzP0wUX1mPhdJpfnQoccDy9VS LG9BIBpOd//xt/mCP+xZ1kNnBN1geijIT8BJD+4vMEWQrG1jKymXYYt6vBe0KfmRO/qC XRkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=mu8Gi2wSnoTXkOMcCin+xgkyW4SfsZOtfaMQ9m+MZ5U=; fh=WUEY+oAJIFgM/51+q8PH72R4umiCgb326/xtUK4FtW8=; b=KK2pZgkQi1Fj30YcumHWZZT0BTiPaHGIdDsCrpkmO8oMJLr5RXx8iSwCxXSfjWLlld oa6JydrA/d8d5wOQrs8GLHx7oQj7vQ27ao9of/UCBDySiI0rcZEsOqpHyVTIPMekUjOZ xYrg5uClyx1zP0EnIWj9VfitW1RnDGbc8UGwpQ2MNiPEDYYXg59iwgnNBWdi2vTapOvK v1VD9mBjrvroctH7zxfrIg/HhnaKRzAMp/obVRRh0t/X1hvQSFEkPlCt3+3aYqxNqnz6 pl1YrHrMqt9K9HFHqdX0+XeUukzS0Cf+Umo5ghiG+Z1TCQ/tHO/H3L1o3AZaWSZhWa56 J8xw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rivosinc-com.20221208.gappssmtp.com header.s=20221208 header.b=ctXSjsQS; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v186-20020a6389c3000000b0054fb9698c4esi9588568pgd.499.2023.06.28.10.53.59; Wed, 28 Jun 2023 10:54:23 -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=@rivosinc-com.20221208.gappssmtp.com header.s=20221208 header.b=ctXSjsQS; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230379AbjF1ReF (ORCPT + 99 others); Wed, 28 Jun 2023 13:34:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44882 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231290AbjF1Rd7 (ORCPT ); Wed, 28 Jun 2023 13:33:59 -0400 Received: from mail-lf1-x12c.google.com (mail-lf1-x12c.google.com [IPv6:2a00:1450:4864:20::12c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5EB4F210A for ; Wed, 28 Jun 2023 10:33:58 -0700 (PDT) Received: by mail-lf1-x12c.google.com with SMTP id 2adb3069b0e04-4fb8574a3a1so3542617e87.1 for ; Wed, 28 Jun 2023 10:33:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20221208.gappssmtp.com; s=20221208; t=1687973636; x=1690565636; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=mu8Gi2wSnoTXkOMcCin+xgkyW4SfsZOtfaMQ9m+MZ5U=; b=ctXSjsQSzaufeY9GTPqn+avzhgMNvjo9PgbMSWr3gC1OzFmKrqHpkfW/Hh4/BxaRHj oatlyGdfBX5is3/rXAkRtPpuVaBjnbVAWHtGueEalCtd0kiWVV+nHvycDQA6ttsaegMd 3lcR9743n2mULg7SZFP8WAzgB7VrDSJyHfySHd5R6/1eVpsEDvWiJ7WrXlv0a9KSs29x WETDEpY2W0csY2Kc8h8MS0M9gIM0+saldCRjt5f4n2ePrtvwjqb9Q37Q+s3b2t5w550r rE7oMwUkLRYM2F7ETOGVj7LBn7mLZofgXEPOlaZgFM5DxnuqH6dXXJk0pzK8+aL2GhCR 7xfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687973636; x=1690565636; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=mu8Gi2wSnoTXkOMcCin+xgkyW4SfsZOtfaMQ9m+MZ5U=; b=jsgTD4p/1mBRc8M+QSkIzmX9sRestu9G5Eip494OCNtHqDctlmZsnHS7QV98iGSLqe jJIekSaGRhFLpCHvjHIte4J4JJ+I+1WoSEogC5GW1HUBo4sxKfMyQ7ghkkLM7cMBh7rp lxEwn2tVTueXTRw2XcVyupraV50rcY26M2E7G83gUeDOXrNwZlV0SUDfV0GNfift+IR9 ln3nsqec8aK2DGFawZOOmLBsfDxitWZpiEK5acFAw8KbdRaOBU2NFpuCHWDgKQ4iKAjN 5igsLxhZUazLsrDQdcHwKHbJBnmn2DhLiUzGX2OwJDZz6ITD+iTewjYG8hnkC/Ty1CpP HSAg== X-Gm-Message-State: AC+VfDxSoKU7BxPgdJ8/+yZYVI80x8Yw5QRrIvR4FmeDYaRS+qvAZrKq xFczOFIRHRLK4qiCVTWBeeurjNFBN8DEGr8n/8H7PQ== X-Received: by 2002:a19:7710:0:b0:4f8:6800:86f6 with SMTP id s16-20020a197710000000b004f8680086f6mr16992828lfc.49.1687973636628; Wed, 28 Jun 2023 10:33:56 -0700 (PDT) MIME-Version: 1.0 References: <20230626-provable-angrily-81760e8c3cc6@wendy> <20230626-sensuous-clothing-124f7ae0aedf@wendy> In-Reply-To: <20230626-sensuous-clothing-124f7ae0aedf@wendy> From: Evan Green Date: Wed, 28 Jun 2023 10:33:20 -0700 Message-ID: Subject: Re: [PATCH v1 6/9] RISC-V: add single letter extensions to riscv_isa_ext To: Conor Dooley Cc: palmer@dabbelt.com, conor@kernel.org, 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,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 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/hwca= p.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; Instead of defining a new member, could we just infer this by making a macro like #define MULTI_LETTER(name) (name[0] && name[1])?