From patchwork Tue Nov 14 14:12:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= X-Patchwork-Id: 164941 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b909:0:b0:403:3b70:6f57 with SMTP id t9csp1890252vqg; Tue, 14 Nov 2023 06:15:12 -0800 (PST) X-Google-Smtp-Source: AGHT+IFQdjdn2K2FjCl4bCiM3+w3WOcZ4NSShvhC2jIpbZxJbKBMMJOnZM6PWsQN2QLAuz/k/Y4D X-Received: by 2002:a05:6a20:7295:b0:181:a5ff:2dfa with SMTP id o21-20020a056a20729500b00181a5ff2dfamr3333911pzk.5.1699971312055; Tue, 14 Nov 2023 06:15:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699971312; cv=none; d=google.com; s=arc-20160816; b=BLqNcbQy5BSsXs+JqCL4NB/LlzNrtSxjPmjxOq72eKH1AVE8QDgjNRMt2oFi9fCZGp z5jTU1OJFEjYaN7ctJsQP6h4og1mwoX0fkXO6JZWS4Erbepzsc3TvAb077vhTxdcS+aO T/xC26SXunGqLOZp+Stjd2GVyPb0qeMvduxI8uNuJwWiGQPa/hx2ftTZfyFUiZHBea9M k+8hpusxaQg5sQyLxg8uFIkLSzoxFQmQWLmpfYupL+0rxDBaG7t/ZpHIt7w7Uy5yl8IT ip5G++rKp5e5NI1MhjcqCMpZ2fNfdexCdeHCQBLOxqrzlA+R7nZlVmA3spuwDqXExH3z pJqQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=8oJqbvRhcnLQ4NxthWPQmg85qomzW1aIjvQdZvqQ+P8=; fh=fL+bVAQlkNPxUacOFaQ2MOsckJp5zEG7p4hgbp/lFuw=; b=y2qgEieNLKa7zicJs6pO6MuyQ03jVDp0PDZ0J76IUl9P4C+D77JijajXJQr6CsYuGF CkLBE7yv+fn4hjDVWVFy7z/1UrwVhiRxJ3Ae2dfdWF1C9CDIvOZOf8UkGUSFbu3vGo4V BhXjqkgHjYWRhMhn5STSeZFjlRZMVqG33AiXWJs6w9Ks8O5xzgIgJP7umw/4OdlZUpdU tdaZjIPH6z39gb3CM8xUfJx2wNEjgf756U3CPLkgqZx0ESnTFIgcRD8vFQ/DDbzZdjvx LhmhG+nRIFHeVWvmCk29x8r53WT6sFcq29L1Xlj1xFy2HQ332ty/XlkM1HY4N8ZEUmuo Qvtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=dnx4y6VF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id ca8-20020a056a02068800b005b93064798bsi8332816pgb.191.2023.11.14.06.15.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Nov 2023 06:15:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=dnx4y6VF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (Postfix) with ESMTP id 478798104518; Tue, 14 Nov 2023 06:15:10 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233625AbjKNOPC (ORCPT + 29 others); Tue, 14 Nov 2023 09:15:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37816 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233526AbjKNOOZ (ORCPT ); Tue, 14 Nov 2023 09:14:25 -0500 Received: from mail-qk1-x730.google.com (mail-qk1-x730.google.com [IPv6:2607:f8b0:4864:20::730]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4D8971BEF for ; Tue, 14 Nov 2023 06:13:58 -0800 (PST) Received: by mail-qk1-x730.google.com with SMTP id af79cd13be357-77773d3246aso14497385a.1 for ; Tue, 14 Nov 2023 06:13:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1699971237; x=1700576037; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=8oJqbvRhcnLQ4NxthWPQmg85qomzW1aIjvQdZvqQ+P8=; b=dnx4y6VFVZXXxHxrPOZEMg+iwKsctF0YCegxpcgZ/bb45IGDJdKj4Y8+McR3vD6lI5 y2T4cb1YbVszVikjWD42lwmNcxbHGVd6w9MD/TqmJvjdWRPwfGpWRniaRgFPXgXtpw0r CekBGC17nhNv8+evmB3Ke3NNJSyC2p1l7UO/tchmEyHmU1LTpo+GTvH2cKwnGsfW6N9I WK50pJpK80jGRpPiSQHMsNACQxFI5dgz76zrgd9AcA1AurxepWt6XLTl376nS4yju3Ti RWrDD7Ng5Y4Le361FOJ7lj3e0zdTnfSIfP8ilouMgdtmsUEvINxXqo6mDB+1iorQy/0F +szg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699971237; x=1700576037; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8oJqbvRhcnLQ4NxthWPQmg85qomzW1aIjvQdZvqQ+P8=; b=rFXqiNyGcZM+bZiqZWO/U8EIWMhrYwi1x+avh6BgCEFNNyvrwFgKO7UK7dP2B29Gr2 WYJA/ylBLjZwmHlDvxmSOGbwPjbsaEAgLsXeWRqDjLj2ZOdJbSwLz3J4f+d8qsvObzMZ xgbSHFcQv9js6iUG+vVSXfZIvWpN82zIMnKbbaTogNcXVZga6f9TpvGkc+ZIlzuWxN22 RT3NsAVSEA//lwjUQM+xQIRcK2OxA/wUqeAmatkCZ2nveT6CDIwgJQTaVvRJFLf5fNay XyCdG13DmgaJZKw6kD1WWMq8dLsvH+RNT8GBlzQfwCRuJ+GgTaBjr4dZ98SBUeK/fBT0 S95g== X-Gm-Message-State: AOJu0Yy7EokWv/Al6/kvCj2XZYXxqWu9h0opFxVrstTYmhuuVGyIQnlv WxvCO3CIkJ25ooHG4YkYBp7ing== X-Received: by 2002:a05:620a:28d4:b0:773:a789:cd15 with SMTP id l20-20020a05620a28d400b00773a789cd15mr2090356qkp.6.1699971236775; Tue, 14 Nov 2023 06:13:56 -0800 (PST) Received: from carbon-x1.. ([12.186.190.2]) by smtp.gmail.com with ESMTPSA id m2-20020a05620a220200b00777611164c5sm2701263qkh.106.2023.11.14.06.13.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Nov 2023 06:13:56 -0800 (PST) From: =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= 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?= , Palmer Dabbelt , Paul Walmsley , Rob Herring , Krzysztof Kozlowski , Albert Ou , Jonathan Corbet , Andrew Jones , Evan Green , Conor Dooley , Samuel Ortiz , Jerry Shih Subject: [PATCH v4 19/20] riscv: hwprobe: export Zfa ISA extension Date: Tue, 14 Nov 2023 09:12:55 -0500 Message-ID: <20231114141256.126749-20-cleger@rivosinc.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231114141256.126749-1-cleger@rivosinc.com> References: <20231114141256.126749-1-cleger@rivosinc.com> MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_BLOCKED,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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Tue, 14 Nov 2023 06:15:10 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782549118514833848 X-GMAIL-MSGID: 1782549118514833848 Export Zfa ISA extension[1] through hwprobe. Link: https://drive.google.com/file/d/1VT6QIggpb59-8QRV266dEE4T8FZTxGq4/view [1] Signed-off-by: Clément Léger Reviewed-by: Evan Green --- Documentation/arch/riscv/hwprobe.rst | 4 ++++ arch/riscv/include/uapi/asm/hwprobe.h | 1 + arch/riscv/kernel/sys_riscv.c | 1 + 3 files changed, 6 insertions(+) diff --git a/Documentation/arch/riscv/hwprobe.rst b/Documentation/arch/riscv/hwprobe.rst index 896ecfbbe5f4..41463b932268 100644 --- a/Documentation/arch/riscv/hwprobe.rst +++ b/Documentation/arch/riscv/hwprobe.rst @@ -157,6 +157,10 @@ The following keys are defined: defined in the RISC-V Vector manual starting from commit e2ccd0548d6c ("Remove draft warnings from Zvfh[min]"). + * :c:macro:`RISCV_HWPROBE_EXT_ZFA`: The Zfa extension is supported as + defined in the RISC-V ISA manual starting from commit 056b6ff467c7 + ("Zfa is ratified"). + * :c:macro:`RISCV_HWPROBE_KEY_CPUPERF_0`: A bitmask that contains performance information about the selected set of processors. diff --git a/arch/riscv/include/uapi/asm/hwprobe.h b/arch/riscv/include/uapi/asm/hwprobe.h index fffc69d9f6ba..91fbe1a7f2e2 100644 --- a/arch/riscv/include/uapi/asm/hwprobe.h +++ b/arch/riscv/include/uapi/asm/hwprobe.h @@ -55,6 +55,7 @@ struct riscv_hwprobe { #define RISCV_HWPROBE_EXT_ZIHINTNTL (1 << 29) #define RISCV_HWPROBE_EXT_ZVFH (1 << 30) #define RISCV_HWPROBE_EXT_ZVFHMIN (1 << 31) +#define RISCV_HWPROBE_EXT_ZFA (1ULL << 32) #define RISCV_HWPROBE_KEY_CPUPERF_0 5 #define RISCV_HWPROBE_MISALIGNED_UNKNOWN (0 << 0) #define RISCV_HWPROBE_MISALIGNED_EMULATED (1 << 0) diff --git a/arch/riscv/kernel/sys_riscv.c b/arch/riscv/kernel/sys_riscv.c index e90537593f5f..f0bd7b480b7f 100644 --- a/arch/riscv/kernel/sys_riscv.c +++ b/arch/riscv/kernel/sys_riscv.c @@ -193,6 +193,7 @@ static void hwprobe_isa_ext0(struct riscv_hwprobe *pair, if (has_fpu()) { EXT_KEY(ZFH); EXT_KEY(ZFHMIN); + EXT_KEY(ZFA); } #undef EXT_KEY }