Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp30924524rwd; Thu, 6 Jul 2023 12:46:06 -0700 (PDT) X-Google-Smtp-Source: APBJJlE2Ug/SiSkR9Kgc/pPzUVBlhypur3LRW0Hpb8aZw9utw/fRMlWEtQ+BAdIOeXHulCymGoSl X-Received: by 2002:a17:90b:510:b0:263:2335:5946 with SMTP id r16-20020a17090b051000b0026323355946mr2004048pjz.40.1688672765705; Thu, 06 Jul 2023 12:46:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688672765; cv=none; d=google.com; s=arc-20160816; b=H8ZKLKmuCtH8Jp6CFhLDJFKPgHUFpdRHdEQ5AcgUU8aMHumxwLdALqtoUOPg4qT/B3 R4cO3Wc7z/d03xiKnPCbFbq/RVxggd91HUt2QfF47DjzXyI7DDfLpMMT53Is6wqSN0ig m8eMnf3fNFzni1N1zS8RAlIXqIsZYWeK60nrdW0HFpMLl06YlIws9MOkyhvruoqxW9WK nDbDfaLR5NGEl1m2ZyM+NCjwQMDY0NDUvOIHjD1tymMpidg625UHZ2LrFX4Ct2ZN3EEc HLTCveY5FsClaUE9TyYmFNjzQcV1QE47yMSpBRACadNIBP6gJROh/XRy/ZIQGRxI0fOa JahQ== 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=QJb0tT5v6PFselQcra2E8iBWNOHEwGRQkGYRNRggtk0=; fh=agUV0xLRMMTNWpKrvcubsgg4Y9D+glxpb6JCVXDzoV8=; b=JtEXq1rbcSvHcuqUiFh6D5hT2DWXv1+a8stKKEzSjMjyMCHTDQuv+6+fQ0MJBiWTl9 6yB842VElGYXuF6y69eVGrKsIA+MLy859MTXDynmaHcDOgjrem1s3PUomtIy7AiiJVzK MU5NSf9UD+O/ojN8voNAk9d106UXa+yqzi9PjNekMVcktLWoS7/qIoJjEccs83Tem79m 5DREOJPBtMHk9BwcAnc7MrufQF3fN2dstNorgb36vqMJxiwm60b0Ef8pBk9dOcN8q7rs 5ULkDs/GFxu1OWrUcgNT9jMdt9k1V0hHiHcXOdiofT8zsjDuwkAxyb9Z1v6IV32Knb+Q CvJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rivosinc-com.20221208.gappssmtp.com header.s=20221208 header.b=PvGnYWJH; 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 q5-20020a17090a304500b00263baf744dfsi299540pjl.139.2023.07.06.12.45.49; Thu, 06 Jul 2023 12:46:05 -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=PvGnYWJH; 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 S231213AbjGFTfL (ORCPT + 99 others); Thu, 6 Jul 2023 15:35:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47936 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229538AbjGFTfJ (ORCPT ); Thu, 6 Jul 2023 15:35:09 -0400 Received: from mail-lf1-x12a.google.com (mail-lf1-x12a.google.com [IPv6:2a00:1450:4864:20::12a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 240791BD3 for ; Thu, 6 Jul 2023 12:35:08 -0700 (PDT) Received: by mail-lf1-x12a.google.com with SMTP id 2adb3069b0e04-4f4b2bc1565so1674457e87.2 for ; Thu, 06 Jul 2023 12:35:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20221208.gappssmtp.com; s=20221208; t=1688672106; x=1691264106; 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=QJb0tT5v6PFselQcra2E8iBWNOHEwGRQkGYRNRggtk0=; b=PvGnYWJHhj4WvRyhsNgheDIkauEwn6/iNIBYs/wbygmrSNi0xmT0h5/NLSevgYfprC DW0mNTVRMvvj+aPw7mC+AV4zhcsASi+hkaiDsXAZkzkf+Z+2UJJjwohlTScOhbMNSdME mr47Uqy8H6MINnTvdyCl1w3XhpdBSHENZSpKMwEadhFbfDM+zeGejDwi9iEJQCgaqLSN L4xbbHzz33ROw05NkWmTP+cdZ/QRsg/VQboOC805ZI+4tufbmUTbjrjvNKxX/X98Oj13 RvB5CkJPLsaedPxMqpdE24uZX94gEV+Sg0kRz7kcHMdWHj3kbh10IiC9Eb8gvImuJ1rV hKTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688672106; x=1691264106; 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=QJb0tT5v6PFselQcra2E8iBWNOHEwGRQkGYRNRggtk0=; b=Fopzyn2xjeNgAmo/pC7H4sX8XRFrtBsGwE0fR8mNJfEcEKaQ/nVzOsex0Vxvackhkw rSLlK5gP5KOS5KiCwBH44hviqxI3lQnnOhfe5irQYWV23lUYvjanKq8OzQMpn/tACI3u 3WybqCFgvZfQXUgkPTROAhSQAVlZASUM2vMGxpagxDsrpRf9D0v0PeIrqhKfoqOxrF5t H9pyjP3GN+S6ZLp7+fkf4ip60FzK1D5/Pa5KoeqEHQ1hsWudRLH+N7zjBj0+VETi9eId +DmSOpvc/oEQR3VaEdYqKNKJjZs5VdnTUJW0o76jre+sSAdcXQlu7l2ZPECsp6QpEp4d CYbQ== X-Gm-Message-State: ABy/qLagdZqV03T3WF3jJ79o49nJFrYk3NulPcSOQT2Wr5AYB2itJqca v6UeLvoHjsPMtvp4IxR9VbOpGiFSlDNHckV//r8LDA== X-Received: by 2002:a05:6512:1ca:b0:4f5:1418:e230 with SMTP id f10-20020a05651201ca00b004f51418e230mr2117287lfp.52.1688672106378; Thu, 06 Jul 2023 12:35:06 -0700 (PDT) MIME-Version: 1.0 References: <20230705172931.1099183-1-evan@rivosinc.com> <20230706-dbdee6eba0c4a16084587b10@orel> <20230706-murkiness-oven-444f25924546@wendy> In-Reply-To: <20230706-murkiness-oven-444f25924546@wendy> From: Evan Green Date: Thu, 6 Jul 2023 12:34:30 -0700 Message-ID: Subject: Re: [PATCH v2] RISC-V: Show accurate per-hart isa in /proc/cpuinfo To: Conor Dooley Cc: Andrew Jones , Palmer Dabbelt , Albert Ou , Anup Patel , Heiko Stuebner , Palmer Dabbelt , Paul Walmsley , Sunil V L , 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 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 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. 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 "h= art > > > 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 existin= g > > > "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 li= nes > > 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? -Evan