Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp78776rwb; Wed, 17 Aug 2022 23:16:10 -0700 (PDT) X-Google-Smtp-Source: AA6agR7TiZ4PN0WHtrgpZx1skodBxloHfBatwk4NxB8z16MpW3uIv9xo4sKDBZhqKXXR8YNpo6jH X-Received: by 2002:a17:902:9005:b0:16c:f62c:4376 with SMTP id a5-20020a170902900500b0016cf62c4376mr1386381plp.87.1660803370378; Wed, 17 Aug 2022 23:16:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660803370; cv=none; d=google.com; s=arc-20160816; b=e2nAzl/EDl5B6alwC0oGr6LHC6OAxYJ3Nj341UjhD98XfmzJ3wi8vhfpfEa2uBU+oz nh92qNO+i1q66EBDzh8X4YcMiP0w5sq0FO5iBThYFv+MCDz17u6Ca5d6fx4PcAlijnor rDjmQwZ8UEVZ7O8eFx1BfjYtVYpFV3ErzehP884xSS0tkr9Yf0fC4IxmOwPKey/KpC3N hVInWRh6rwCUo9Rf118iary3pisggDXmdMEveL57hp2acFpBimcKbP5uOEYf5ykxxxiQ TwuzjLZlyHTi0C2y/5tf317fZrojLrP/7DLBX+TMWuOPDNLuhXtieSesAeMQmIT53fJT Vj1g== 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=zl2T5yu71OCZ3gEUlCSd7WNQiwAgE6fudMgRt3dBKns=; b=aBFDyn0LfD0CBZXrmeqiUA1Y7ptZIDQYX6zgzUp5EmcVHUN9igl5vyZ42XmETMHhbq CIcml/couXvL2mDevuLlvnwSL2Qk1ldox+jwndtWC9ptEo2hSHJWatjA3OfTMDLcbTMY WADIBd+e6j7ka9bn5dK1zO/CXvzLYLVPiicC/2TNLJkRf60E6buJ4YoANpFUEGVSthy+ 966Z9iZaL/E+wwjUgoF8QXWIQtK0pHgFJ+D4OgBPy1OIfE4MZBh0MQ4KZ4Xd6xrLW2ZW vyTrTLqcKEeXkPe9Ey6+t5EtnVg20aEm8DGx7/4Co6BwPrUFwUexclerRiFPeHpc06IY iurw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=NOzfGWE4; 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 t1-20020a170902e84100b0016dbc1467f0si682483plg.148.2022.08.17.23.15.59; Wed, 17 Aug 2022 23:16:10 -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=@ventanamicro.com header.s=google header.b=NOzfGWE4; 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 S243362AbiHRFtE (ORCPT + 99 others); Thu, 18 Aug 2022 01:49:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36136 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243329AbiHRFtB (ORCPT ); Thu, 18 Aug 2022 01:49:01 -0400 Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com [IPv6:2a00:1450:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E10554A10B for ; Wed, 17 Aug 2022 22:48:56 -0700 (PDT) Received: by mail-ej1-x62d.google.com with SMTP id k26so1312527ejx.5 for ; Wed, 17 Aug 2022 22:48:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc; bh=zl2T5yu71OCZ3gEUlCSd7WNQiwAgE6fudMgRt3dBKns=; b=NOzfGWE4AW9ZmOsBO954Q17+AKVcl5JeUUM1sy2wwGXKvacuUd+FtfffNKwlvrIlUK h+IvPG//sIb5yfq6tLpvVblMsJi2GIQ7i4hhhMo8yxvqVRsMRLI0MfRuZwtR0tVV+qh3 nvArlrIZ5vkliAS1ooNsz2q5c38dit6DAXLpH4+9Yuj99Tz66TtX738iJZpV19wGLeGj 0BB+WiWeoxCMZAvw4kzccNZiCGiruiQ75z3d6rrNEWGehME3FtKY89a7fixv07ONeT6N 1J18JXzLdjSWu1KAtBya8mY/4vRR6KlOPuO4s9uqrRb/qJrpC13KjmCn1gxKNwSSIe1H xyNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc; bh=zl2T5yu71OCZ3gEUlCSd7WNQiwAgE6fudMgRt3dBKns=; b=K1VrwgCIRqVbZEv0SPxarAk1IPhx/v9mWGixu/9DvlW/QiKlko01fjjP/wYFAIZ0Fa Nva/t9aaVdDY9u+qtp2LyfaS15Ey8ToLqLMxru6VG44OPTmTnGiQrQwJhrlT9iCryGpu 9cW645uVD3b7eM4B5W32PAfuHlSYXUGAR32vk1KjO4I1weCGQVD9IlStzLo9/26BkLML qOh8XbkugzjA7nBePJhUnqvKx2Rh/UGQLv2kWs98de219NhUPBmtNhv891EFb8Fd8iMc mRsBpZX62Bk9gdZIHtSpXAxum0MUY/61jt0GvrjYts4zO/D5WRGLhaFJoGB+OmKFnriZ 9d0A== X-Gm-Message-State: ACgBeo3A8r2CHP3odfzcxtu31sEZAsGuNLvNXWDlH+WmLfdR71JfYxjm tmMhOS8K8eDmxJ7TQ8x+kvH7rgMxNCBvkw== X-Received: by 2002:a17:907:28ca:b0:730:aabe:2e28 with SMTP id en10-20020a17090728ca00b00730aabe2e28mr876966ejc.72.1660801735424; Wed, 17 Aug 2022 22:48:55 -0700 (PDT) Received: from localhost (cst2-173-67.cust.vodafone.cz. [31.30.173.67]) by smtp.gmail.com with ESMTPSA id by6-20020a0564021b0600b0043d34ab7ad6sm491661edb.49.2022.08.17.22.48.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Aug 2022 22:48:55 -0700 (PDT) Date: Thu, 18 Aug 2022 07:48:53 +0200 From: Andrew Jones To: Conor Dooley Cc: Thomas Gleixner , Marc Zyngier , Rob Herring , Krzysztof Kozlowski , Palmer Dabbelt , Paul Walmsley , Albert Ou , Daniel Lezcano , Anup Patel , Conor Dooley , Guo Ren , Sagar Kadam , Jessica Clarke , linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-riscv@lists.infradead.org, qemu-riscv@nongnu.org, Rob Herring Subject: Re: [PATCH v3 3/4] dt-bindings: riscv: add new riscv,isa strings for emulators Message-ID: <20220818054853.7rivuc4qyojzeu3s@kamzik> References: <20220817201212.990712-1-mail@conchuod.ie> <20220817201212.990712-4-mail@conchuod.ie> <20220818054014.wad7uqqnmoc2wrbp@kamzik> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220818054014.wad7uqqnmoc2wrbp@kamzik> 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, SPF_HELO_NONE,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 Thu, Aug 18, 2022 at 07:40:14AM +0200, Andrew Jones wrote: > On Wed, Aug 17, 2022 at 09:12:12PM +0100, Conor Dooley wrote: > > 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: > > - 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. > > - 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 > > - 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. > > - ima are required > > > > 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. > > > > 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/ > > 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..c0e0bc5dce04 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?(?:(?:_[zsh][imafdqcbvksh]|_x)(?:[a-z])+)*$ Actually we don't want S and H extensions to be treated like Z, but rather like X. Only Z extensions have the category character convention. (And I'm still tempted to just drop the enforcement from Z too, since it adds additional maintenance and we've already settled for something less than complete.) Thanks, drew > > > > # RISC-V requires 'timebase-frequency' in /cpus, so disallow it here > > timebase-frequency: false > > -- > > 2.37.1 > > > > Reviewed-by: Andrew Jones