Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp16689080rwd; Mon, 26 Jun 2023 13:43:43 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6NwDZbYY/HJ4J8dDmNs55hpzdZGLqsgV1wVKQ4up3o9A/U2xGGl5GLsJKS41MrjMGGTnaB X-Received: by 2002:a17:907:7294:b0:988:c97b:8973 with SMTP id dt20-20020a170907729400b00988c97b8973mr18234419ejc.6.1687812222827; Mon, 26 Jun 2023 13:43:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687812222; cv=none; d=google.com; s=arc-20160816; b=KJgu+x8xjaWOWuiQ2WBjEfg6leu8rij9ZeRzTVGlKLbTXAU08/9MpGOCbhVQg+8y/Y +OcMf0KPnt2jVtoPeoXmD4xSskxDPUEci0YEPcJj4b5QwD3B8bDLURcBWR1fqlf+LlaP lM26WKn/3EZmgWZqvJZbJDxPYkRRRgvmovIOzaZYhNS+5tiVkVz+SkcUAZOpjRpLT8Py vijs+67ARA2kbeobsHQ/H1KZ5pj6GK/P77/AXmn9vu0iUDkuYUy+ttG7+DgcIAk/HinO pnlnHNEvp2dre/YveqeFYhd81lvpDu9IByI/b9+E+1/LMGJLmh8/A+066qEtEtjSoP1h QpLg== 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=ISmdUkrKULCJCFTkPXJstD36z/Ol6+a+XD6GmTrJ0hQ=; fh=vxyhpR6Y5azxhMomJUql6U8wroWrPWC3BM4MyC376aU=; b=1ATeXzRX4cwTvYcKQG/bxH8OQ98uNM0V4OPd7DIwQvC3PuxnRxKZoS4wn/w+rm2zhR q/y+hiSXO/lXf7AfdOV1sFxClJ0UMmYk3I4YA8E3fsTOod8+ZtS9H30cztF7SFG/yWG+ SneuScTwmQlVsaS32AiAm4uadul/WLkCORlOXFUjaX1MZsfM6seN+Iysw9c3eE0dvQU0 10TWlY5pI16tHiiBJRqm9cLS7X4JfFcJ//epT1DI6M8Di84tI2dqrub7MGECn4ml/eMT khRQR0Eff7YVpYgf2Xm6m3qXe1umIa3JazfW6iaJDv+t1vmNm5X1DvkP7GSLPShaKkrw 9E2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ZTomys7h; 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 l2-20020a1709066b8200b009896c34218dsi3080708ejr.62.2023.06.26.13.43.17; Mon, 26 Jun 2023 13:43:42 -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=ZTomys7h; 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 S230101AbjFZUee (ORCPT + 99 others); Mon, 26 Jun 2023 16:34:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39802 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229597AbjFZUed (ORCPT ); Mon, 26 Jun 2023 16:34:33 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 76BEA1A2 for ; Mon, 26 Jun 2023 13:34:30 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 1469B60F18 for ; Mon, 26 Jun 2023 20:34:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DE2E3C433C0; Mon, 26 Jun 2023 20:34:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687811669; bh=ISmdUkrKULCJCFTkPXJstD36z/Ol6+a+XD6GmTrJ0hQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ZTomys7hl8SzPESX2Q1yZS+c0t4HNU1KFDJJYOqv3uNFQkRi1XOBXeQQaJzMFjd48 05Adq+J66LpNyYfmTDdgzmE0o3OtP8UY1dCHn6qZ9shmFupGQWoPAJsnUEeXh4mdOR XB6IoAgZCf96uS4EhMtYFRMRIV3AXPAbMBS5/yoQvF3pxl64WnJFdqy175+E/VR2nh k3fFitMguY/l4+ZpL1cEIDQfN+NXMCF4zsHP5i4MSPqXSzh9Oh1oxqTM7xjohBJ0CK nFh0aTivx9kS14Pc2m8hJuUfZ2TkfShfnFxpfzAjSKrwivmH3Boa1ZXm9nVyDF2S0B yrA9xi0vYW2Kw== Date: Mon, 26 Jun 2023 21:34:24 +0100 From: Conor Dooley To: Evan Green Cc: Palmer Dabbelt , Albert Ou , Andrew Jones , Anup Patel , Conor Dooley , Heiko Stuebner , Palmer Dabbelt , Paul Walmsley , Sunil V L , linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org Subject: Re: [PATCH] RISC-V: Show accurate per-hart isa in /proc/cpuinfo Message-ID: <20230626-nature-seventh-6102e17bb4be@spud> References: <20230623222353.3742384-1-evan@rivosinc.com> <20230624-mortally-parking-68f6bc1dd5ee@spud> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="ThNQzj7TlCUVJnph" 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 --ThNQzj7TlCUVJnph Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jun 26, 2023 at 12:25:42PM -0700, Evan Green wrote: > On Fri, Jun 23, 2023 at 5:12=E2=80=AFPM Conor Dooley w= rote: > > On Fri, Jun 23, 2023 at 03:23:53PM -0700, Evan Green wrote: > > > In /proc/cpuinfo, most of the information we show for each processor = is > > > specific to that hart: marchid, mvendorid, mimpid, processor, hart, > > > compatible, and the mmu size. But the ISA string gets filtered throug= h a > > > lowest common denominator mask, so that if one CPU is missing an ISA > > > extension, no CPUs will show it. > > > > > > Now that we track the ISA extensions for each hart, let's report ISA > > > extension info accurately per-hart in /proc/cpuinfo. > > > > No, you can't do this as it breaks the assumptions of userspace that > > this shows the set supported across all harts. > > Sorry, but NAK. > My hope was that we were still early enough that no production systems > existed (yet) that actually had different ISA extensions in the set we > track, and therefore usermode would have been unable to make those > assumptions at this point. If such a system exists, and I don't know > if it does or not, then I agree it's too late to make a change like > this. You should put this information into your commit messages & not just hope that people understand your intent. Userspace does actually make these assumptions already, see for example this Google "cpu features" repo: https://github.com/google/cpu_features/tree/main To be quite honest, I really dislike the fragility of what they have implemented - with only one of the reasons being they made the mistake of assuming homogeneity. There's got to be a line somewhere for what constitutes buggy userspace and what's a regression. Up to Palmer I suppose as to what constitutes which. > I thought I'd put this out here and see if someone could point at such > a system; but if not it'd be great to keep /proc/cpuinfo accurate and > consistent with hwprobe (which does return accurate per-hart ISA > extension info). Just another nail in the coffin for a bad interface :) There are apparently some mixed c906 chips that support vector on one core and not the other - although it is thead vector which is not supported upstream yet... Other than that, SiFive stuff technically can be mixed - rv64imac & rv64imafdc on a bunch of the older stuff. I don't think anyone actually runs those sort of configurations on them though. --ThNQzj7TlCUVJnph Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRh246EGq/8RLhDjO14tDGHoIJi0gUCZJn2UAAKCRB4tDGHoIJi 0pskAP9yYAMoQpZtM2yirifXI40NwXG+IUQu+cgL6UmPh9EW2wD/Z827GT2WKF1f hGcH5gWmZgcxkEy40e2oUyNZf5rwnwM= =+W66 -----END PGP SIGNATURE----- --ThNQzj7TlCUVJnph--