Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp57692rwb; Wed, 17 Aug 2022 22:44:43 -0700 (PDT) X-Google-Smtp-Source: AA6agR7Cz656IM29j8qOhHcaNrlOFS46YrGs6qCcDGnpoytO6jYHQZeKAbC+tpijr54lRis1qmYa X-Received: by 2002:aa7:dd4f:0:b0:439:c144:24cd with SMTP id o15-20020aa7dd4f000000b00439c14424cdmr979856edw.209.1660801483236; Wed, 17 Aug 2022 22:44:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660801483; cv=none; d=google.com; s=arc-20160816; b=YsnVyHmFJqmQZRD1y3+t6IEnzGSUenvS6tOJms4zMrR+Oj2H32M8QydsUX46NVVVk+ Yh9lValFi355h5KzfHPGH0+1AClcpLFaMTu9FlUuBJ1yDVjc9r0wAOpo3pL93rOP/slz BLhUa/87uQvl+re2SBdOHVM8Fb22QrolzpWvWcG3NHmKTWsgk3FPvwixUAZ83BjjVK7T BZ7GHJjdmAfh+Jsbf3q429bbqhJ49fBPKd6LLYfGUufBEZrj+VWYmLNqojhuO9wMi+wD tXSs1ziMVHIZ2/OW6/tbfLYdR00VV84K2oG/Yhu8TdYUs9RKwdLm0IiOFEkwYcv/hilt c38A== 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=co317W61JM86wn5SpVyHhhw/IObSsmC/ASfLX4XlATs=; b=PstI8t595YyeQ/P7at1NOucsfsTWGal8U2CuMn3vWA6To5Kxr730ykht6qKj4N0dhi jihFPEeduk+4XwTMED6iEeR/MGsZNWUZ1Xnc/5+vYIKCpKv95yitV5SsTZFrUwiDhl/1 BRcY+Ch8uj6IgGG7hSonLzqDGHW7vujMKY6hRFY/HVXWLWXo5l20ApFOmXVDQxD5qJP9 AEmWTjbhSQkdCOfnACNHMRhjJbceK9MIl4tNUBwVADL5DxMBZ+9aity3iKf23rzWCkSB XbOPbdV+RSRnk0g6rm4NWXm+MoCDG5dIRUpwNMug+iZbrgR+HMi+JD3BFN0IPfPs3nPS jo/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=BPpw95zJ; 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 cy12-20020a0564021c8c00b00443e648a721si561173edb.181.2022.08.17.22.44.17; Wed, 17 Aug 2022 22:44:43 -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=BPpw95zJ; 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 S240811AbiHRFkY (ORCPT + 99 others); Thu, 18 Aug 2022 01:40:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46962 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237948AbiHRFkT (ORCPT ); Thu, 18 Aug 2022 01:40:19 -0400 Received: from mail-ej1-x634.google.com (mail-ej1-x634.google.com [IPv6:2a00:1450:4864:20::634]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3740B67170 for ; Wed, 17 Aug 2022 22:40:17 -0700 (PDT) Received: by mail-ej1-x634.google.com with SMTP id k26so1284798ejx.5 for ; Wed, 17 Aug 2022 22:40:17 -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=co317W61JM86wn5SpVyHhhw/IObSsmC/ASfLX4XlATs=; b=BPpw95zJMGlqVarXqqxpRJYVpKvOPdcS+VLwCrc/VR1X4q25zj6Rd4ajymUq+07rDL gomGk73qCBDbrR/aYhXrHRa4jrp5IDm3gWwnlARARvY+wyon2JWVM0H/kNEsFw6G5c9N LpXYo35m0X3UGBj5nsZbYCepal3X1RgYSnENlh3PAfcbE216nzQK/3N+LT3WLJp27Jfi ch4obhMM5NyyuwpWAM9KEXE5sZZw8prfsC4IKI9YaeqqyyLrM3Xy0x8Fy6y7wMGgL4vZ bf+XLjgJABTfKuCUxe3U0naIjEHnYpLgY1jxzomLLF1HbxvSDh3cgzzFoHV7Rj2zC/+m A7Sg== 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=co317W61JM86wn5SpVyHhhw/IObSsmC/ASfLX4XlATs=; b=Pox+LdxXxYBktwFvSyW8Hrrv/FQLhU4p1pEpl29qTZc5whL90s0gnL2Fwc1YvMjokt SBpl3VxE2BPbVN3TxM8cBvmok+lftPgVuIM85Ni+nVkLeJ0p0YedtN4XTw4Dyi6GayfS ySqD6TpcOIHlFKIjyfbaQjDufwRSm39KTExfb5F3Ekm18DSs4j6lK0V2A0NaKDlhwUg+ X1ldAL/SqG930brdlzJBXN94ntvJFcAX3k/EvHOEOy+kdF2C3V+n/p5IDSPvyUxNASbw KRfdcTQJjHw2y7G2saY2ZqMb7posSLyD2xyy1LhYzLbzHn8+NQE23UXky+LMRjOkEYuO kc2A== X-Gm-Message-State: ACgBeo16SDo6cdeieTXx4+jABAdwmklMro2lRydGaHWKWB3GLgxg6akh umd4Dzfzl0hkY2f3k3GDqaGgZA== X-Received: by 2002:a17:907:1c87:b0:6f0:29ea:cc01 with SMTP id nb7-20020a1709071c8700b006f029eacc01mr854089ejc.671.1660801215722; Wed, 17 Aug 2022 22:40:15 -0700 (PDT) Received: from localhost (cst2-173-67.cust.vodafone.cz. [31.30.173.67]) by smtp.gmail.com with ESMTPSA id u21-20020a170906409500b007330204dccdsm317825ejj.140.2022.08.17.22.40.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Aug 2022 22:40:15 -0700 (PDT) Date: Thu, 18 Aug 2022 07:40:14 +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: <20220818054014.wad7uqqnmoc2wrbp@kamzik> References: <20220817201212.990712-1-mail@conchuod.ie> <20220817201212.990712-4-mail@conchuod.ie> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220817201212.990712-4-mail@conchuod.ie> 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 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])+)*$ > > # RISC-V requires 'timebase-frequency' in /cpus, so disallow it here > timebase-frequency: false > -- > 2.37.1 > Reviewed-by: Andrew Jones