Message ID | 20231017131456.2053396-1-cleger@rivosinc.com |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp4126362vqb; Tue, 17 Oct 2023 06:16:00 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG0vzfsBA80ayru5ZDtqRtt5hC+ws81HybxfXZ1nchtH0Gg88idXDB+DKECU8rIfwHn/HZ9 X-Received: by 2002:a17:90b:4b44:b0:27d:1593:2b08 with SMTP id mi4-20020a17090b4b4400b0027d15932b08mr2361267pjb.0.1697548559733; Tue, 17 Oct 2023 06:15:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697548559; cv=none; d=google.com; s=arc-20160816; b=T3IopmU1AOcS1fDFr6pQgoMtd+F68KUYEViQmFJYZc5yYT5L+aXWC9koFzkoL19w9y dNWY7/eFQoo00SC3Cq6TzPj51/oQQgKE2HD6O+1XkZ7iJPBrDW2yzMLTLzrtL2TF7SgU tFaGQVHRBHgdhHD8YGV0AFlVefSrNflET+c5kHp/Y9QxijT876H6SflzLrS0qjnozI07 I+rFSwzcjQHGwlU+pJ5gGy+nPl/usogUHq0cxunzg7XN8HoS1ATjn9GFo+5cOi0TsE2l C5jfOsyBGw/FqBopZRB8ySi+qjugbh7HkTKuudYHP8STEOwIrjWt2UGxiNbfjiS9a4Jy jEuA== 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:date:subject:cc:to:from:dkim-signature; bh=JJAHN6fXys4+chbQTYaGErBWbio2Bi7IHGHKbLKG294=; fh=lvGFqwUxN+Dx1jonz8cRGrvjuKDcjMXylffmtrJGOYA=; b=juTNzHPXzm1IlVQX12hY253pc5LLTid6HblDY6Ut9Dvy8RlsYDL8PXu7aIYtIC15HU 90x52Pw8UcepU7xS2m3mH2vTtReK7lX3OAuzTn0bogJ05Dn4baqKr/kNoJR+ymLcOmP9 YWs2dUl68hqqcIXrbf/4T7FSd0/6CO3kKbJV14a6xtQRJiCvY0j1lnBKV0Dd/NwSt4Zl qUh98bj4K6EcB9gklEWsw8Mt8WMZozAhzPaJomPtaOzwFBYhhCtxRcWNPRIC0s5TjOMc SjZZbdw/pCQ+WcO2T0BUTJX9CvwZpRFpu3GQU9WDsGZeftxUCeYVblaAS6ftVqY4f5Gg k0vw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=fm2c5JYn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id n126-20020a632784000000b005aaf29151acsi1766574pgn.834.2023.10.17.06.15.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Oct 2023 06:15:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=fm2c5JYn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 483B780CC23D; Tue, 17 Oct 2023 06:15:46 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343536AbjJQNPc (ORCPT <rfc822;hjfbswb@gmail.com> + 19 others); Tue, 17 Oct 2023 09:15:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57696 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232984AbjJQNPa (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 17 Oct 2023 09:15:30 -0400 Received: from mail-lj1-x231.google.com (mail-lj1-x231.google.com [IPv6:2a00:1450:4864:20::231]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 62498EA for <linux-kernel@vger.kernel.org>; Tue, 17 Oct 2023 06:15:28 -0700 (PDT) Received: by mail-lj1-x231.google.com with SMTP id 38308e7fff4ca-2c504a51a18so12429751fa.1 for <linux-kernel@vger.kernel.org>; Tue, 17 Oct 2023 06:15:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1697548526; x=1698153326; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=JJAHN6fXys4+chbQTYaGErBWbio2Bi7IHGHKbLKG294=; b=fm2c5JYnDCSmEuaYK5enFPY3pn1ldB925uWsz71o4NkS+v2r4sjhk4IbHAogdSsBY6 RwyZdluZ4lHzhuEvBztdZ5noKdOeyPotirA1FRG62YC/DTDlE9QxaX/hqrHIUM8LZl8o RmvSzbC4Z7MFx/j0t46gHe2ZSFhQDWLpS2eRpuhdknez8969ueAJkgLDf9HGj0RM0ckd prFerHVVPY0wQRJh91PbDWGazOWQpXJEdP0htjR0v5aaaKg5nVal55WebVr7TsjJYpyg YwfrSkoX8aGpIOvHo9SXtPsmiskdNm4hGzlyYuVxgkObAy/EzsiooOikcY4Pnqmyxaxg OnOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697548526; x=1698153326; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=JJAHN6fXys4+chbQTYaGErBWbio2Bi7IHGHKbLKG294=; b=pq771grH+M27CeDTHUBXojeT2L7eV/jJBHuysxZoYDSIT7kFsu0yIct7aRvW0sfk5k +0KJwjPll5/L5Yaj++N0eaiRXwweqvMvL/hP0pmLxk6swvaDPuxOMbcDhPEtcEL3wYA4 nczIjP/r8pFk0Hz8L05YxJ/Kio/ceUhababTuj+PuqKjSaznOCyqFlF+lsGnsTUX5wFU TrR15D5Nb3P7t/egU9VPYz6bwhpRNFvHpn4HA0GQNiLD1bGpjCYlyDUNL7kSd72g7JEb ONX7iIspglERz8M0ek+tloOfeqDYBVli/oeG9mTYLRLQTUrO6/OV8LxJgDkYfHGaETiB drsg== X-Gm-Message-State: AOJu0YwB0+lbvpwfnNMzn+81W0hXOIUh2qsJc3uivCxGCPU8s0JJ1h/s m4C/TLHleMAH/BktX6ggIjXgqw== X-Received: by 2002:a05:651c:119b:b0:2c5:36e:31ef with SMTP id w27-20020a05651c119b00b002c5036e31efmr1527955ljo.5.1697548526439; Tue, 17 Oct 2023 06:15:26 -0700 (PDT) Received: from carbon-x1.. ([2a01:e0a:999:a3a0:96:820c:ecf7:a817]) by smtp.gmail.com with ESMTPSA id fj7-20020a05600c0c8700b0040772138bb7sm9873393wmb.2.2023.10.17.06.15.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Oct 2023 06:15:25 -0700 (PDT) From: =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= <cleger@rivosinc.com> To: linux-riscv@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org Cc: =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= <cleger@rivosinc.com>, Palmer Dabbelt <palmer@rivosinc.com>, Paul Walmsley <paul.walmsley@sifive.com>, Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Albert Ou <aou@eecs.berkeley.edu>, Jonathan Corbet <corbet@lwn.net>, Andrew Jones <ajones@ventanamicro.com>, Evan Green <evan@rivosinc.com>, Conor Dooley <conor@kernel.org>, Samuel Ortiz <sameo@rivosinc.com> Subject: [PATCH v2 00/19] riscv: report more ISA extensions through hwprobe Date: Tue, 17 Oct 2023 15:14:37 +0200 Message-ID: <20231017131456.2053396-1-cleger@rivosinc.com> X-Mailer: git-send-email 2.42.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Tue, 17 Oct 2023 06:15:46 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780008678581411177 X-GMAIL-MSGID: 1780008678581411177 |
Series |
riscv: report more ISA extensions through hwprobe
|
|
Message
Clément Léger
Oct. 17, 2023, 1:14 p.m. UTC
In order to be able to gather more information about the supported ISA extensions from userspace using the hwprobe syscall, add more ISA extensions report. This series adds the following ISA extensions parsing support: - Zfh[min] - Zvfh[min] - Zihintntl - Zbc - Zvbb - Zvbc - Zvkb - Zvkg - Zvkned - Zvknh[ab] - Zvksed - Zvksh - Zvkn - Zvknc - Zvkng - Zvks - Zvksc - Zvksg - Zvkt - Zfa - Zbkb - Zbkc - Zbkx - Zknd - Zkne - Zknh - Zkr - Zksed - Zksh - Zkt Some of these extensions are actually shorthands for other "sub" extensions. This series includes a patch from Conor/Evan that adds a way to specify such "bundled" extensions. When exposing these bundled extensions to userspace through hwprobe, only the "sub" extensions are exposed. In order to test it, one can use qemu and the small hwprobe utility provided[1]. Run qemu by specifying additional ISA extensions, for instance: $ qemu-system-riscv64 -cpu rv64,v=true,zk=true,zvksh=true,zvkned=true <whatever options you want> Then, run hwprobe_dump: $ ./hwprobe_dump Base system ISA: - IMA_FD - C - V Supported extensions: - Zba - Zbb - Zbs - Zbc - Zbkb - Zbkc - Zbkx - Zknd - Zkne - Zknh - Zkt - Zvkned - Zvksh - Zihintntl - Zfa Link: https://github.com/clementleger/hwprobe_dump [1] --- Changes in V2: - Fix typo in first commit title (fatorize->factorize) - Add Zfa support - Fix missing uppercase for Zvkt naming in dt-bindings - Add Conor Acked-by on dt-bindings commits - Add scalar crypto support from Conor/Evan. - Use reporting of bunbled extensions for vector crypto Clément Léger (18): riscv: hwprobe: factorize hwprobe ISA extension reporting riscv: hwprobe: add support for scalar crypto ISA extensions dt-bindings: riscv: add scalar crypto ISA extensions description riscv: add ISA extension parsing for vector crypto extensions riscv: hwprobe: export vector crypto ISA extensions dt-bindings: riscv: add vector crypto ISA extensions description riscv: add ISA extension parsing for Zfh/Zfhmin riscv: hwprobe: export Zfh/Zfhmin ISA extensions dt-bindings: riscv: add Zfh[min] ISA extensions description riscv: add ISA extension parsing for Zihintntl riscv: hwprobe: export Zhintntl ISA extension dt-bindings: riscv: add Zihintntl ISA extension description riscv: add ISA extension parsing for Zvfh[min] riscv: hwprobe: export Zvfh[min] ISA extensions dt-bindings: riscv: add Zvfh[min] ISA extension description riscv: add ISA extension parsing for Zfa riscv: hwprobe: export Zfa ISA extension dt-bindings: riscv: add Zfa ISA extension description Evan Green (1): riscv: add ISA extension parsing for scalar crypto .../devicetree/bindings/riscv/extensions.yaml | 210 ++++++++++++++++++ Documentation/riscv/hwprobe.rst | 81 +++++++ arch/riscv/include/asm/hwcap.h | 33 ++- arch/riscv/include/uapi/asm/hwprobe.h | 26 +++ arch/riscv/kernel/cpufeature.c | 165 ++++++++++++-- arch/riscv/kernel/sys_riscv.c | 64 ++++-- 6 files changed, 543 insertions(+), 36 deletions(-)