From patchwork Thu Feb 13 00:38:47 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Inochi Amaoto X-Patchwork-Id: 13972637 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 CF335C021A5 for ; Thu, 13 Feb 2025 00:39:18 +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=E9A14zWLNAgDejW0tr67hMiP71qHL81IK0E1IhPkZvA=; b=PEBrSikd7aItL0 etRnSjZ+GmVTKs5VcaBUs459nKMWdboxRdn00Vm9QzQicRGcDe8cXbbKcQubcBkqmVgSwp4/AsBqh ixm30futfIomModUH1p9CWr4SUkEAS3B26Ho6hjg6uvVS6ZaFu31OIyYvr9hvGOXz6ySs40ckjgIN BxP/AJLHy2YzPtv3Uu/95Typf7VOHKQa3968CIZlSQnFW2BElER3AKJe3FLmgdYBkah3Pv7bIFQ/1 TR1VEkOLxzPh5CHnq9asfp/ZtvkRhDDR6VhLXEslP+3x80JmaiDrK54ueN+TEi/uVKeDhF5EItWvx GgCyef3sCFRzIpiucGkg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tiNG6-00000009Ii1-2XQK; Thu, 13 Feb 2025 00:39:14 +0000 Received: from mail-qt1-x832.google.com ([2607:f8b0:4864:20::832]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tiNG4-00000009IgG-1Qri for linux-riscv@lists.infradead.org; Thu, 13 Feb 2025 00:39:13 +0000 Received: by mail-qt1-x832.google.com with SMTP id d75a77b69052e-471bc8eaf3fso2325351cf.2 for ; Wed, 12 Feb 2025 16:39:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1739407151; x=1740011951; 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=1VKAEXIbPsMighQ8qKly+RRtipWoEJVN3H+Ie+l08Lw=; b=Wyb0E/1Y5NEhKerHfByRVwTyyeOUZxOIGY0EmGckWaxV1bLj/mk8oo+jFdQ3cLon4v AIOmq7x2gzVyitUFZM79Q8xv8B7IYW3/JVZ4rnWQ4OrdkqdhopW2nOSESKURjzBpr0Z/ U2rOLOnGjZq5H6CLvE+cbRskK+klh7JbEKKoVRiv3o7njK4FNGZhaUEFnY/WKCHLQYNf /6EYahgzvQ5d2zUJK6+D3rAO9P+8vPudwAvRTf0hdQFX41W1Vg3+xxfBqcU5guTgPctL XZsom3qupEGG1DgxyKcNAt7J6J3Oy4BVRIiHWh5IXLt6gvM6DSmCTMHOLQElE1PXOGuv kmmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739407151; x=1740011951; 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=1VKAEXIbPsMighQ8qKly+RRtipWoEJVN3H+Ie+l08Lw=; b=MSs6NQdgN6kf8ogwZtqKbVDmAA52IG3+u8U870SZlJSswGL4MGvfMtDs0eAuu6JCq9 KOkNDTqPecPvx8NDyMvxnO1NyAmh1OWrIja1dMeGU+/ph7yv8kdX1Txtygpl4CKvZceY DjwDozPn2y1N4p1zgASYEMzLMofV8nuIBO8oyG0ZMQiudJaLpjCVybG+8+iu0vdA/LIT yoL4ME/Is4GpiejLHZzb1ppDJcTXkQ0D82DgbexR/3TnP491GNzT5wkJhHUOThClCThs 92I2Xhs/UrGzjpihwg1xVWsTwYmSf4eoWIOVl2ji6Z+VSaifnUNyCBzsPP+yTD1wLXfl QTWQ== X-Forwarded-Encrypted: i=1; AJvYcCXhgahX6NtYIc7heLla6roicWLCyxhKti2ZOYoa8enrZ3tk7BuB4MzxaCoT+YFTUrZ83uZhIi6tvTTc3A==@lists.infradead.org X-Gm-Message-State: AOJu0YzF8AwyS+iBowF0w+XfLBc+vp159fQc8K4TJXqTzQLz1qPrpGLH SUQJ34rE0bq49IP1b/G3YYftYef9p8POm6lUfFefwf40NekN8a/8 X-Gm-Gg: ASbGncu2r+CbAoWvNv3kWJVzoMSSbTMXaUvn2Kfu9zy82+YKghzfoIVjaTdKRy1KMYw FgsxXN4xxwpLT+JR1n6koATMpQApwNu+mmPMlp6a6nNoFad63CmGJvzuPH4t1mUs5Ov0jFB1Ktp ZvoZXT25kG0CFmhNIwpHfGONiuXZX9wZnad/NjVhnZU3Ci9dFE6OSE8oNG58crSq8GV4a3iwxNs uWNu+reltQ8E+9Uec/vHZ5Xjy9os16FYxc3hb46HXWhr+ihFfPA/5xNX691ISd5pGg= X-Google-Smtp-Source: AGHT+IHBc4LTnAwtHYivgaNgVKDo5w4ZaLaXgX6Xpv7NQpTgZYGhBYw2IsMuK7NVT7OfDxlvlEfZdw== X-Received: by 2002:ac8:7dd0:0:b0:471:9174:53ba with SMTP id d75a77b69052e-471afde1e0fmr56132161cf.9.1739407151127; Wed, 12 Feb 2025 16:39:11 -0800 (PST) Received: from localhost ([2001:da8:7001:11::cb]) by smtp.gmail.com with UTF8SMTPSA id d75a77b69052e-471c2b04b18sm1163941cf.72.2025.02.12.16.39.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Feb 2025 16:39:10 -0800 (PST) From: Inochi Amaoto To: Jonathan Corbet , Paul Walmsley , Palmer Dabbelt , Albert Ou , Rob Herring , Krzysztof Kozlowski , Conor Dooley , =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= , Charlie Jenkins , Evan Green , Andrew Jones , Inochi Amaoto , Jesse Taube , Andy Chiu , Alexandre Ghiti , Yong-Xuan Wang , Yu Chien Peter Lin , Samuel Holland Cc: linux-doc@vger.kernel.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Yixun Lan , Longbin Li Subject: [PATCH v4 3/3] riscv: hwprobe: export bfloat16 ISA extension Date: Thu, 13 Feb 2025 08:38:47 +0800 Message-ID: <20250213003849.147358-4-inochiama@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250213003849.147358-1-inochiama@gmail.com> References: <20250213003849.147358-1-inochiama@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250212_163912_376838_378500DA X-CRM114-Status: GOOD ( 10.66 ) 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 Zfbmin, Zvfbfmin, Zvfbfwma ISA extension through hwprobe. Signed-off-by: Inochi Amaoto Reviewed-by: Clément Léger --- Documentation/arch/riscv/hwprobe.rst | 12 ++++++++++++ arch/riscv/include/uapi/asm/hwprobe.h | 3 +++ arch/riscv/kernel/sys_hwprobe.c | 3 +++ 3 files changed, 18 insertions(+) diff --git a/Documentation/arch/riscv/hwprobe.rst b/Documentation/arch/riscv/hwprobe.rst index f273ea15a8e8..feefe5ea24ea 100644 --- a/Documentation/arch/riscv/hwprobe.rst +++ b/Documentation/arch/riscv/hwprobe.rst @@ -242,6 +242,18 @@ The following keys are defined: * :c:macro:`RISCV_HWPROBE_EXT_SUPM`: The Supm extension is supported as defined in version 1.0 of the RISC-V Pointer Masking extensions. + * :c:macro:`RISCV_HWPROBE_EXT_ZFBFMIN`: The Zfbfmin extension is supported as + defined in the RISC-V ISA manual starting from commit 4dc23d6229de + ("Added Chapter title to BF16"). + + * :c:macro:`RISCV_HWPROBE_EXT_ZVFBFMIN`: The Zvfbfmin extension is supported as + defined in the RISC-V ISA manual starting from commit 4dc23d6229de + ("Added Chapter title to BF16"). + + * :c:macro:`RISCV_HWPROBE_EXT_ZVFBFWMA`: The Zvfbfwma extension is supported as + defined in the RISC-V ISA manual starting from commit 4dc23d6229de + ("Added Chapter title to BF16"). + * :c:macro:`RISCV_HWPROBE_KEY_CPUPERF_0`: Deprecated. Returns similar values to :c:macro:`RISCV_HWPROBE_KEY_MISALIGNED_SCALAR_PERF`, but the key was mistakenly classified as a bitmask rather than a value. diff --git a/arch/riscv/include/uapi/asm/hwprobe.h b/arch/riscv/include/uapi/asm/hwprobe.h index c3c1cc951cb9..e4e286c63629 100644 --- a/arch/riscv/include/uapi/asm/hwprobe.h +++ b/arch/riscv/include/uapi/asm/hwprobe.h @@ -73,6 +73,9 @@ struct riscv_hwprobe { #define RISCV_HWPROBE_EXT_ZCMOP (1ULL << 47) #define RISCV_HWPROBE_EXT_ZAWRS (1ULL << 48) #define RISCV_HWPROBE_EXT_SUPM (1ULL << 49) +#define RISCV_HWPROBE_EXT_ZFBFMIN (1ULL << 50) +#define RISCV_HWPROBE_EXT_ZVFBFMIN (1ULL << 51) +#define RISCV_HWPROBE_EXT_ZVFBFWMA (1ULL << 52) #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_hwprobe.c b/arch/riscv/kernel/sys_hwprobe.c index bcd3b816306c..f76163958e27 100644 --- a/arch/riscv/kernel/sys_hwprobe.c +++ b/arch/riscv/kernel/sys_hwprobe.c @@ -132,6 +132,8 @@ static void hwprobe_isa_ext0(struct riscv_hwprobe *pair, EXT_KEY(ZVE64D); EXT_KEY(ZVE64F); EXT_KEY(ZVE64X); + EXT_KEY(ZVFBFMIN); + EXT_KEY(ZVFBFWMA); EXT_KEY(ZVFH); EXT_KEY(ZVFHMIN); EXT_KEY(ZVKB); @@ -148,6 +150,7 @@ static void hwprobe_isa_ext0(struct riscv_hwprobe *pair, EXT_KEY(ZCD); EXT_KEY(ZCF); EXT_KEY(ZFA); + EXT_KEY(ZFBFMIN); EXT_KEY(ZFH); EXT_KEY(ZFHMIN); }