Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3962669rwa; Tue, 23 Aug 2022 13:25:40 -0700 (PDT) X-Google-Smtp-Source: AA6agR7zANpcrQysDu7yy/Vixdt4d+5mEpT6cKy3AHU7je6cTLkLgswyjV74GF8XmS/hPOwoarJP X-Received: by 2002:a17:90b:38ce:b0:1fb:7334:2554 with SMTP id nn14-20020a17090b38ce00b001fb73342554mr2460576pjb.110.1661286339885; Tue, 23 Aug 2022 13:25:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661286339; cv=none; d=google.com; s=arc-20160816; b=hpaVtm5UtUYySf2chTwi8SUOdcqEUuaRRO9P0uqoUR+WHHz/9WDHzv31bn5dFdjMc5 khSFvYqL79mCv8YV5f+Y/jr07lXXNyGDNlHnGsdUQky0PdTTsjIHnpqrh1sIuvNE527k H2uUDEa2ro2wxPC1/p0ilchuQxyTvIq0rmakPTqLXD7ReZ/X4U3M9j2hbshzfZ0WjmTk s3jjFlhR6gFRFVvzTcu0uEFTSrNIq7NgTF4sJY6IYSFx02XmXuwyVUjM6vdfJVZQyxNU 9aeRsXkzZSwvOxGJnBYYFtZ0ezhxdj01nymQplE11I7OrSzotrJPyxAy73EoTKz7NwFn e/QA== 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 :dkim-signature; bh=zfZqIEnKLgqKdt6yEdOe5gINIOFbq6xfPYo5xvbrixM=; b=CHvRxVCrtVsH980YrAb0h/q8zMyMfY0vQ/hdzs89jHWVpoX8EkZflHaqKxrgOGTk6x Nd3woX+TPSP+DRvm2Qc8srmoAoIoQtLNxAfxIgUU+rwfdV3b3xt7owWJq1s1uJdtpr9v O5vqOaIDBzX6cg4LjlDHzkaVPBb93HuwKeH0/YPJO7ZsFrm216c8jX/RgT35a3rpWv13 JQ176wSwwzU/IEqMMs1NVj2cXl09NHTuF02/n4EWwZ6WJaGb/ErfK2w2GJvCHoXmEgfo WEIrOFLvUHK7TBgVzuvx9UUJW+YTM9XU2fVohVtilzJqCox8GLlsl0WJquzZnE/UrK/N DIlg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@conchuod.ie header.s=google header.b=f5pjcIK+; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=conchuod.ie Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t22-20020a17090a951600b001fad8acb3b0si13306891pjo.24.2022.08.23.13.25.28; Tue, 23 Aug 2022 13:25:39 -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=@conchuod.ie header.s=google header.b=f5pjcIK+; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=conchuod.ie Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232411AbiHWThm (ORCPT + 99 others); Tue, 23 Aug 2022 15:37:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60828 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232054AbiHWThS (ORCPT ); Tue, 23 Aug 2022 15:37:18 -0400 Received: from mail-wm1-x330.google.com (mail-wm1-x330.google.com [IPv6:2a00:1450:4864:20::330]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D68FD98CAC for ; Tue, 23 Aug 2022 11:33:59 -0700 (PDT) Received: by mail-wm1-x330.google.com with SMTP id l33-20020a05600c1d2100b003a645240a95so5838602wms.1 for ; Tue, 23 Aug 2022 11:33:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=conchuod.ie; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=zfZqIEnKLgqKdt6yEdOe5gINIOFbq6xfPYo5xvbrixM=; b=f5pjcIK+H2mtPPE5b3VybQ5o01iECTvnw1E+28BxIUWO/6RjUzl2PBeS9opQx/sJtx yG2ysXoQtSd7WBzuZMOdXnT8YJjxr3vYR5+T/JX7WViSSLLzyWulBQl9Ko9BJ17LqXeZ ETGaCTo5yarZMm+oslfXmcNAi4epItnAZqaBYIMkIQm0At1DRkfT+iDb+SfVqSxBugml /5ZzzSEfTKoyNJSdvCwfE6CeTnMSICRVyM7qDc7zTPhZyBfqGkmjUnvVx/itr2tPYaA8 ONtGo4StZVjqqloFXAtoKHXtIcn38GlQfWO7p9BYujiPWphKMNU0v9xU6g0zgzl9njmI LYZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=zfZqIEnKLgqKdt6yEdOe5gINIOFbq6xfPYo5xvbrixM=; b=rzkhJi8y8xJc/JzV5ZwxDMMAnZUmRn6111A6pf/8MUbX2xLfqeWZeJEYnbWZXnBZnV HtzQtCojRWLSC+wcwbA+obhN/Sn+hqrcPD6ZcVPyc2j8P+e6qlU930YLjwxxl7G0ekqB QiOv/4sshcaooBU6iALHyAUP/GIh9uFxZ0MfddOJmPr2SolnGt9SrvnI22bTC2BFnd0h ABJ9alE5oj+e7S+7qRO+F8myS5dauNTLqzJEK/fwXnmfOjKEBSyvnAnJLFnYKBnZ6JDF 0U1vntrwWHo7hlo4xD+9AQ5Wn11B0UrnPmAD8gX3AVdkHppXmQzw8DrHVyTgZOgAOdma q8rg== X-Gm-Message-State: ACgBeo2pzLL1ARKQ+5b0e24nmuBjcr+Dw6dP0/5MHFC0hARfFK5BFI9e Pti1ZXX3T+l0vkvo96fKfN2CUQ== X-Received: by 2002:a1c:c91a:0:b0:3a6:38bf:2c36 with SMTP id f26-20020a1cc91a000000b003a638bf2c36mr3062339wmb.38.1661279637684; Tue, 23 Aug 2022 11:33:57 -0700 (PDT) Received: from henark71.. ([51.37.149.245]) by smtp.gmail.com with ESMTPSA id p16-20020a05600c1d9000b003a5fcae64d4sm19396556wms.29.2022.08.23.11.33.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Aug 2022 11:33:57 -0700 (PDT) From: Conor Dooley To: Thomas Gleixner , Marc Zyngier , Rob Herring , Krzysztof Kozlowski , Palmer Dabbelt , Paul Walmsley , Albert Ou 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 Subject: [PATCH v4 3/4] dt-bindings: riscv: add new riscv,isa strings for emulators Date: Tue, 23 Aug 2022 19:33:19 +0100 Message-Id: <20220823183319.3314940-4-mail@conchuod.ie> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220823183319.3314940-1-mail@conchuod.ie> References: <20220823183319.3314940-1-mail@conchuod.ie> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 autolearn=unavailable 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 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 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 -- 2.37.1