Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp16706215rwd; Mon, 26 Jun 2023 14:02:00 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6piU+21O+QzbUsG74HRWNqysoEdh3x5c0HufkFUVBWL7crNKwi6GpKVNQAfYU/9tn9PFy5 X-Received: by 2002:a17:903:32c9:b0:1b0:f8:9b2d with SMTP id i9-20020a17090332c900b001b000f89b2dmr10202014plr.29.1687813319908; Mon, 26 Jun 2023 14:01:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687813319; cv=none; d=google.com; s=arc-20160816; b=0kRxy4az7uPjYBvo1udJwfeSX2JGswDxp38VddpccLm/AOsfX999TUBORH1GgWhwnc 2DSefBQUl0S4QwDXYBdfj6uMajAwOtvLI5jBFZEe0TnTV+Pvw1fttPzBH7pcsfBx7LbO 7ER1jO2OOibKW2g80vv+HB+b1Yr50284bQS14fEMHC1X+K3/IYjnM/ECcQ4IBaYyjJD+ z524DG9ptw0xNDp/ulr6TM8sUI24zLV8NkBYPmhMH1/R0d16Mrh8vwze21U+Kma/on4s FgJFJfMmcOy6o4XdEkVCr5aC22psutX7IrJVl8E7W4bgSAzwYhGsuSG5nrg3jx8h/Y67 nAIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:to:from:cc:in-reply-to:subject:date:dkim-signature; bh=GUPTOszK2L9RCrE5SeliLMIYDzSq6csnmoch3YF2q0Y=; fh=73o7+8K+e9AFszhHK/PUf5piyyKksCZldoCMLKhHgA4=; b=ITgO7VoxjdbxlDGugjCtiEE0WZFEBq29bv5n15RdjJ8j/1z/BQ6zXey0KzncmE+mT+ eeOFlnWb4l+5ew6pK05lz/u0ftZ2Q4RwTRuYeM3Mw1cf9DFx6CVZbumj0zCAphq8ZVB2 QRpz79y/Wuga8lpM3QVMQ+UfiOBEv7ZcZ2qodU34iVpQRCaBCqazc5TAeEmJGh5V/j/x SKIDpneeFQoxyDal/CReO4mgbo5GMJo8+RLbRwJcZRhvl13svSebfOTHv+jq6qZrzrOl WWyRAXdnoSN26Xgx5xayMpcJSbOQX9C1mgxxJpZGN4az5dby35GZtI3jBVLP3ysBFKR1 O+VA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@dabbelt-com.20221208.gappssmtp.com header.s=20221208 header.b=kxQT1GBg; 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 v13-20020a170902ca8d00b001b80f356601si1214033pld.476.2023.06.26.14.01.46; Mon, 26 Jun 2023 14:01:59 -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=@dabbelt-com.20221208.gappssmtp.com header.s=20221208 header.b=kxQT1GBg; 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 S229910AbjFZUsZ (ORCPT + 99 others); Mon, 26 Jun 2023 16:48:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46922 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229657AbjFZUsY (ORCPT ); Mon, 26 Jun 2023 16:48:24 -0400 Received: from mail-pf1-x42e.google.com (mail-pf1-x42e.google.com [IPv6:2607:f8b0:4864:20::42e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C5AC9E for ; Mon, 26 Jun 2023 13:48:22 -0700 (PDT) Received: by mail-pf1-x42e.google.com with SMTP id d2e1a72fcca58-666e6541c98so3732828b3a.2 for ; Mon, 26 Jun 2023 13:48:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dabbelt-com.20221208.gappssmtp.com; s=20221208; t=1687812501; x=1690404501; h=content-transfer-encoding:mime-version:message-id:to:from:cc :in-reply-to:subject:date:from:to:cc:subject:date:message-id :reply-to; bh=GUPTOszK2L9RCrE5SeliLMIYDzSq6csnmoch3YF2q0Y=; b=kxQT1GBgAzYDw2egy8FFSNfu/DK7t7VCYNPVi1sUyLhtgkqmYuggpiomMVY30YwmQq pbt3hR0Z8puHg5J7WX/es6N5w6oRkSYMKfsDpHOO2p356yR+mCHidn/Q7CLWV2N0PJW3 KoNydOqe8SUO9O/Rc+/ODMyJQ1of2JtSthgQ5aYR+m5oRhiptsCpChy8+dMSoETzTx9D BMMid2V7FrXpC03se4vf4Vc2dmrendNw3kZOWzEZkRrQotq3yyJp+KgI4DG1zeX8EoLV chHlZYotu1h9onpDU52TvrbogPa+ryTG70YI+ED1R/mYObKExMq7XcPZlTwMcjUGto8q cjAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687812501; x=1690404501; h=content-transfer-encoding:mime-version:message-id:to:from:cc :in-reply-to:subject:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=GUPTOszK2L9RCrE5SeliLMIYDzSq6csnmoch3YF2q0Y=; b=OhH3K9BO9NtRIsdBgQmMvBcTjAYwsY6N3c9SjWLxy8Sue0v68ps7TSbPOAcE40aLmv IEtgAvBZl1PJ9r62d6mFIrXGjclSZ8Yf7O/TJQUhA0jn8O16ZdJDG0hbpQXfyiMvPwD1 2gMnGHoICBu2T7tD1p9oAvInsS2dJS5/Op3541zZsIS+osezpAl2h2H5YqCakUh3AMuF ZdahhvFvBWvmr3MRqr+MbhVpemODdteVh+LopxK3A6S0FOznWgrf3uN2EHjh4zLrFRah abEgC7CGDs0CXpxt4or/KNv7JndY9TYwBZyM9/PyX4XHA258djqXC/8cfDiPUnCUqtGu yXxw== X-Gm-Message-State: AC+VfDwK8M5oOwEAuesM6LdSOk9MCs+frDolbcBGY+nkCaXBYqGcesnS aZbpEe9l1xmee4wbRf4gaAOSLg== X-Received: by 2002:a05:6a20:7495:b0:11f:33da:56ec with SMTP id p21-20020a056a20749500b0011f33da56ecmr34404579pzd.27.1687812501350; Mon, 26 Jun 2023 13:48:21 -0700 (PDT) Received: from localhost ([135.180.227.0]) by smtp.gmail.com with ESMTPSA id u4-20020a634544000000b0052c9d1533b6sm4536193pgk.56.2023.06.26.13.48.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Jun 2023 13:48:20 -0700 (PDT) Date: Mon, 26 Jun 2023 13:48:20 -0700 (PDT) X-Google-Original-Date: Mon, 26 Jun 2023 13:48:19 PDT (-0700) Subject: Re: [PATCH] RISC-V: Show accurate per-hart isa in /proc/cpuinfo In-Reply-To: <20230626-nature-seventh-6102e17bb4be@spud> CC: Evan Green , 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 From: Palmer Dabbelt To: Conor Dooley Message-ID: Mime-Version: 1.0 (MHng) Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit 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, 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 PM 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 processor is >> > > specific to that hart: marchid, mvendorid, mimpid, processor, hart, >> > > compatible, and the mmu size. But the ISA string gets filtered through 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. 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? 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.