Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp903499rwe; Wed, 24 Aug 2022 10:58:57 -0700 (PDT) X-Google-Smtp-Source: AA6agR6ZFqOkHV/78mFqNUisRWGQtp+zALIhm90bQ/vrw3V0y+yVXXhY0UeInxXzPr3P/P3c6mLF X-Received: by 2002:a17:906:99c1:b0:6fe:b01d:134 with SMTP id s1-20020a17090699c100b006feb01d0134mr80568ejn.598.1661363937253; Wed, 24 Aug 2022 10:58:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661363937; cv=none; d=google.com; s=arc-20160816; b=mD6xTBmUWR8UpXYwn/AWdar6iO7hc22EUl6U7i72nekckLd1lxXPilo/N6+kFcFQ4T WhDnL3cGbm35aMshadIEwPAsLxtE2uAuIAe5qMhrCeyOJKsahzcSFPKKTXYkbJFCNOHs S5+/E2+RQuHpHlq+AOJQ3ngLl0bZksmWV+riVc4P7k+32w6MEipg5KqDPLRX6fYEwTpZ L/UFEdLndUlBcPwpZK1XFMyTuxGk3oDN+OLOKEvD8vvhXcHQMPQI9ayZuROxSayxy0l2 2YwWHgHN9KSpQp6+tj9NhzYIli6iCDFGVb/zr/VurlMijN6Bbb1tRVjsyzaXgs4OGwin zy0A== 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=it3BHcwBZJgwHLyYyrv/lF2Ls7eKvtSpkwIRfz3a1Aw=; b=ELa4/T984ef/a+5vJtqeSfKR7pzsBWOR28lQyip+cAMuy8sO2/Jd+MRn5r4wqTAt4F e0bSN4rhRrwKo+90qELGvBD+xouXK4JRUObikHBzuF/eg7inSSHExiPF0eiT7fcQB9cx Q7RxNeXSn1rlqJcgL21wuAC1o179nxczSP7uWSZanCv/rgk/JoQAx4HPBBy0Eru8KFXz n5/0xQWKZ/ejcbVRW6KeoMwbcxvVOrz23Ycdul8mkPK/hqWNF/3XRcJG1z8Q2lFuJzjB XUVlKJuM0+tOxpxuQ5Ebw8X0e5yCZp2Z83t1ezfpZHxtqS/K/FoHadszB3zEXnIThYTY UCQQ== ARC-Authentication-Results: i=1; mx.google.com; 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=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 y10-20020a056402440a00b00445fc3afc57si5707348eda.360.2022.08.24.10.58.30; Wed, 24 Aug 2022 10:58:57 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=sntech.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239618AbiHXRmF (ORCPT + 99 others); Wed, 24 Aug 2022 13:42:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48154 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238822AbiHXRmD (ORCPT ); Wed, 24 Aug 2022 13:42:03 -0400 Received: from gloria.sntech.de (gloria.sntech.de [185.11.138.130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 57FFD7E82D; Wed, 24 Aug 2022 10:42:00 -0700 (PDT) Received: from ip5b412258.dynamic.kabel-deutschland.de ([91.65.34.88] helo=diego.localnet) by gloria.sntech.de with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1oQuNv-0004hr-Rm; Wed, 24 Aug 2022 19:41:47 +0200 From: Heiko =?ISO-8859-1?Q?St=FCbner?= To: Thomas Gleixner , Marc Zyngier , Rob Herring , Krzysztof Kozlowski , Palmer Dabbelt , Paul Walmsley , Albert Ou , linux-riscv@lists.infradead.org Cc: Daniel Lezcano , Anup Patel , Conor Dooley , Guo Ren , Sagar Kadam , Jessica Clarke , Andrew Jones , linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-riscv@lists.infradead.org, qemu-riscv@nongnu.org, Rob Herring , Conor Dooley Subject: Re: [PATCH v4 3/4] dt-bindings: riscv: add new riscv,isa strings for emulators Date: Wed, 24 Aug 2022 19:41:46 +0200 Message-ID: <2846981.bB369e8A3T@diego> In-Reply-To: <20220823183319.3314940-4-mail@conchuod.ie> References: <20220823183319.3314940-1-mail@conchuod.ie> <20220823183319.3314940-4-mail@conchuod.ie> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" 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-kernel@vger.kernel.org Am Dienstag, 23. August 2022, 20:33:19 CEST schrieb Conor Dooley: > From: Conor Dooley > > The QEMU virt and spike machines currently export a riscv,isa string of > "rv64imafdcsuh", > > While the RISC-V foundation has been ratifying a bunch of extenstions > etc, the kernel has remained relatively static with what hardware is > supported - but the same is not true of QEMU. Using the virt machine > and running dt-validate on the dumped dtb fails, partly due to the > unexpected isa string. > > Rather than enumerate the many many possbilities, change the pattern > to a regex, with the following assumptions: > - ima are required > - the single letter order is fixed & we don't care about things that > can't even do "ima" > - the standard multi letter extensions are all in a "_z" format > where the first letter of is a valid single letter extension > - _s & _h are used for supervisor and hyper visor extensions > - convention says that after the first two chars, a standard multi > letter extension name could be an english word (ifencei anyone?) so > it's not worth restricting the charset > - as the above is just convention, don't apply any charset restrictions > to reduce future churn > - vendor ISA extensions begind with _x and have no charset restrictions > - we don't care about an e extension from an OS pov > - that attempting to validate the contents of the multiletter extensions > with dt-validate beyond the formatting is a futile, massively verbose > or unwieldy exercise at best > > The following limitations also apply: > - multi letter extension ordering is not enforced. dt-schema does not > appear to allow for named match groups, so the resulting regex would > be even more of a headache > - ditto for the numbered extensions That description sounds about right, though me and regexes never became friends, so the following will have to do: Acked-by: Heiko Stuebner > Finally, add me as a maintainer of the binding so that when it breaks > in the future, I can be held responsible! > > Reported-by: Rob Herring > Link: https://lore.kernel.org/linux-riscv/20220803170552.GA2250266-robh@kernel.org/ > Reviewed-by: Andrew Jones > Acked-by: Guo Ren > Signed-off-by: Conor Dooley > --- > Palmer, feel free to drop the maintainer addition. I just mostly want > to clean up my own mess on this when they decide to ratify more > extensions & this comes back up again. > --- > Documentation/devicetree/bindings/riscv/cpus.yaml | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/Documentation/devicetree/bindings/riscv/cpus.yaml b/Documentation/devicetree/bindings/riscv/cpus.yaml > index 873dd12f6e89..90a7cabf58fe 100644 > --- a/Documentation/devicetree/bindings/riscv/cpus.yaml > +++ b/Documentation/devicetree/bindings/riscv/cpus.yaml > @@ -9,6 +9,7 @@ title: RISC-V bindings for 'cpus' DT nodes > maintainers: > - Paul Walmsley > - Palmer Dabbelt > + - Conor Dooley > > description: | > This document uses some terminology common to the RISC-V community > @@ -79,9 +80,7 @@ properties: > insensitive, letters in the riscv,isa string must be all > lowercase to simplify parsing. > $ref: "/schemas/types.yaml#/definitions/string" > - enum: > - - rv64imac > - - rv64imafdc > + pattern: ^rv(?:64|32)imaf?d?q?c?b?v?k?h?(?:_[hsxz](?:[a-z])+)*$ > > # RISC-V requires 'timebase-frequency' in /cpus, so disallow it here > timebase-frequency: false >