From patchwork Tue Oct 17 13:14:52 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: 13425151 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 A461ACDB482 for ; Tue, 17 Oct 2023 13:16:07 +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=l6/Wxmmp8mxdKwPf/o0wJPEYWyk6ky6sy2O3arT6+LU=; b=2Twwm0iahoslMa XRwoGWDP3sQWKOV2C32y28IdxHvQsv3TyscQfL6hylRtqO745D0LPmZEt1PUhoYBy4MB6bY4AFsm6 By/sTqkbHgdALySNBeJFPiqdGZwdO90NNBwEGrbmc3sh0+5k1FTMtlRW5Cg9KXO24wTQu1oJuQLz3 oa2+GuL5wwk1Khq56cWgYXBx3wD4abGbdQE55lZG7Wglmnz89SMhoJv+5lrryuuWsyH3ZqUZ0KbhA WXLTIuPz1JIQzOF9P+zr/k6LWeodXyiQ4+3HAfqpzDnizaAF56LzgCvEjJMKjw1FuQiGaiU0Ekcqa ilLdLbE/P5gyoo6neQ0Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qsjvW-00CNb6-21; Tue, 17 Oct 2023 13:16:02 +0000 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qsjvF-00CNBY-0D for linux-riscv@lists.infradead.org; Tue, 17 Oct 2023 13:15:47 +0000 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-407acb21f27so736115e9.0 for ; Tue, 17 Oct 2023 06:15:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1697548542; x=1698153342; 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=U2m+45j3rbdaE2NY5Ol9kX9V97sFwlFvtbz4uSqqCuM=; b=J+o/ydze76+w4/ssmdcn4nYPyQ0+3HpAWSJqrSnVFVDlsvvPrh2P3vRv6q+Ek4drkW /NWBpiL8YeJaG6+xUp4nGdu3wI/A8iIQF3tUlTtbIBPaiGF0759a8dESTEmjZ/TY/wWy 1vFJAD/ImcRvYMWgZ4RVjQ8gAUJvOWPPNgPLIKE0ESKz3/kW0zOsFs1Y+a09LQ2WdjZq qGKvqPrX2s7SDpqOGCcopXCK3xSwR7IROXwa4HZamdmAnkdUmCOYqAGp4/Kg2qxmZ8ZN MgCRYe0q72J+HxDZs7XuNnncQdNjQhWFrkS/BJ5i+VKEvEh64VWfsoshjLEo95iIHyA6 OoVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697548542; x=1698153342; 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=U2m+45j3rbdaE2NY5Ol9kX9V97sFwlFvtbz4uSqqCuM=; b=V0izfi7EZFjkJPJYkry1C7coasajgSAzMeptgHpy0doAI+iSjlxu8rJWWkuOE2FOYX QwlgYVLJH42eNhunfrBW0XCZIE74zolHU+FWdrBnI8MZ1HrjMMicNBFaxm1Tah4MyH3N pi3rWOYGCyw0sqgFHMQ37+Q5dpE+DJ+rpXXV7aLbFKuWOFLRjsZvkrkz07E7ZPs8IhDS UnV2IGkMTPhwM+Lt5melhA0+zUPDvEE9bQ/uu5vfhRU+nZSlsYnDvyIRkrUtd8+CeVq9 yRmZEj9tFSNHpTx2tBGP5OsH7K8NQYVwagT4aQP08DlW8+CSH5A0iS6QTya7RYaPsRet 4lkQ== X-Gm-Message-State: AOJu0YxvWw8MphqlTwcsdJkCkQxfRIXSKC8PUZ3AilSP/UFf/S2VySGa 6aJstMcUUbK8UzF/0JADPCJbo9bMBauS+fqlMQXMrA== X-Google-Smtp-Source: AGHT+IGl5sTERYXS8gZHY5M+sSNt7WnBezruA/vUWy9wkpbAVX1cnbpzCqcAtWiC4jzRoXD25NnTVg== X-Received: by 2002:a05:600c:929:b0:405:39bb:38a8 with SMTP id m41-20020a05600c092900b0040539bb38a8mr1653730wmp.2.1697548541300; Tue, 17 Oct 2023 06:15:41 -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.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Oct 2023 06:15:40 -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 15/19] riscv: hwprobe: export Zvfh[min] ISA extensions Date: Tue, 17 Oct 2023 15:14:52 +0200 Message-ID: <20231017131456.2053396-16-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_061545_135508_5A9CB197 X-CRM114-Status: GOOD ( 10.40 ) 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 Zvfh[min] ISA extension[1] through hwprobe. Link: https://drive.google.com/file/d/1_Yt60HGAf1r1hx7JnsIptw0sqkBd9BQ8/view [1] Signed-off-by: Clément Léger Reviewed-by: Evan Green --- Documentation/riscv/hwprobe.rst | 8 ++++++++ arch/riscv/include/uapi/asm/hwprobe.h | 2 ++ arch/riscv/kernel/sys_riscv.c | 2 ++ 3 files changed, 12 insertions(+) diff --git a/Documentation/riscv/hwprobe.rst b/Documentation/riscv/hwprobe.rst index 9c909e0d5316..782ac26cb92a 100644 --- a/Documentation/riscv/hwprobe.rst +++ b/Documentation/riscv/hwprobe.rst @@ -146,6 +146,14 @@ The following keys are defined: * :c:macro:`RISCV_HWPROBE_EXT_ZIHINTNTL`: The Zihintntl extension version 1.0 is supported as defined in the RISC-V ISA manual. + * :c:macro:`RISCV_HWPROBE_EXT_ZVFH`: The Zvfh extension is supported as + defined in the RISC-V Vector manual starting from commit e2ccd0548d6c + ("Remove draft warnings from Zvfh[min]"). + + * :c:macro:`RISCV_HWPROBE_EXT_ZVFHMIN`: The Zvfhmin extension is supported as + defined in the RISC-V Vector manual starting from commit e2ccd0548d6c + ("Remove draft warnings from Zvfh[min]"). + * :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 dc4eaa978ad1..79407010952a 100644 --- a/arch/riscv/include/uapi/asm/hwprobe.h +++ b/arch/riscv/include/uapi/asm/hwprobe.h @@ -52,6 +52,8 @@ struct riscv_hwprobe { #define RISCV_HWPROBE_EXT_ZFH (1 << 26) #define RISCV_HWPROBE_EXT_ZFHMIN (1 << 27) #define RISCV_HWPROBE_EXT_ZIHINTNTL (1 << 28) +#define RISCV_HWPROBE_EXT_ZVFH (1 << 29) +#define RISCV_HWPROBE_EXT_ZVFHMIN (1 << 30) #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 84daaf6ed4a1..8d6edd721627 100644 --- a/arch/riscv/kernel/sys_riscv.c +++ b/arch/riscv/kernel/sys_riscv.c @@ -185,6 +185,8 @@ static void hwprobe_isa_ext0(struct riscv_hwprobe *pair, CHECK_ISA_EXT(ZVKSED); CHECK_ISA_EXT(ZVKSH); CHECK_ISA_EXT(ZVKT); + CHECK_ISA_EXT(ZVFH); + CHECK_ISA_EXT(ZVFHMIN); } if (has_fpu()) {