Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp31009511rwd; Thu, 6 Jul 2023 14:14:27 -0700 (PDT) X-Google-Smtp-Source: APBJJlGewXNjJu1y6oOM54vw+eJ7IxCdO+mjkgcbMaR2fNH1aGaagL7rzpbEsLW4Ig2yY2OwKdW9 X-Received: by 2002:a17:902:b18f:b0:1b8:9044:b8ae with SMTP id s15-20020a170902b18f00b001b89044b8aemr2454322plr.11.1688678067506; Thu, 06 Jul 2023 14:14:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688678067; cv=none; d=google.com; s=arc-20160816; b=yhsVlPYj+sLa+EdTdvmlZgvU4g55cWOHNpDd3zvhBsNOk+ox/7vPdPFPkaQcXa1QQe 8wpn2uP0bm4p57tipqhRuWHgAZqiWQQOCl58fxpbt5yjdCANAdh9KAIHXtp2riM9XQvC i8B+8iZ6YoFIHLi8Ea1thCqQ/pG9RpQpaYNEeVsGErKd5E5kM+C9lm1xTd4AhqF29s2k d2A+iIaYsIy1NFhRpAIUqy/3o4/Oi7OVxUwqFZGvWHv+oE0UVDVdSfUPTn83xAnhAhoY KOOuciHKL25OZ1Y1hmU1kiTNfyExaS4H9bAVkaK9VoX6Sug8HzQQW9e0DAHUJA3YaD+2 t1Pg== 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=exHyMG/2/1kKC28Ybg6ScTLzo0giggAORojrlxybewA=; fh=X4++zAVR9VLG5LtJrGTwuEwziqQfym/QVXdoZr98Wgk=; b=okAwD4zGDaxN7mqOEdOLxzU0J8eXEdND67zpzbsbxUwm6rUewKLsjyebhe2f6HeDI3 zY+SoxMfiNVtZAsgz0GDAOSkTf0SwUgPTMst7o7AWf3HbKdxrHG0rhqXIvEpCPEGzn6z C55ekBoe/VWg63xfr0fpv/zCLkzkBsL8brd7CYnwrjSNac45VYL6CYyX/ycr3AoOqLQ7 wg54CaywJIyZdCFizHQnV0vnNirlkMDIpb9zZUyCCgaF+RtleO6lFPNKUMaOnxsoihF1 OVKPTp3qFo6gc5HkmlGRCRNTFV9muoUCsRd/rcbR8ieuxipSllPuftlvU5CNe6eIOnCS 2EhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rivosinc-com.20221208.gappssmtp.com header.s=20221208 header.b=kF5Y63Mh; 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 e15-20020a17090301cf00b001b4fc117bf0si2325358plh.116.2023.07.06.14.14.14; Thu, 06 Jul 2023 14:14:27 -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=kF5Y63Mh; 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 S231263AbjGFVJX (ORCPT + 99 others); Thu, 6 Jul 2023 17:09:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46866 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229510AbjGFVJV (ORCPT ); Thu, 6 Jul 2023 17:09:21 -0400 Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com [IPv6:2a00:1450:4864:20::136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0A16819A7 for ; Thu, 6 Jul 2023 14:09:20 -0700 (PDT) Received: by mail-lf1-x136.google.com with SMTP id 2adb3069b0e04-4f122ff663eso1791474e87.2 for ; Thu, 06 Jul 2023 14:09:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20221208.gappssmtp.com; s=20221208; t=1688677758; x=1691269758; 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=exHyMG/2/1kKC28Ybg6ScTLzo0giggAORojrlxybewA=; b=kF5Y63MhmJB8mZlZ/HqjRfBnqgfCMscqtLojzJmHuuOf8gzukAij0qpog+kOgu+QJA lHxzm50w2ETmE3Lm46H4qT2fd4lCxfJD0+4UVumzI2eM1E7hbnnics2tgvT+POevYODJ yVb4XiIsHfd3gRzQWnVL3Tg23LmFl9c1i32Y1mrM6Qo93rK7Zm/b8+bt2463pBCTyQU5 AkWUGb2dG5rX0gJfZ4QhrzFJSRWFepBHBdheVGjn6Ty6FO+brd2gVVvD4M3WqS+LEoZ+ V9Md47ULyKa6AkCwW08Dv9+5fShysec7Vmb4Ffh1Z440jN8WDM9TN3lmYr2OYyXrpLGH jLYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688677758; x=1691269758; 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=exHyMG/2/1kKC28Ybg6ScTLzo0giggAORojrlxybewA=; b=Ox3ph4N0BNkZ89XD8wphi0bphdXMSd76X+KpfQeGkX5DmZyzVIMUgc+4qUwwfkZ21h SsjT5LowuxzSaeoTqCrrvoH+ZNLyXqGZC0xrjihqGUzfGLcbM+C8cm5Aj+regDUTD9pB a+roXY7ve34BWaXo7iUjBfGhP92enzS+KAgqCCpEmZcxAL9yeVvt6f65aBIouHq/9/q4 FwmOT7/XtEYaodtNLTa2aMQ0o/GBvm1h2mtHKKJCotOOTdQwxTGe4/XNNpHGu2EFnQA+ lvEofcLZCHuBd8GZZ6epwEOoX1do5Igdfx6dBYmkZfOjTFeNuGkH+lVUSJhpGYRV7yGZ Lg1g== X-Gm-Message-State: ABy/qLYwXtQLDGfAev08sZoUcbBZn/8EbV4EazGc0341kSe7mpC4GGyT 0taK/M5IW4IaKGNieb8RIzWnBh/i+GCpt19DWoHGcA== X-Received: by 2002:a19:790f:0:b0:4f9:b31b:db6 with SMTP id u15-20020a19790f000000b004f9b31b0db6mr2099061lfc.9.1688677758243; Thu, 06 Jul 2023 14:09:18 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Evan Green Date: Thu, 6 Jul 2023 14:08:42 -0700 Message-ID: Subject: Re: [PATCH v2] RISC-V: Show accurate per-hart isa in /proc/cpuinfo To: Palmer Dabbelt 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 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 Thu, Jul 6, 2023 at 12:45=E2=80=AFPM Palmer Dabbelt = wrote: > > On Thu, 06 Jul 2023 12:34:30 PDT (-0700), Evan Green wrote: > > On Thu, Jul 6, 2023 at 3:53=E2=80=AFAM 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 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. We cannot cha= nge > >> > > the "isa:" line, as usermode may be relying on that line to show o= nly > >> > > the common set of extensions supported across all harts. Add a new= "hart > >> > > isa" line instead, which reports the true set of extensions for th= at > >> > > hart. This matches what is returned in riscv_hwprobe() when queryi= ng a > >> > > given hart. > >> > > > >> > > Signed-off-by: Evan Green > >> > > > >> > > --- > >> > > > >> > > Changes in v2: > >> > > - Added new "hart isa" line rather than altering behavior of exis= ting > >> > > "isa" line (Conor, Palmer) > >> > > > >> > > > >> > > I based this series on top of Conor's riscv-extensions-strings bra= nch > >> > > from July 3rd, since otherwise this change gets hopelessly entangl= ed > >> > > with that series. > >> > > > >> > > I was unsure if I could snuggle the new "hart isa" line in just be= low > >> > > "isa". Aesthetically it would be quite pleasing, but it runs the r= isk of > >> > > breaking brittle usermode parsers that are assuming a specific lin= e > >> > > order. So I put it at the end. > >> > > >> > Actually, they're probably only aesthetically pleasing when they mat= ch. If > >> > there are differences, then I'd guess having them side by side, almo= st the > >> > same, but different, would make them even harder to look at then the= y > >> > 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 Thanks, I'll spin this patch and add something here. -Evan