Received: by 2002:ab2:1347:0:b0:1f4:ac9d:b246 with SMTP id g7csp338951lqg; Thu, 11 Apr 2024 04:55:33 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXFF6QcHz/hnO45oOeOj8SBlzPjR+b/IuhYlVrm48gaPFsRkbjmoNkhTaHX8HmqIQLGNoAg8/9O7guZ0vHhyvayA39tRigwA/i+Vw990g== X-Google-Smtp-Source: AGHT+IGu1FeVi+xFft6NIMjcVVd0xtJX29dqB1sz6GZ8jVzAKl55zcXbT0C6RMuI3yy++Mnx5xW5 X-Received: by 2002:a05:620a:2447:b0:78e:c3b8:ccd4 with SMTP id h7-20020a05620a244700b0078ec3b8ccd4mr1183344qkn.2.1712836533567; Thu, 11 Apr 2024 04:55:33 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712836533; cv=pass; d=google.com; s=arc-20160816; b=FTUqcmlPrCqiqowE9qGH45jxxDttQe2e3AWfrb07YRk+9oBzWA29GeX82JnY8GIfUP nYX4GD9fNUs6hcLUmNH8F7o2u97uDuNBsAZYsV4euiu5ZqBVw9wUsJDHv8h0nJUfPC9o YFMjL3OMQtPg3O6lGfxRdYFE+6tslixO3NIsrJ8IabkLAyVqFNGP9sL7GDDWu8jCx0aw ysxoh/vgtx9YZ4GUbCEQhVpi1cbqgrASH9Vyi4ZaG10vbdTVnRb5x81cOnEKfx8Lrep6 NmU2YvwpojHLEJimNA7D7yL2o/xGOdVT5KX1N7XrSqI9+lCRq8jVROMa9MVotEs2i7G3 ed5g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=wm1tePYEdCgb9twEmI1G+QhSAezoUG9vOyfgy+CwQe8=; fh=2eW/vG6zYb2K2nq5XRyNUirYHzVRiNYVFjbpsc0TyiE=; b=UnGCe+c4fKObsCV9hDMEPS2SIMv7r5+zWcsWiWjAHmbGw5rWbIcF7dVi4c5VaAb4Xu buAztv2ubvnz6y3XH4QbH0J36yvkih608QO+Cugkvi3AG82Q/JvDvBdRiYHskyv7xBE3 wA7oBF6XIU9r/QE6N5jhMzGv52PbzDHmxNSVmgjNlzIsI1NwjNqPNlxGz2+eP+PSYCAH otjz/BXmc4uF0wQ5GbGKT+HVprKUoOQcucQpD9IEMCNyykkgx4rIEZoHpUnRHSudx2sq 4e1esyRkvERCS6AFGYQ6XnFO9OWaSRQXRpewGg4dRcV1wryLZFqPzOIz0js5oSeHx9c6 HZ5g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=bP56bhYa; arc=pass (i=1 spf=pass spfdomain=microchip.com dkim=pass dkdomain=microchip.com dmarc=pass fromdomain=microchip.com); spf=pass (google.com: domain of linux-kernel+bounces-140386-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-140386-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microchip.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id j17-20020a05620a147100b0078d543778c5si1359000qkl.91.2024.04.11.04.55.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Apr 2024 04:55:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-140386-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=bP56bhYa; arc=pass (i=1 spf=pass spfdomain=microchip.com dkim=pass dkdomain=microchip.com dmarc=pass fromdomain=microchip.com); spf=pass (google.com: domain of linux-kernel+bounces-140386-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-140386-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microchip.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id E98C71C20CC1 for ; Thu, 11 Apr 2024 11:55:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5FE9914AD02; Thu, 11 Apr 2024 11:55:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="bP56bhYa" Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1E29714A094; Thu, 11 Apr 2024 11:55:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=68.232.153.233 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712836521; cv=none; b=elUc1XiTYlcaZfD3O3nyGnMus5utac1TQbH3jr8A6FBP/w7NuXnDw/kK0QNOs0RVqEHc9TmEJvhrdrT9asGTwDpk2QmNtQNROgN3Jaxw1lq9BjlJLmdk7b2svOUY9N/ZUUuJ3CdM+iL7i/tkyZpEtJP/n0mWBtLj5tkDs4HEkzs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712836521; c=relaxed/simple; bh=qUHLbICK+OzVzpgAugTLlBx/+ikYrtOfR4K8Nx4oYfw=; h=Date:From:To:CC:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=sr3rCctWzL7tBgODvASomc3yId/sR/r0qOevb+lhYrs04lcZ2vFqAXLmxjEASs19YdSI3sh8LIxJ8exVBpJO6SSir1VdeyVsoOJwgItQ5SVCPNUocZx+HY8eFqa+cvJkANTgbwd+YlfZjOSR6P5qhjGAypIXIdanB+uZAyaIdcw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=microchip.com; spf=pass smtp.mailfrom=microchip.com; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b=bP56bhYa; arc=none smtp.client-ip=68.232.153.233 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=microchip.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=microchip.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1712836519; x=1744372519; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=qUHLbICK+OzVzpgAugTLlBx/+ikYrtOfR4K8Nx4oYfw=; b=bP56bhYazXE6fy9pzuspJ00L7+mAYf9fViRTI/B1qbtIWpCrX5UoQgUr bsim6FASELIQkXU8tHt60EukTZDXe0LjQuo4NSLV+7S/Fj3JtebeURRLi cDS+/LaqmRv/U5HpGBa+A5vS1tV67B+o49zbWnUQhS2Zp97F3DZX0S+Pr Bz3kT3FrCrjtDT/8reOa+zOyVND2f//FmvRwndqA4tZT4Q010JJw77jTu A5YlSZEczLKN3i8aWAsom5h5/zlz22O0DNnmIfW+KJVpFhf0gxZq8I5Ms o2jQu7ShpC9vB/21on4GXcydv0LkNlmK2kcWIQ5JyG8s/qJPJBrhbBwbg g==; X-CSE-ConnectionGUID: z5vJuW0ISXO47ggJt+rbgA== X-CSE-MsgGUID: mQWA4GzKR12LP6aGbYLBwA== X-IronPort-AV: E=Sophos;i="6.07,193,1708412400"; d="asc'?scan'208";a="251356126" X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa5.microchip.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 11 Apr 2024 04:55:16 -0700 Received: from chn-vm-ex03.mchp-main.com (10.10.85.151) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Thu, 11 Apr 2024 04:54:36 -0700 Received: from wendy (10.10.85.11) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35 via Frontend Transport; Thu, 11 Apr 2024 04:54:33 -0700 Date: Thu, 11 Apr 2024 12:53:43 +0100 From: Conor Dooley To: =?iso-8859-1?Q?Cl=E9ment_L=E9ger?= CC: Deepak Gupta , Conor Dooley , Jonathan Corbet , Paul Walmsley , Palmer Dabbelt , Albert Ou , Rob Herring , Krzysztof Kozlowski , Anup Patel , Shuah Khan , Atish Patra , , , , , , , Subject: Re: [PATCH 07/10] riscv: add ISA extension parsing for Zcmop Message-ID: <20240411-backwater-opal-00c9aed2231e@wendy> References: <20240410091106.749233-1-cleger@rivosinc.com> <20240410091106.749233-8-cleger@rivosinc.com> <20240410-jawless-cavalry-a3eaf9c562a4@spud> <20240410-judgingly-appease-5df493852b70@spud> <1287e6e9-cb8e-4a78-9195-ce29f1c4bace@rivosinc.com> <20240411-superglue-errant-b32e5118695f@wendy> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="jM0CNQ7ZIr2lhGV/" Content-Disposition: inline In-Reply-To: --jM0CNQ7ZIr2lhGV/ Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Apr 11, 2024 at 11:08:21AM +0200, Cl=E9ment L=E9ger wrote: > >> If we consider to have potentially broken isa string (ie extensions > >> dependencies not correctly handled), then we'll need some way to > >> validate this within the kernel. > >=20 > > No, the DT passed to the kernel should be correct and we by and large we > > should not have to do validation of it. What I meant above was writing > > the binding so that something invalid will not pass dtbs_check. >=20 > Acked, I was mainly answering Deepak question about dependencies wrt to > using __RISCV_ISA_EXT_SUPERSET() which does not seems to be relevant > since we expect a correct isa string to be passed. Ahh, okay. > But as you stated, DT > validation clearly make sense. I think a lot of extensions strings would > benefit such support (All the Zv* depends on V, etc). I think it is actually as simple something like this, which makes it invalid to have "d" without "f": | diff --git a/Documentation/devicetree/bindings/riscv/extensions.yaml b/Do= cumentation/devicetree/bindings/riscv/extensions.yaml | index 468c646247aa..594828700cbe 100644 | --- a/Documentation/devicetree/bindings/riscv/extensions.yaml | +++ b/Documentation/devicetree/bindings/riscv/extensions.yaml | @@ -484,5 +484,20 @@ properties: | Registers in the AX45MP datasheet. | https://www.andestech.com/wp-content/uploads/AX45MP-1C-Rev.-= 5.0.0-Datasheet.pdf | =20 | +allOf: | + - if: | + properties: | + riscv,isa-extensions: | + contains: | + const: "d" | + not: | + contains: | + const: "f" | + then: | + properties: | + riscv,isa-extensions: | + false | + | + | additionalProperties: true | ... If you do have d without f, the checker will say: cpu@2: riscv,isa-extensions: False schema does not allow ['i', 'm', 'a', 'd= ', 'c'] At least that's readable, even though not clear about what to do. I wish the former could be said about the wall of text you get for /each/ undocumented entry in the string. --jM0CNQ7ZIr2lhGV/ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRh246EGq/8RLhDjO14tDGHoIJi0gUCZhfPRwAKCRB4tDGHoIJi 0stXAP9uCAN5bZHcv91EPinTAeqedRCedCrkE5YEE9f8JUyrxgD8CAHddpGznZHx TNOtc9GaDiQRS4tdrlJo9+Hn1Puv4w0= =k3aJ -----END PGP SIGNATURE----- --jM0CNQ7ZIr2lhGV/--