Received: by 2002:ab2:3b09:0:b0:1ed:14ea:9113 with SMTP id b9csp69368lqc; Thu, 29 Feb 2024 10:30:42 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWIASYxE/0ij+uM6jqu95HJtZynS+5RV6iNjeeYCaIOWi2/SVBeTWhEWZHhizh3dz17qMZ7aKHF4kUiTxeI3AQ8WYCC+xCAbhWrgwbTRw== X-Google-Smtp-Source: AGHT+IHHJPCaOo2JDKv+8yq7xipZ1NSzXqq2M8p4LH+wY6UvIvDw0x+ENeNeRfX17ApLAkriXF5P X-Received: by 2002:a05:620a:4691:b0:787:5f7b:d97a with SMTP id bq17-20020a05620a469100b007875f7bd97amr3631697qkb.66.1709231442124; Thu, 29 Feb 2024 10:30:42 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709231442; cv=pass; d=google.com; s=arc-20160816; b=mdk0IO4jur/Lvogf2DlLcU0jpCX1w8OZyWmwbpRhMpdQjMUHmyt+TU16ghJrfzyoIa oQJZser4pR2EiyuHBTtAh8imzPNFSiDNqfsH9XDue8foQqGmM5F8eaLtHlrobLsiiDn7 1uvQkz9YAwwSZao/hSwl/2xv9MO+sehBdo4skFVALDTDUSjlD/O7Qhx/2YiNBINNlkV3 G5wz15bW7ow0+vOteI9fNe2GxvJnHWDvldI5Cz9mYDuNJtzBhyeIlQomnzKajD8ILP9H 59Au786mp2L7lutDoM4lLGxIO/vd+Mjv9scltXgpKizNSoh4EnEHFPFR2htUoMJyl/4P krQQ== 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=2HgWWLtX9NUghm/JjXanG4wu76srdSHYfyF5THzKR88=; fh=0wn4YMKJ8r8urf2YKAV1lewL/ZrMRh1O+5O1c3TBEJg=; b=OP9bIa0KS4ETISD4rsdrA2O7FAd1IkGKbM6DTKJGM9NHpmsAIS0HRFkwc12CTEoEPg FlxjOI6wtSYEXBXgCt4qhCMWY6NMcqi4hNPXLAYYQIdiKIVr0Gc+nslGa04yXtiTMPHa qW6QYtSEeSf1QseywWp56MHn3YTZLadgPfyieMNu0wInOTK6qmyBOrZrLJ1OLYuXWquB MBtAGOsX8sSPfWPHY9hTUl0Om03r9ZohBR8OAXWnjWLsm6DWiVQqSOpks3Nodu5krKMq +3copdayAjiwm6IKvz9RfR4PJQt4MuvNv/ZgvTc4ARpsFP4JlzVmpeh2YgtrTUzO5a0a KI/g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ni84BdSM; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-87295-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-87295-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id ye6-20020a05620a3b8600b0078768158e32si1850982qkn.476.2024.02.29.10.30.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 10:30:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-87295-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=@kernel.org header.s=k20201202 header.b=ni84BdSM; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-87295-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-87295-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 736C11C23124 for ; Thu, 29 Feb 2024 18:30:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D17BE78270; Thu, 29 Feb 2024 18:30:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ni84BdSM" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 046F1383BC; Thu, 29 Feb 2024 18:30:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709231415; cv=none; b=arkLhTQ8mrC3lWLsFENfMcIoYU5T7QdEMuKE/wzfosz4kEwMJ8ZWOktk5I9nGnuLT8hJ6MhpMjDTMbZInQQmj4beacZDBPjslUNgIwyttLbdd0lYmcIv0WlL+umTc78wotmQKPKFRWpY+R/DYzthDafXCZ1wddy8X6aL2xfzeas= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709231415; c=relaxed/simple; bh=2HgWWLtX9NUghm/JjXanG4wu76srdSHYfyF5THzKR88=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=X+91HoVhuwcySb2gQoqKzbG8uPF/i2H9TuVv4KsmulLd6WOnylfwjphte/MHkDh9bz1sXQeesZYZYa5SNo62MvEtxFSGimx7P+nZz2md9In/lBSPqphZwDlNB7GZLgo0MAmlWizuK2BhLlgi9tavKFJSXKr/uWBywMXCzs2Oldo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ni84BdSM; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id BC719C433F1; Thu, 29 Feb 2024 18:30:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1709231414; bh=2HgWWLtX9NUghm/JjXanG4wu76srdSHYfyF5THzKR88=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ni84BdSM7Em3xnOJzG6vi0AKZYqeNW7xAwZ5Us57psuqfBpI4UveM8rnKCRxxlS2h VlQ80j+REd4wrXfVuNNNLx22ew0i4roVR7r5j35knJUrf5ZtrE7rZiUlhL4zrXLn2e 3MAwsvG+s3myp+TYpk0LLThNRVxEgai4HsbzQ79ulyOYh6SEjn9pPgcqu1iJytUC0Q cKYwYNl1mMm49OHc0WiK3WHAGHwOkfvBGiI1RrL7op5eLtMRAn1dM4tXZnEQ4lC4We rNaCRRkY3kx0Ah14xmQgM228rVzhXRR3tx6cliaKsWsSoZqetYk9+l4CT/v44ALhlt TNFlaVoEQobdQ== Date: Thu, 29 Feb 2024 18:30:10 +0000 From: Conor Dooley To: Palmer Dabbelt Cc: samuel.holland@sifive.com, ajones@ventanamicro.com, linux-kernel@vger.kernel.org, alex@ghiti.fr, linux-riscv@lists.infradead.org, sorear@fastmail.com, stable@vger.kernel.org Subject: Re: [PATCH -fixes v4 2/3] riscv: Add a custom ISA extension for the [ms]envcfg CSR Message-ID: <20240229-establish-itinerary-5d08f6c3ee43@spud> References: <20240228-goldsmith-shrine-97fc4610e0bc@spud> 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="ch+3PeRyra/9QFRf" Content-Disposition: inline In-Reply-To: --ch+3PeRyra/9QFRf Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Feb 29, 2024 at 10:23:39AM -0800, Palmer Dabbelt wrote: > On Wed, 28 Feb 2024 02:12:14 PST (-0800), Conor Dooley wrote: > > On Tue, Feb 27, 2024 at 10:55:34PM -0800, Samuel Holland wrote: > > > The [ms]envcfg CSR was added in version 1.12 of the RISC-V privileged > > > ISA (aka S[ms]1p12). However, bits in this CSR are defined by several > > > other extensions which may be implemented separately from any particu= lar > > > version of the privileged ISA (for example, some unrelated errata may > > > prevent an implementation from claiming conformance with Ss1p12). As a > > > result, Linux cannot simply use the privileged ISA version to determi= ne > > > if the CSR is present. It must also check if any of these other > > > extensions are implemented. It also cannot probe the existence of the > > > CSR at runtime, because Linux does not require Sstrict, so (in the > > > absence of additional information) it cannot know if a CSR at that > > > address is [ms]envcfg or part of some non-conforming vendor extension. > > >=20 > > > Since there are several standard extensions that imply the existence = of > > > the [ms]envcfg CSR, it becomes unwieldy to check for all of them > > > wherever the CSR is accessed. Instead, define a custom Xlinuxenvcfg I= SA > > > extension bit that is implied by the other extensions and denotes that > > > the CSR exists as defined in the privileged ISA, containing at least = one > > > of the fields common between menvcfg and senvcfg. > >=20 > > > This extension does not need to be parsed from the devicetree or ISA > > > string because it can only be implemented as a subset of some other > > > standard extension. > >=20 > > NGL, every time I look at the superset stuff I question whether or not > > it is a good implementation, but it is nice to see that it at least > > makes the creation of quasi-extension flags like this straightforward. >=20 > We can always add it to the DT list as a proper extension, but I think for > this sort of stuff it's good enough for now Perhaps good enough forever. I was not advocating for adding it as a permitted DT property - I was just saying that I didn't the complexity that you mention below, but I was pleasantly surprised that the stuff ?Evan? and I came up with allows for this kind of inferred "extension" without any changes. > -- we've already got a bunch of > complexity for the proper ISA-defined extension dependencies, so it's not > like we could really get away from it entirely. --ch+3PeRyra/9QFRf Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRh246EGq/8RLhDjO14tDGHoIJi0gUCZeDNMgAKCRB4tDGHoIJi 0phyAPkBd+aPNH1/saAdNEh6ILJZUG6mCtcyhkUgdb1752vlrAD/RIO8+81FcJN+ 11exmk/RMWj7ZuE4xehnYEvsq43w5w4= =t2I+ -----END PGP SIGNATURE----- --ch+3PeRyra/9QFRf--