Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1619674rwd; Thu, 18 May 2023 14:54:15 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7kOE0Y02Yr36dOEA92E/XPiamJpG/0jpQ1Qqmofx/A04kM08rdcO+ynaciYHKfnzcSKUOv X-Received: by 2002:a05:6a20:43a8:b0:105:5caa:b49c with SMTP id i40-20020a056a2043a800b001055caab49cmr1822305pzl.23.1684446853566; Thu, 18 May 2023 14:54:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684446853; cv=none; d=google.com; s=arc-20160816; b=zrhXQ/2HXukm2jsiRJdS8OwSvvk9p/ow5cO7+oZivsfM0e45u9SiGHc9HwytwMKFDL KHqqxGQ8qn3J3EvtGnFDMHmz4RVXGN9ISKXTT5XgfrV7bVIqmIvKO9DnQnBmeA8yZGDN thBCtKB1wRP7ra2T1KLoLgeLLm2ApyjdCdve6GSpge19/gdO2BZdhE0IR1WZ7/Qf7YfA tUubVwYVhbbBi+yjoyLkrpyBGtwIfLov2xzE4x/U+v9A+z9el7HhFpd/3Xl35AjOBTyl qIDhuuNIPIz+G2Dr5V+JM2V1qFkVVokFfhyriKpEyL9jmIT0l7GoO+bweGqgWhlsV4MP efvA== 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=dnpUiI2YcFbF6m0+etOXc9Mgx0qtFsgIBsnz3JLzYz8=; b=UHOyU7ewxUmH2/9AAF3JJF+dm2WYqQfDcwn118TNJ5KtOQgybE5V2RC3V9sjAgB7ji vxVYyDQ4Gt8ZPAyMrYADwjUgMbNIHrsog6Xw2cOrvCJCe1rvGq4uoJ5IU4Xh8QMpdTkj Bbx9iqC1X5y3HvekJbc1qVxOwidyPCOqiym4kwcOOappJlx43omKdqRkuvLXJDTtrwLb Sk2HnRqU+wc2EOIqrq0+v1csN3Dj3+KQMhspbX0Bb9zT3XIFxFHv94vGmIXhEsN++X+j G83TI/lQ0jJkZrCMLThPjcU5UeC0TpT0euZaMGtqTdr6AyaN9qaxkLxwNRPr0Tk4CvWA uSlw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=cROkLAXx; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x69-20020a638648000000b0053063a32dacsi2421024pgd.826.2023.05.18.14.54.01; Thu, 18 May 2023 14:54:13 -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=@kernel.org header.s=k20201202 header.b=cROkLAXx; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229851AbjERVmp (ORCPT + 99 others); Thu, 18 May 2023 17:42:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53022 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229533AbjERVmo (ORCPT ); Thu, 18 May 2023 17:42:44 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 760A0135; Thu, 18 May 2023 14:42:42 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id D71726160B; Thu, 18 May 2023 21:42:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 85CE6C433EF; Thu, 18 May 2023 21:42:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1684446160; bh=x5I5mruh7zMCo5Zhys6Y0M8OdmsdgmVH1YsnbP5N0G4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=cROkLAXx3D7DzisnvZXbe/RpC7p3ynWO5qtEVZnDCjlMCU8He9ikyvYowyWEEv26a K4cdYAfilcdu5lak2CudEIf54yvGchTRFiBmj3sRaqkaHy7mE0nRQeIeAJ567ONzyb 6oL0iffTiSk9AnFGDcKl1+krpJrPIm2Fq71IfTMujh5KJRk8rCuN4tC5l2YKucAWox ExGxWJLBmf3c6gcAPOQEA2rZ3tZxSRT5Pl7VJOzGVKFlw23cN+MgvVX6l7/+rY0HA/ 9mRGiCSxndOnL1qhHTBCcITaadDSpdoAZDDyuyJBk/clylgU/Mkma6LuabyZ8kaHSs Ci/0Wmk6nl9YA== Date: Thu, 18 May 2023 22:42:34 +0100 From: Conor Dooley To: Sean Anderson Cc: Conor Dooley , Anup Patel , Andrew Jones , palmer@dabbelt.com, Paul Walmsley , Rob Herring , Krzysztof Kozlowski , Alistair Francis , Anup Patel , Atish Patra , Jessica Clarke , Rick Chen , Leo , linux-riscv@lists.infradead.org, qemu-riscv@nongnu.org, u-boot@lists.denx.de, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v1] dt-bindings: riscv: deprecate riscv,isa Message-ID: <20230518-monkhood-dispersal-6749b1228b0d@spud> References: <20230518-thermos-sanitary-cf3fbc777ea1@wendy> <20230518-4050231ca8dbe93c08cf9c9a@orel> <20230518-hammock-doornail-478e8ea8e6a7@wendy> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="TYryGqRDcYWpb9dy" Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 --TYryGqRDcYWpb9dy Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, May 18, 2023 at 02:30:53PM -0400, Sean Anderson wrote: > On 5/18/23 10:06, Conor Dooley wrote: > > On Thu, May 18, 2023 at 07:13:15PM +0530, Anup Patel wrote: > >> On Thu, May 18, 2023 at 4:02=E2=80=AFPM Andrew Jones wrote: > >> > On Thu, May 18, 2023 at 09:58:30AM +0100, Conor Dooley wrote: > >=20 > >> > > - riscv,isa: > >> > > - description: > >> > > - Identifies the specific RISC-V instruction set architecture > >> > > - supported by the hart. These are documented in the RISC-V > >> > > - User-Level ISA document, available from > >> > > - https://riscv.org/specifications/ > >> > > - > >> > > - Due to revisions of the ISA specification, some deviations > >> > > - have arisen over time. > >> > > - Notably, riscv,isa was defined prior to the creation of the > >> > > - Zicsr and Zifencei extensions and thus "i" implies > >> > > - "zicsr_zifencei". > >> > > - > >> > > - While the isa strings in ISA specification are case > >> > > - insensitive, letters in the riscv,isa string must be all > >> > > - lowercase to simplify parsing. > >> > > - $ref: "/schemas/types.yaml#/definitions/string" > >> > > - pattern: ^rv(?:64|32)imaf?d?q?c?b?k?j?p?v?h?(?:[hsxz](?:[a-z]= )+)?(?:_[hsxz](?:[a-z])+)*$ > >> > > - > >> > > # RISC-V requires 'timebase-frequency' in /cpus, so disallow it= here > >> > > timebase-frequency: false > >> > > > >> > > @@ -133,8 +117,13 @@ properties: > >> > > DMIPS/MHz, relative to highest capacity-dmips-mhz > >> > > in the system. > >> > > > >> > > +oneOf: > >> > > + - required: > >> > > + - riscv,isa > >> > > >> > This is the part Anup keeps reminding me about. We can create better= ways > >> > to handle extensions in DT and ACPI, but we'll still need to parse I= SA > >> > strings to handle legacy DTs and holdouts that keep creating ISA str= ings, > >> > at least during the deprecation period, since ISA strings are still = "the > >> > way to do it" according to the spec. > >>=20 > >> Coming up with an alternate way in DT is fine but we can't deprecate > >> ISA strings since ISA strings are widely used: > >> 1) Various bootloaders > >=20 > > Aye, for the reason, as I mentioned earlier and in the RFC thread, > > removing existing parsers isn't a good idea. > >=20 > >> 2) It is part of /proc/cpuinfo > >=20 > > That is irrelevant. > >=20 > >> 3) Hypervisors use it to communicate HW features to Guest/VM. > >> Hypervisors can't get away from generating ISA strings because > >> Hypervisors don't know what is running inside Guest/VM. > >=20 > > Generate both :) As things stand, your guests could interpret what you > > communicate to them via riscv,isa differently! > >=20 > >> In the case of ACPI, it is a very different situation. Like Sunil ment= ioned, > >> ACPI will always follow mechanisms defined by RVI (such as ISA string). > >> Other ACPI approaches such as GUID for ISA extension are simply not > >> scalable and will take a lot more memory for ACPI tables compared to > >> ISA strings. > >=20 > > My proposal should actually suit ACPI, at least for Linux, as it would > > be a chance to align currently misaligned definitions. I won't speak to > > GUIDs or whatever as that's someone else's problem :) > >=20 > >> > Also, if we assume the wording in the spec does get shored up, then, > >> > unless I'm missing something, the list of advantages for this boolean > >> > proposal from your commit message would be > >>=20 > >> IMO, we should try our best to have the wordings changed in RVI spec. > >=20 > > Yes, doing so is beneficial for all of us regardless of what happens > > here. I do think that it is partially orthogonal - it allows us to not > > design an interface that needs to be capable of communicating a wide > > variety of versions, but I don't think it solves some of the issues > > that riscv,isa has. If I thought it did, I would not have gone to the > > trouble of respinning this patch out of the other approach. > >=20 > >> > * More character choices for name -- probably not a huge gain for ra= tified > >> > extensions, since the boolean properties will likely still use the= same > >> > name as the ISA string (riscv,isa-extension-). But, for vend= or > >> > extensions, this is indeed a major improvement, since vendor exten= sion > >> > boolean property names may need to be extended in unambiguous ways= to > >> > handle changes in the extension. > >> > > >> > * Simpler, more complete DT validation (but we still need a best eff= ort > >> > for legacy ISA strings) > >> > > >> > * Simpler DT parsing (but we still need the current parser for legac= y ISA > >> > strings) > >> > > >> > > + - required: > >> > > + - riscv,isa-base > >> > > + > >> > > required: > >> > > - - riscv,isa > >> > > - interrupt-controller > >> > > > >> > > additionalProperties: true > >> > > @@ -177,7 +166,13 @@ examples: > >> > > i-tlb-size =3D <32>; > >> > > mmu-type =3D "riscv,sv39"; > >> > > reg =3D <1>; > >> > > - riscv,isa =3D "rv64imafdc"; > >> > > + riscv,isa-base =3D "rv64i"; > >> > > + riscv,isa-extension-i; > >> > > + riscv,isa-extension-m; > >> > > + riscv,isa-extension-a; > >> > > + riscv,isa-extension-f; > >> > > + riscv,isa-extension-d; > >> > > + riscv,isa-extension-c; > >>=20 > >> One downside of this new approach is it will increase the size of DTB. > >> Imaging 50 such DT properties in 46 CPU DT nodes. > >=20 > > I should do a comparison between 50 extensions in riscv,isa and doing > > this 50 times and see what the sizes are. >=20 > Why not just have something like >=20 > mycpu { > ... > riscv,isa { > i; > m; > a; > zicsr; > ... > }; > }; Naming of the node aside (perhaps that could be riscv,isa-extensions) there's not something hitting me immediately as to why that is a no-no. If the size is a concern, this would certainly be more efficient & not like the probing would be anything other than trivial more difficult what I have in my proposal. Rob's AFK at the moment, and I was hoping that he would take a look at the idea, so I won't respin til he is back, but I'll give this a go in the interim. Cheers, Conor. --TYryGqRDcYWpb9dy Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRh246EGq/8RLhDjO14tDGHoIJi0gUCZGabyQAKCRB4tDGHoIJi 0tqeAQCpsTIUwavLKPVNiJd1cmmE4LJnnxMRlq2sxMTP8zSOpQD/arxRvhO4QzlJ 1itR13j6MTL60roBmM//fn7DprVxnwI= =YkDr -----END PGP SIGNATURE----- --TYryGqRDcYWpb9dy--