From patchwork Tue Oct 17 13:14: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: 13425154 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4E139CDB474 for ; Tue, 17 Oct 2023 13:16:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=TqpvDLAOB2PS4AKzl8Q/yYsUtS3dNQTTf4LeMfP5s0w=; b=rdJrA/m/+SgMPt HrXE5rogJ1um74r577r9UnCUONaAqXggm7op/MlbmOPrAlJRPA5qmuwigmkrhlApnOmzkIMJCFcpS GdmpLz9RH5R2e6Dcqjt6ByQdcRfSj1eLtK6YTQDltdqrB0QK8j+TGxEQ4BCIcRfVNmBkzFZ5wOOtN MrvAOcNdjR0I6kpBpJXKeNXH4eGM87ZMKX17y5iDY+KWldlLZ0IfLKOxPG5GA9kFsZkfHAKQKH/y/ VEyUtqso4ENKRF75aWxTO7AThsp6A7a5LW9Wz4V9vIZuYnfiafEZO5IJTbzM9FQ+XwZaCd3rmQOS9 X3Fu/+ZNR/SMJMLpGcUg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qsjvZ-00CNfk-2s; Tue, 17 Oct 2023 13:16:05 +0000 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qsjvH-00CNEh-1S for linux-riscv@lists.infradead.org; Tue, 17 Oct 2023 13:15:50 +0000 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-406532c49dcso17776895e9.0 for ; Tue, 17 Oct 2023 06:15:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1697548545; x=1698153345; darn=lists.infradead.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=C4LU7gzy3Hbb258ih1CCCOKNMQ4iLpkNhcu+Kc5tvws=; b=1iVPB6qmgwaMn9vPltna+jAt3LCAFIxqQJxJi3dWJs30ZDbKKq5/nu+2XLJ+4c773h PzXXEgvBg+jzRcZ8LJo4CBnRne3WH0kPM09anGkCxA5HiSkcsmuCkffjJbmTtR4N9TQY v4pOSE6xgEvpXHqt1oYxKPYKw6VykPR4yhiBmaz7NLxsSjFGk5HE8YYpObkziNTfgMSd WWndb11IHCdxYe4RcGKeOarkC0ard33E0wMvLwiNndRqAQPQL6WcR+AZe2n66AuFzOih pvqd+wJC2cOgpuENlWzwqLXDIlBKaaJT92Yf9cH6EJqVfPKlpFwxupW/O0+Q9WjhHBrk +3JQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697548545; x=1698153345; 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=C4LU7gzy3Hbb258ih1CCCOKNMQ4iLpkNhcu+Kc5tvws=; b=OHVLOmtet++12AxKGkNtuQeSLSb7BTzY0mP4giNL/ryIxAcx5WwWktJTzHjLdMiAPR hPFiDklTSt7O+VgkRjt++u0xfkwlPuwa1arOtGGatVFUq2jMUmmP58XNirwdWQ8yB7c/ 1lP1hRyE0xRN1XCVzFL4vxc72Bk/WDGgkSe2R0EX/sNvDoqULUKtR4fjywa8RSx/F2U1 JOmenn1nxkiuMfjYjfQXwwxH7u9/NxbsLUUct9Qda+bH7EylyR/F+DXhc0kAHz7G1PNW tOFyVBIK0qG3vvAhonhi0NRSt3Y0oBWiiAJv3pm89r9XlBjcSH2SEci3XXtZMDSRJzTF qhyw== X-Gm-Message-State: AOJu0YwBYdIlfg9hkDcq6kBpK9wmMTvaEjc1J+uFYieT3WUPEvGVXWkm /sv4IH57ZeDDBV+c6ThEmP54Ya5s0pHjn1mQE+G56w== X-Google-Smtp-Source: AGHT+IHnpuaE2cK/zZiBwTN9WlDKtqZo7vhcXCnW27rCQU+XEM9WRrUe1J4q6WIg4FdM21J+kwJUfg== X-Received: by 2002:a05:600c:891:b0:405:4280:341d with SMTP id l17-20020a05600c089100b004054280341dmr1640946wmp.4.1697548544833; Tue, 17 Oct 2023 06:15:44 -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.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Oct 2023 06:15:44 -0700 (PDT) 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 Subject: [PATCH v2 18/19] riscv: hwprobe: export Zfa ISA extension Date: Tue, 17 Oct 2023 15:14:55 +0200 Message-ID: <20231017131456.2053396-19-cleger@rivosinc.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231017131456.2053396-1-cleger@rivosinc.com> References: <20231017131456.2053396-1-cleger@rivosinc.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231017_061547_513437_7534C842 X-CRM114-Status: GOOD ( 11.27 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org 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/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/riscv/hwprobe.rst b/Documentation/riscv/hwprobe.rst index 782ac26cb92a..f81e3c93ac1e 100644 --- a/Documentation/riscv/hwprobe.rst +++ b/Documentation/riscv/hwprobe.rst @@ -154,6 +154,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 79407010952a..4014492c3960 100644 --- a/arch/riscv/include/uapi/asm/hwprobe.h +++ b/arch/riscv/include/uapi/asm/hwprobe.h @@ -54,6 +54,7 @@ struct riscv_hwprobe { #define RISCV_HWPROBE_EXT_ZIHINTNTL (1 << 28) #define RISCV_HWPROBE_EXT_ZVFH (1 << 29) #define RISCV_HWPROBE_EXT_ZVFHMIN (1 << 30) +#define RISCV_HWPROBE_EXT_ZFA (1 << 31) #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 8d6edd721627..a6a063f1dcf5 100644 --- a/arch/riscv/kernel/sys_riscv.c +++ b/arch/riscv/kernel/sys_riscv.c @@ -192,6 +192,7 @@ static void hwprobe_isa_ext0(struct riscv_hwprobe *pair, if (has_fpu()) { CHECK_ISA_EXT(ZFH); CHECK_ISA_EXT(ZFHMIN); + CHECK_ISA_EXT(ZFA); } #undef CHECK_ISA_EXT }