Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp30966736rwd; Thu, 6 Jul 2023 13:29:37 -0700 (PDT) X-Google-Smtp-Source: APBJJlHSBuCa+9a+hciUm6A3IZon8+tKPskGf5Ei8gluVrFOZGxg53AatqF3EA4QoIzPcxwaoh2R X-Received: by 2002:a05:6a00:1a0b:b0:67e:5edd:e6e7 with SMTP id g11-20020a056a001a0b00b0067e5edde6e7mr2615811pfv.9.1688675376821; Thu, 06 Jul 2023 13:29:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688675376; cv=none; d=google.com; s=arc-20160816; b=jKC2eTomo+hMHsA/UW5KTNwW06W8mxM3zFUQv2SzBn3uymItX4Data97b4dlSnI2Ge LJlyAptOMeeeipB/kuNI4/94VMlF5pcvmRg6HLlZpIMZGZ5fJxwYyyT4cMamsFaZ/t5z Drfp1K2v/XAg3j/3nma2A2L40So32Ujv8RLJxGDL1iAWOobUtAVRLM4V4a4v1ZLUjKL7 oOAX0+7vVI7UUlVb4pod01cIYKfJh3pe9atENvQ8ZKozpGKb2Pd2JfNAKEzWbYhxKpql ZYUXZGuFj5Lep2g/Cd0AYXLBZHtTWcZTCStAPdiy9cSYhLvcVQnITgJxP5e+AFnk4wKH clCQ== 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=FrNhiTqDQItKHcCBe+k1gh83J9Zxaz0xFFK2k4JYDbk=; fh=noVgN9FBLd7pjcUXz3TdNfIF7s4uWxmGnzDzSAgq1NU=; b=yfTNJFTCnDnQZJb2cJ5pnOwLQZIl9gkA6nlcCFG6WF5/gdz/49qGxgooZ2EmHA4DBZ Eet2drUFUNEERo/etp+8k0TdpREpXaXMp1b982VOZjiTptXlC0rx+8Iyc6Lh4nb8KqHF mrGpJuM9vMTnxM4BogvuB+T2Qye68MwU7o/+CH9g1UuaCcHZzezz8nLn4U2s93uG40W+ fjN3hQzOpa1TkLxIe2sr5S2Xij6q3pQbhRf0tEqDeOQgX1MFnID68QvwDSOXKLhT8u1d 4bIdcqC5AJB8n8SuETr0Q6WMz8X3II9NQJs1sgjfgoSzsUFaDRZ3/7BwoxU3T+enNdMl cuPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@dabbelt-com.20221208.gappssmtp.com header.s=20221208 header.b=2G9krPYp; 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 d6-20020a056a0024c600b006826f351306si2283708pfv.222.2023.07.06.13.29.22; Thu, 06 Jul 2023 13:29:36 -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=2G9krPYp; 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 S231905AbjGFTpT (ORCPT + 99 others); Thu, 6 Jul 2023 15:45:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50878 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229527AbjGFTpR (ORCPT ); Thu, 6 Jul 2023 15:45:17 -0400 Received: from mail-pl1-x633.google.com (mail-pl1-x633.google.com [IPv6:2607:f8b0:4864:20::633]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6E1B11BF0 for ; Thu, 6 Jul 2023 12:45:16 -0700 (PDT) Received: by mail-pl1-x633.google.com with SMTP id d9443c01a7336-1b7fb1a82c4so6285295ad.1 for ; Thu, 06 Jul 2023 12:45:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dabbelt-com.20221208.gappssmtp.com; s=20221208; t=1688672716; x=1691264716; 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=FrNhiTqDQItKHcCBe+k1gh83J9Zxaz0xFFK2k4JYDbk=; b=2G9krPYp+J1M049iq9qKlWbi8hvMukNAJ3a0MDGLFJQNVU4DW/0O5Q5eoZtUw5vyWU TAlQnQUi5eYli+xFyLOXpDhmrjiGlt+J8wlZJfH+Mn75qLUu1IEgZ2T8FEZ6lPNTch4R fWpSyxvFCCJQKW/9GYkRWwcAXIDgG/NKunkK1iwVukBy1Lmxk2WpIzKrElawSv8FsASi 6nom6jfIcfZZLB5Wct6j/VgnSQmGvjKpCTbuJFxL/2XwPEUnvXh7wwGA1ly+O4CklJCp 6qSgQNH44kWwp6qLB5mQFx8trUltNAK01LDYljiGd+BcomL+NOcYYPYoCIStzzk/PZR8 FH8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688672716; x=1691264716; 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=FrNhiTqDQItKHcCBe+k1gh83J9Zxaz0xFFK2k4JYDbk=; b=FZ/jHPg14KHeemfURZbuDI9zrp5aIvnZMhfeD22QWnDqtRC3+EZDXYXOu0iFj7OUAG svYDvJ1xVl0Uo05hteYhehYkf1JhuosKgVl89cQmSkAn5rWv/fhue5+EnfDRRgQ5ZFzm EWn83QaIL7CQFCAai2hbfabEcj/XOLR1Yp+zzmv6koFAaVMPcuJ0b28Q/BUWbUYVI4hw qFhXRcEgySrCgx0DsYPfQUM+JBLjy4PHQibBSo6yUIZi7/WMIAuE58Br3wRgKfH2nQFI s1R/lrRpuOXvHACNAQMXzOlVSu9l4wGPadQC9r3uUPcMUM/aZ2vL55wSNPgdXp+rlmu2 jPOw== X-Gm-Message-State: ABy/qLbw4087QFyDj2fZnjO+jhVMjT8uAlhn66K6GTBDdndT3B1RCrtW 11XpTWXwh5iEH4h4ZGfsblMMow== X-Received: by 2002:a17:902:ecc2:b0:1b1:ae33:30de with SMTP id a2-20020a170902ecc200b001b1ae3330demr3234128plh.13.1688672715791; Thu, 06 Jul 2023 12:45:15 -0700 (PDT) Received: from localhost ([50.221.140.188]) by smtp.gmail.com with ESMTPSA id t4-20020a170902e84400b001b9be3b94d3sm180213plg.140.2023.07.06.12.45.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jul 2023 12:45:15 -0700 (PDT) Date: Thu, 06 Jul 2023 12:45:15 -0700 (PDT) X-Google-Original-Date: Thu, 06 Jul 2023 12:44:29 PDT (-0700) Subject: Re: [PATCH v2] RISC-V: Show accurate per-hart isa in /proc/cpuinfo In-Reply-To: CC: Conor Dooley , ajones@ventanamicro.com, aou@eecs.berkeley.edu, apatel@ventanamicro.com, heiko.stuebner@vrull.eu, Paul Walmsley , sunilvl@ventanamicro.com, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org From: Palmer Dabbelt To: Evan Green 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 Thu, 06 Jul 2023 12:34:30 PDT (-0700), Evan Green wrote: > On Thu, Jul 6, 2023 at 3:53 AM Conor Dooley wrote: >> >> On Thu, Jul 06, 2023 at 10:01:31AM +0200, Andrew Jones wrote: >> > On Wed, Jul 05, 2023 at 10:29:31AM -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. We cannot change >> > > the "isa:" line, as usermode may be relying on that line to show only >> > > the common set of extensions supported across all harts. Add a new "hart >> > > isa" line instead, which reports the true set of extensions for that >> > > hart. This matches what is returned in riscv_hwprobe() when querying a >> > > given hart. >> > > >> > > Signed-off-by: Evan Green >> > > >> > > --- >> > > >> > > Changes in v2: >> > > - Added new "hart isa" line rather than altering behavior of existing >> > > "isa" line (Conor, Palmer) >> > > >> > > >> > > I based this series on top of Conor's riscv-extensions-strings branch >> > > from July 3rd, since otherwise this change gets hopelessly entangled >> > > with that series. >> > > >> > > I was unsure if I could snuggle the new "hart isa" line in just below >> > > "isa". Aesthetically it would be quite pleasing, but it runs the risk of >> > > breaking brittle usermode parsers that are assuming a specific line >> > > order. So I put it at the end. >> > >> > Actually, they're probably only aesthetically pleasing when they match. If >> > there are differences, then I'd guess having them side by side, almost the >> > same, but different, would make them even harder to look at then they >> > already are. So I think I'll be happier with them separated by a few lines >> > anyway. >> >> This list is eventually going to be so big that I don't think doing >> by-eye anything is going to be useful, so aesthetics be damned. >> That said, a parser that relies on the order of individual lines like >> that might deserve to be broken ;) >> >> Anyway, change looks good to me: >> Reviewed-by: Conor Dooley >> >> I was thinking the uabi doc might need an update - should we add to it >> that "isa" means the common set & "hart isa"? > > I did do a little search for documentation to update, but failed to > come up with any. Which doc are you thinking of? Should be somewhere like Documentation/arch/riscv/uabi.rst