From patchwork Tue Nov 7 10:55: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: 13448513 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 E129DC4167D for ; Tue, 7 Nov 2023 10:56:41 +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=rypsQKPYeOxodILI/ksLJil92Y5F4CKVtaja6tEbU3s=; b=aPRA6Wa0A2rwUn /QRxiAPMXeJPIMIbaI66EXx9InKAAMU3NPy4ugpWTlbwhIoqiA31P+KYsMHjuaUH796gwkAFPz1vo Jmi0GCYmaBpFof/z4zUlxuVfnutQxxhsiT+71yAr9+Z04YVm3/aQdZd3k3wMJSTgKJe9m/KQ+nFUy PvTtcD0AV7yxBfDerm94QDlJ7sb/3G/BlqJ0JbIJbgzKxKsBQy+6n/sIXTqA1z+hnwDcAv9xHs5qV J+Mdt2yEK5GpdLqu1eHoJQhCXZVpu0xYr2o1eN4vuRkNV61zilcXiDrimuh4+UfPDHuu30wbHkMzo gC58c+L46ATishy3qohQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r0Jl7-0019gq-1c; Tue, 07 Nov 2023 10:56:37 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r0Jl1-0019Wu-0A for linux-riscv@bombadil.infradead.org; Tue, 07 Nov 2023 10:56:31 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:Content-Type :MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Sender:Reply-To:Content-ID:Content-Description; bh=V5SlhQ+MFK/oE1hG84P6kssLtuGPrTemJS5B/ituwJs=; b=ZoS3TJtN8VmEnpoqmKgXHC9yzz 6s3o5RByOmhmNz5z3RU2vNQtpayAckwL2CPKu/TFTMtN4gBtAwa+9iAw532yWStbVgwPSwzO9zCH5 2ZISrrnaklHTVs19GbPwP/8Qqp34j/xTbc9lemrtmc79XPu/aq7q41uQ3z1k0CJCV2LJFREEVPcEB QW/yb8K3Ek4Am/zpMMIPs/rJOk/7X8STGj1KqOf50I848rpZFQ8XPc1o61aNTZa9r2QHP0quBgFO4 gfiEqtawE2ZXODi7I8rk3lnBNL4rF30CIxqkT19quCGSznEb3cv7sNvjP4v7te+QrzOWt6OxFsRiL eb5mv4Nw==; Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]) by desiato.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r0Jkv-00Bx2i-2K for linux-riscv@lists.infradead.org; Tue, 07 Nov 2023 10:56:29 +0000 Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-32f9baca5bcso817470f8f.0 for ; Tue, 07 Nov 2023 02:56:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1699354581; x=1699959381; 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=V5SlhQ+MFK/oE1hG84P6kssLtuGPrTemJS5B/ituwJs=; b=QZOzx/sqNFkCabeazkax5P55fY2+Iv95Rdzl7UyyilvDVj7l8yCsAKN4LPrGjYedCX e9ZbxqllT+C4CRwPmOk1zKNRZXqnNaolwMG0hPl2QJaiTWnu0XOwJAbdGrTDS88zqLyq z+IdZWO3QouDMQ34toJf+wSzZacSGl6Cye6B82B+bOZH4SW6lRtbQ8NtOaaZAYNjFTI+ 7Jd5DHERcNu587RewXP93Xst58lWk4tcsXq/Qsy95W7eVKJyl8niRMD1eFGFPnurm6j3 CIYLP4bWjU2hmHP9aCX9Ln4+er7y+o4A7FwOxY4oR5rw21dTTlkd4kSlEq2Ok0Iubrnn bPdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699354581; x=1699959381; 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=V5SlhQ+MFK/oE1hG84P6kssLtuGPrTemJS5B/ituwJs=; b=BeCX5s7uzpm9QIXTZp7nsevHebQm8K08B5eNiUA6Jg8+BARBWJWFsyWJR8YmLYNVsj vQSrzCkMzrF7qXAVHs5UQ9cDlctyEanTOhmWwDgcH9HXk5dTQgbWHkg04hYvUCyBzNtR g7do8TpmldQKRW/cDsd/CXRBuP+WJIf86F15YGC2WaYJR/xaL8K5KVXnV5u1ohTHbtsH 3FY+9XAYi8jxhVd2FKjPsdJshvNshCkmuWrtnpgIdMxneXLLjL48uP6GYVt+/qbojDeN Cma70YT3drVHXVaiOz7kvJMcmTS/mJVqqwp//IQd5+9JipQ79olE4+9gw/zQx/2ek8u5 2L/Q== X-Gm-Message-State: AOJu0YxyAQrn1qcUIKNflyZRlVhLUuwp43up/hW9gRz6vbbMIi2vNIV7 lyB4qXC/2/iFa+oeHBmJP1TImSWBI1Fs0Qjmtt7mRg== X-Google-Smtp-Source: AGHT+IFQS7qfkMNRtAKpq/tiaOzmGYA+PKb/n54XAFPfjBLLUBdHDw7kelXyOwVBWWtsxlUnnASLNQ== X-Received: by 2002:a05:600c:ac3:b0:404:72f9:d59a with SMTP id c3-20020a05600c0ac300b0040472f9d59amr26109516wmr.0.1699354580425; Tue, 07 Nov 2023 02:56:20 -0800 (PST) Received: from carbon-x1.. ([2a01:e0a:999:a3a0:7db3:bdd9:4cab:2ee3]) by smtp.gmail.com with ESMTPSA id n30-20020a05600c501e00b00405442edc69sm15396853wmr.14.2023.11.07.02.56.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Nov 2023 02:56:20 -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 Subject: [PATCH v3 16/20] riscv: hwprobe: export Zvfh[min] ISA extensions Date: Tue, 7 Nov 2023 11:55:52 +0100 Message-ID: <20231107105556.517187-17-cleger@rivosinc.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231107105556.517187-1-cleger@rivosinc.com> References: <20231107105556.517187-1-cleger@rivosinc.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231107_105625_881809_6BF79651 X-CRM114-Status: GOOD ( 10.60 ) 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/arch/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/arch/riscv/hwprobe.rst b/Documentation/arch/riscv/hwprobe.rst index 2f37b26d27da..2a2fe4b026e7 100644 --- a/Documentation/arch/riscv/hwprobe.rst +++ b/Documentation/arch/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 36c8d073c987..5124327b70ff 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 af2b01b0a5b6..3cd5d42ae01f 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()) {