Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp16880909rwd; Mon, 26 Jun 2023 17:01:48 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7i6Bj/PTQ8h0OIBg6M0zlILp71eFNnu2cnDRx2TQQSsAJuAxKHdmNMWfWaQC0r62/Y8jmJ X-Received: by 2002:a05:6a00:2313:b0:67b:f249:35e3 with SMTP id h19-20020a056a00231300b0067bf24935e3mr1370758pfh.26.1687824107939; Mon, 26 Jun 2023 17:01:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687824107; cv=none; d=google.com; s=arc-20160816; b=kLoYPs0DKjQvwUX76jFpwk6zDHzPkFBteTg3KpmT0B9/6qwYj3UriF0rKS3Pblx+ji aZeFf646sIHuf+yL/s4x9B6SPypGVLx6Qg/q/UXxXkbHfF8YU7M1WCGJagaZFYq3veqm S7aHTZpJm1IAIy5wxBLpXnjuYijuZ/XnRMd3HOF/YvdIX1CjrrFCd7meImlzl7U4bAjR Ib+CUEGRdDfCx2k3oPODoDU1Uwt/EhrAuhvMg087hLN2/L0+d1JQGCIwJjLrUFffgaOP PiwH3+WhhmyVXyl2tI6KIzSfGP58rA2LVnPc+KLilA7zYLkxVfQnzRw2Uj0v0Igd/5qD cAfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=WsuDpkg4STj8VScLUF1v+q9KU/sRwZdf0lwfYtb4nAU=; fh=moXwOGm+4POVy8sxLK01C70Fv35M7qvIQoKLbyZfL+4=; b=Cp9Lv+v6Y1iBPI364QtDqd7SN/MCk1xOdS7dGred60pZH/+fmlznTxe76uhhc8MzFz phbspbjc3ZHeVv6r2bKY863EvXHp8QTW+nDNA0+RsiuPZIkprUx00CxfRqGycKQL6V7v X9FqU+xCZgKBEhc/pyhRFx4PpTAadapEOPb0Qlhreu3oYxqt+zgEBmb2+HMn5UQuXlrQ q7IeCQXRHvyLjfCE0MmRAsJV/q5rxntxUhXbCPXaJUSE/XBBGOf/FgdXwnHF0SY7fju7 Kbn08pb2hgXymLdEN9UOvgeBzhoMyWDlMwYefyHZO26Kw6DzUkWPlwLp0TiOv5IyOOT4 AIWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rivosinc-com.20221208.gappssmtp.com header.s=20221208 header.b=C1YJv7l5; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id fd22-20020a056a002e9600b00660b5630908si6167266pfb.269.2023.06.26.17.01.36; Mon, 26 Jun 2023 17:01:47 -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=@rivosinc-com.20221208.gappssmtp.com header.s=20221208 header.b=C1YJv7l5; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229737AbjFZXUj (ORCPT + 99 others); Mon, 26 Jun 2023 19:20:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58230 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229459AbjFZXUi (ORCPT ); Mon, 26 Jun 2023 19:20:38 -0400 Received: from mail-lf1-x130.google.com (mail-lf1-x130.google.com [IPv6:2a00:1450:4864:20::130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B8C58FB for ; Mon, 26 Jun 2023 16:20:36 -0700 (PDT) Received: by mail-lf1-x130.google.com with SMTP id 2adb3069b0e04-4fa16c6a85cso3510509e87.3 for ; Mon, 26 Jun 2023 16:20:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20221208.gappssmtp.com; s=20221208; t=1687821635; x=1690413635; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=WsuDpkg4STj8VScLUF1v+q9KU/sRwZdf0lwfYtb4nAU=; b=C1YJv7l5E3ROxSNyp2Ma6wOHfw4IZG4XuKs7uygKnjuEeNdgXPdVAbHlgIu26QN7+d f/E6Klo+Jt15f+XgaseGnZbh5P4e4AskGzdAJPBVkNsec1Edy2+5r0YfY3FUHNs4I3Fx 9hUvqUZYv6RZtVMZKo0YOyaUV7s+t5PwywAzl1+gfNqOyX4RVzhzuOExFRdEJyCryp7v DqFfxkYgVUzi4GcaPCfvmRH7HeGbxRarFUtHWbhupqIaPypod8XI3JzmwbkrApzMB3TJ dePdQY3aEed7GXqATYVhwFYTukwJoUt9sKREaaZr59XUMO0q4hJSRXALp4jE1X8Hbtg/ 1rug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687821635; x=1690413635; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=WsuDpkg4STj8VScLUF1v+q9KU/sRwZdf0lwfYtb4nAU=; b=CEusmrYnF04q1Hp8rLWu4rU5qSxXnFTwSSepjfGaWv8W6NIi8YN1C9rR8AKaxz7kz9 ZL/JKUf1JVVmGu4qYoQBDaza/uZ/hW+Cv1CQTdAoB0oCpPdWo63vCNIuJhW3zN6yrb64 m9w9iMbd2BdJo/u7bNWXyqTnaY52bIyPbpnJ6mAOe0dg5kQ7NNC8Eifeys2TRVhS0u+W 9cUfDCYm5M7WNMzZ8IfXbqfHqqUV77VAk2pvpY5AwWPNQTAkF32DAJL9uR4OWeRDpd7B tWUGZ6f3P9vFmVFwNxLtyR2YuLeQhEbt63Y/VAW3VZwzRbxOPTFp2qwHbHsv+UZYMVLB FqBg== X-Gm-Message-State: AC+VfDwSDgbKWJjtcWrMIGQGFG5WRxoIdA/T79O7D5Dy/3VSDfAiiZBA PFRv+bwAanJu4wpjBAAUoAeqWQUfmuy45fuEO+jEzA== X-Received: by 2002:a05:6512:12c7:b0:4f9:72a5:2b72 with SMTP id p7-20020a05651212c700b004f972a52b72mr7112983lfg.22.1687821634913; Mon, 26 Jun 2023 16:20:34 -0700 (PDT) MIME-Version: 1.0 References: <20230626-nature-seventh-6102e17bb4be@spud> In-Reply-To: From: Evan Green Date: Mon, 26 Jun 2023 16:19:58 -0700 Message-ID: Subject: Re: [PATCH] RISC-V: Show accurate per-hart isa in /proc/cpuinfo To: Palmer Dabbelt Cc: Conor Dooley , aou@eecs.berkeley.edu, ajones@ventanamicro.com, apatel@ventanamicro.com, Conor Dooley , heiko.stuebner@vrull.eu, Paul Walmsley , sunilvl@ventanamicro.com, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,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 On Mon, Jun 26, 2023 at 1:48=E2=80=AFPM Palmer Dabbelt = wrote: > > On Mon, 26 Jun 2023 13:34:24 PDT (-0700), Conor Dooley wrote: > > 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 wrote: > >> > On Fri, Jun 23, 2023 at 03:23:53PM -0700, Evan Green wrote: > >> > > In /proc/cpuinfo, most of the information we show for each process= or is > >> > > specific to that hart: marchid, mvendorid, mimpid, processor, hart= , > >> > > compatible, and the mmu size. But the ISA string gets filtered thr= ough a > >> > > lowest common denominator mask, so that if one CPU is missing an I= SA > >> > > extension, no CPUs will show it. > >> > > > >> > > Now that we track the ISA extensions for each hart, let's report I= SA > >> > > 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. Fair enough. > > 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. > > Maybe let's just add a pretty printed version of the hwprobe info to > /proc/cpuinfo, and then leave the ISA string alone as a legacy > interface? I like it! I'll aim for that for v2. I'll resist the urge to name the row isa_for_real. > > Having something so poorly defined as uABI is a bit embarassing, but > it's our mistake so we've got to live with it. > > >> 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.