From nobody Thu Dec 18 00:08:05 2025 Received: from mail-qt1-f172.google.com (mail-qt1-f172.google.com [209.85.160.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E3D1070810; Thu, 13 Feb 2025 00:39:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739407146; cv=none; b=cjD0Ga6XH0Zary68zCwQWlgVdnGJZDYFxudkrS2ysvsdzI275hXyxY9cQC3d7QoKhuEKP8N6PYPu0XhM/yqUw6YrM6P6sP7q5mfUbKU6ahXN0BE/ko8GEeQyhwoV/erSKDkZOjyHOxMTq/1mybyp1iFJFDUfCr9agjn/YMuvKBs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739407146; c=relaxed/simple; bh=a8Z67QJdO5v3ffSQOMXQWEvL4DdnSxV/Mk2ayYeqQ9M=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ORF26z8VbRTsbaBOIsLPZcCU8Ajo+Xr19YoK/g40ph5Ye3eVAU4IA8Tg1O/kmVE08kL4CrOmkKuRn5/9B8fp0h+0aj/MoYgyxHXSH5DaibzequvexhHDVnGvN+BEeR4Ig9f933nkxLZqYsDYSX5sKy/JPC0YDpTT7j1HDNAHXYY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=eFxbrUhc; arc=none smtp.client-ip=209.85.160.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="eFxbrUhc" Received: by mail-qt1-f172.google.com with SMTP id d75a77b69052e-4719768caf7so2344991cf.3; Wed, 12 Feb 2025 16:39:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1739407144; x=1740011944; 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=U/dVS4QIgcS+IuNnmD54Uf/v25I+PAzsTeOUn9AzZIw=; b=eFxbrUhclQ6sAINrhjRaptpDoNKvvD361DNv401YpiC4QS+tbhmYrnZomEtWeB8ZME eZXIfxzt2ce7vOK1btrhKZx9975KMzhWAb8PRba0C3IlkwxFLdc32xt6nfZanwLkc0lI N4qbvY6oOtFAf64cKAGq5BI3baJ6urjJgZacE0RU5SVzOFc4fxnfSmjsC+fz5+I13lau cCw8SXPtS5EKISkNynLLa16+cNLbl95m4elMpxL/y+slybxXiPAi0ulh+7x75/1bheX3 Vr6oZzNp61YiVbliguMPxNcO3QcG6Y4WMix2E4Na8Wcq0JniNk1xjqCIU/VgiZ9r1WMW X5hQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739407144; x=1740011944; 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=U/dVS4QIgcS+IuNnmD54Uf/v25I+PAzsTeOUn9AzZIw=; b=K5W1e4siuX3sVFZiIyBjuQTWIeT7ToW562YQ7XVUcBC0wWt+XAK0eP99if51vBfFwU giSLU8LpCFcdiiog5ZsPfoIIdUeVrt5gRIXkyNqd5wsUonmY3+iDs4aTXHiKxtUxi84c xPvY9SSmkunUXuqK/tvyfOTHagRu5bNPZ30wINCLmTEf/a0DJas+RnonK5qYS5316I6t GPlYZwCJQ+fLPTJiGWON0rG9AP5DN69iuFa6umWn26HMMO2F7EB6oH5HyVutS+7XKD/5 gh4AtMKdvSlB8T7R3o5naWzzyziZ37xZ+wlG/E9MgyQ1Vs9PjpB5Ij72j+2xpEChyE35 Un2A== X-Forwarded-Encrypted: i=1; AJvYcCUkBAeUPtZ45ADcmUeVxnBIbdb5Tw0WLwdlygqm5dQdzurENrBhcS3bZbOx5MsoeH/Gmd0d/BjThV3I@vger.kernel.org, AJvYcCVbQJ6anGObOfmJwoHIWdoMIZDT8R+6Qhj9QwC/mIPG6pspqrAA0qnMWmpHdznbJMGLpCzR2mNmPtL9hDU/@vger.kernel.org X-Gm-Message-State: AOJu0YwBuY74wqsWBfPyo6+EdHg/tIFV7pO8Z4OxzNjtKBs52hmNxlLU 5nMU1lbrvFzIk3ZX3HRn0DYuyfwhNsK3/U1aVyCT5hA5scdP/Mis X-Gm-Gg: ASbGncvqrwoOqLgsss5TKglBAO67Ec9MuseklbkPPrDUSLMm4HuCIKZ/+UtM9V7JJOw 0li0CdBNGBl4Rw/QSPw3tFW72f+6iX0gcxEhbPp76yqaW1or2hkDL+l/yOd+TgcxuCW7pWJe0ZQ LH/yxLZhHJJAmSPvP/3XIrsrms3qrp62T7gh1zX0I7Gbfm83110gz5RWmYiSL7vTTKJ49+RMJIy 9WRQbgfeuSGUBmX/cU3X/4/Gw/9KZGuIaB5zBTe+zbL/oxJgLp8pjAZO1eT8dXAcrw= X-Google-Smtp-Source: AGHT+IHspWsE6z8rbANPu1J4EJHGR6YUyo3bjSrXk+tx6Wy/U/d08EMp+rHEHGe9CzvstZnDSmahbQ== X-Received: by 2002:a05:622a:1a1c:b0:466:9d0e:1920 with SMTP id d75a77b69052e-471afe5fa85mr71820871cf.24.1739407143682; Wed, 12 Feb 2025 16:39:03 -0800 (PST) Received: from localhost ([2001:da8:7001:11::cb]) by smtp.gmail.com with UTF8SMTPSA id d75a77b69052e-471c29e9261sm1302281cf.5.2025.02.12.16.39.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Feb 2025 16:39:02 -0800 (PST) From: Inochi Amaoto To: Jonathan Corbet , Paul Walmsley , Palmer Dabbelt , Albert Ou , Rob Herring , Krzysztof Kozlowski , Conor Dooley , =?UTF-8?q?Cl=C3=A9ment=20L=C3=A9ger?= , 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 , Conor Dooley Subject: [PATCH v4 1/3] dt-bindings: riscv: add bfloat16 ISA extension description Date: Thu, 13 Feb 2025 08:38:45 +0800 Message-ID: <20250213003849.147358-2-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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Add description for the BFloat16 precision Floating-Point ISA extension, (Zfbfmin, Zvfbfmin, Zvfbfwma). which was ratified in commit 4dc23d62 ("Added Chapter title to BF16") of the riscv-isa-manual. Signed-off-by: Inochi Amaoto Acked-by: Conor Dooley --- .../devicetree/bindings/riscv/extensions.yaml | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/Documentation/devicetree/bindings/riscv/extensions.yaml b/Docu= mentation/devicetree/bindings/riscv/extensions.yaml index a63b994e0763..f26997c3d34d 100644 --- a/Documentation/devicetree/bindings/riscv/extensions.yaml +++ b/Documentation/devicetree/bindings/riscv/extensions.yaml @@ -329,6 +329,12 @@ properties: instructions, as ratified in commit 056b6ff ("Zfa is ratified"= ) of riscv-isa-manual. =20 + - const: zfbfmin + description: + The standard Zfbfmin extension which provides minimal support = for + 16-bit half-precision brain floating-point instructions, as ra= tified + in commit 4dc23d62 ("Added Chapter title to BF16") of riscv-is= a-manual. + - const: zfh description: The standard Zfh extension for 16-bit half-precision binary @@ -525,6 +531,18 @@ properties: in commit 6f702a2 ("Vector extensions are now ratified") of riscv-v-spec. =20 + - const: zvfbfmin + description: + The standard Zvfbfmin extension for minimal support for vector= ed + 16-bit half-precision brain floating-point instructions, as ra= tified + in commit 4dc23d62 ("Added Chapter title to BF16") of riscv-is= a-manual. + + - const: zvfbfwma + description: + The standard Zvfbfwma extension for vectored half-precision br= ain + floating-point widening multiply-accumulate instructions, as r= atified + in commit 4dc23d62 ("Added Chapter title to BF16") of riscv-is= a-manual. + - const: zvfh description: The standard Zvfh extension for vectored half-precision @@ -673,6 +691,33 @@ properties: then: contains: const: zca + # Zfbfmin depends on F + - if: + contains: + const: zfbfmin + then: + contains: + const: f + # Zvfbfmin depends on V or Zve32f + - if: + contains: + const: zvfbfmin + then: + oneOf: + - contains: + const: v + - contains: + const: zve32f + # Zvfbfwma depends on Zfbfmin and Zvfbfmin + - if: + contains: + const: zvfbfwma + then: + allOf: + - contains: + const: zfbfmin + - contains: + const: zvfbfmin =20 allOf: # Zcf extension does not exist on rv64 --=20 2.48.1 From nobody Thu Dec 18 00:08:05 2025 Received: from mail-qt1-f177.google.com (mail-qt1-f177.google.com [209.85.160.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A414878F29; Thu, 13 Feb 2025 00:39:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.177 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739407150; cv=none; b=XPAJLb9QSRgtGK3s6Dd58F29Ad353ddXa6M/2YapjKyguYb6M6eTdUkF7tlJ+ZMTayxeQ1Ylu5bSbeKDjIt6WJfg1qFPUq6hy8zTL9IBs7XIWi50uEaKFToMUvZkkUNTRJ7+toKKrghIVIm1k4REA7fiW8eUvR3jEHQiSU5VxsM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739407150; c=relaxed/simple; bh=KDz8UMmpb2nYnrzlVehg8XdfsqjhtiU7EiAGoV39lSQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=p4tP3HmhEk5KoVg8ZxrH8FOY9ag+49js/fPnyDykFQrh73V3jIzg6pQzi4bIk4I7d6zo013ch8V5yzqYTodw1s23/VTP6DnTvH3MeTx5hYJz3KDNjVQNwVQ5dUxDnzOCuupRujll6xJf6cbcobFHIqCmLbbOuZpaT8gKzmSlUy8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=RLWG+VLi; arc=none smtp.client-ip=209.85.160.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="RLWG+VLi" Received: by mail-qt1-f177.google.com with SMTP id d75a77b69052e-471b5372730so3123291cf.1; Wed, 12 Feb 2025 16:39:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1739407147; x=1740011947; 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=dUrtJevhcm0CKbwqKbK4CuYq0Bi82l+4WvPMumL72xI=; b=RLWG+VLiDmSpJkYTYhvfwsv8Kojg5oNovBc+i6CW7bBhH5qSaUEQQaSmU3l5+Bilmz 0fMMovrEjtiToC7lV8OSYNy6CJ6IBKgBLcAC26/IPAYDxLhoxSqR94gGspzAETco7KIW Bl7YgeoQlnw7age/eMY/CaEPiGundWihwi+G8mFy0gGdTpyDtKFFLNMf7aO4uLTUgjsW NyIPs8DfOo/SA25le5oswOklzrl9Ki3vm5CqoD4Z3p/YK+oaGAxmOCoXQfShx90WtJJa 7ki+Wp25LbTMSQKu5QQSv4Fsf2AhBqb6tF4gx4dpmdanCs4y76HKbPWmaD9H6fTPoaFH tqNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739407147; x=1740011947; 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=dUrtJevhcm0CKbwqKbK4CuYq0Bi82l+4WvPMumL72xI=; b=Pv8sQv4bM9MOdiv3Ibhyq1IZRwauY/BcWfSi6A/eeju4Yga81pIk5cs/rV2sicceXJ R1+n+SBBqk0WMcUZlohJR+McHWuruWMNDyo/lHxWARdYZY0PcmeJ/iVd+tyI6AmXlcAO f70EkITfXEJqc2VLCQaf9JK93z1LWHt81kvTvx3Kn6iANDNhEUpCw5w96g4x3wax7eYb h5ula9W//KR6lbsRnIUGYZBYcjhzvkwbYTqsk9i5q5tGGSUksrgyVFSoMztYxfzx5aBJ q5gnuUDaKTfcaYeTYSG9NmnE446EezSZLV2sOMjvYUlHLlwJEMo5Zf8W8B21XnPxEPrn X2Tg== X-Forwarded-Encrypted: i=1; AJvYcCWdRy7ICCFoGGMrjWMmdtCHlv494zZGptuDJFZW7FDxHZUmu56I5OXwm3KSNLUDHNWsGhNEXgczHXcJ@vger.kernel.org, AJvYcCXPpnYP7IiEAkl9/auXI+/oxBHtHYcjsXIXc8IzrLF9zzOQvfILenXKyrWr0l9xoCi1QokMAlMBDY3uxQ17@vger.kernel.org X-Gm-Message-State: AOJu0Yyyc++dkZBMnWW1eJn5eL1A8cjjMRfZkYwdZnhq/1QzutxMAQkB +lmKZy9geLsqDQDGHE4r3IWdkQlY6ZaThrrwnk+Yktob91KtSUnfQz5mpA== X-Gm-Gg: ASbGncsJ5OeiCbOUXg/vB4UWpUYxKmUWeHnWY4lJXRdWHkwH7GUC4I3me69A7itpti4 23UFsi5hkQdQeYVdfrkbmEQQOGneFd9VK9hqwRPXiel2mUz0j70RWolBu5a14gkmsu778JySAnJ Lx7apnsiyH8ckwpnBW8wrpLguQvz6puUTS0057iJV6BnfflxJNrH1zINnRwCVu/DbOqqO/Ho0Qv RE4UxXnipDxWXJ80tkypumLXaMJNHGB/OFpYSOLW4iaxuFnyJcFAMYUtxZsyuDoaa8= X-Google-Smtp-Source: AGHT+IH4Lace1X98ZnWBEvY1cymlk72VSYPPy3ZXrC1eukrH19AoRSIo1KXtdbZz9LKA1vAlD6ac/A== X-Received: by 2002:ac8:5a15:0:b0:471:a602:e75 with SMTP id d75a77b69052e-471bed7567dmr20929571cf.25.1739407147286; Wed, 12 Feb 2025 16:39:07 -0800 (PST) Received: from localhost ([2001:da8:7001:11::cb]) by smtp.gmail.com with UTF8SMTPSA id d75a77b69052e-471c2b06002sm1152481cf.77.2025.02.12.16.39.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Feb 2025 16:39:07 -0800 (PST) From: Inochi Amaoto To: Jonathan Corbet , Paul Walmsley , Palmer Dabbelt , Albert Ou , Rob Herring , Krzysztof Kozlowski , Conor Dooley , =?UTF-8?q?Cl=C3=A9ment=20L=C3=A9ger?= , Charlie Jenkins , Evan Green , Inochi Amaoto , Andrew Jones , 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 2/3] riscv: add ISA extension parsing for bfloat16 ISA extension Date: Thu, 13 Feb 2025 08:38:46 +0800 Message-ID: <20250213003849.147358-3-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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Add parsing for Zfbmin, Zvfbfmin, Zvfbfwma ISA extension which were ratified in 4dc23d62 ("Added Chapter title to BF16") of the riscv-isa-manual. Signed-off-by: Inochi Amaoto Reviewed-by: Cl=C3=A9ment L=C3=A9ger --- arch/riscv/include/asm/hwcap.h | 3 +++ arch/riscv/kernel/cpufeature.c | 35 ++++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/arch/riscv/include/asm/hwcap.h b/arch/riscv/include/asm/hwcap.h index 869da082252a..14cc29f2a723 100644 --- a/arch/riscv/include/asm/hwcap.h +++ b/arch/riscv/include/asm/hwcap.h @@ -100,6 +100,9 @@ #define RISCV_ISA_EXT_ZICCRSE 91 #define RISCV_ISA_EXT_SVADE 92 #define RISCV_ISA_EXT_SVADU 93 +#define RISCV_ISA_EXT_ZFBFMIN 94 +#define RISCV_ISA_EXT_ZVFBFMIN 95 +#define RISCV_ISA_EXT_ZVFBFWMA 96 =20 #define RISCV_ISA_EXT_XLINUXENVCFG 127 =20 diff --git a/arch/riscv/kernel/cpufeature.c b/arch/riscv/kernel/cpufeature.c index c6ba750536c3..37fb6b07281e 100644 --- a/arch/riscv/kernel/cpufeature.c +++ b/arch/riscv/kernel/cpufeature.c @@ -80,6 +80,15 @@ bool __riscv_isa_extension_available(const unsigned long= *isa_bitmap, unsigned i } EXPORT_SYMBOL_GPL(__riscv_isa_extension_available); =20 +static int riscv_ext_f_depends(const struct riscv_isa_ext_data *data, + const unsigned long *isa_bitmap) +{ + if (__riscv_isa_extension_available(isa_bitmap, RISCV_ISA_EXT_f)) + return 0; + + return -EPROBE_DEFER; +} + static int riscv_ext_zicbom_validate(const struct riscv_isa_ext_data *data, const unsigned long *isa_bitmap) { @@ -140,6 +149,28 @@ static int riscv_ext_zcf_validate(const struct riscv_i= sa_ext_data *data, return -EPROBE_DEFER; } =20 +static int riscv_vector_f_validate(const struct riscv_isa_ext_data *data, + const unsigned long *isa_bitmap) +{ + if (!IS_ENABLED(CONFIG_RISCV_ISA_V)) + return -EINVAL; + + if (__riscv_isa_extension_available(isa_bitmap, RISCV_ISA_EXT_ZVE32F)) + return 0; + + return -EPROBE_DEFER; +} + +static int riscv_ext_zvfbfwma_validate(const struct riscv_isa_ext_data *da= ta, + const unsigned long *isa_bitmap) +{ + if (__riscv_isa_extension_available(isa_bitmap, RISCV_ISA_EXT_ZFBFMIN) && + __riscv_isa_extension_available(isa_bitmap, RISCV_ISA_EXT_ZVFBFMIN)) + return 0; + + return -EPROBE_DEFER; +} + static int riscv_ext_svadu_validate(const struct riscv_isa_ext_data *data, const unsigned long *isa_bitmap) { @@ -345,6 +376,7 @@ const struct riscv_isa_ext_data riscv_isa_ext[] =3D { __RISCV_ISA_EXT_DATA(zacas, RISCV_ISA_EXT_ZACAS), __RISCV_ISA_EXT_DATA(zawrs, RISCV_ISA_EXT_ZAWRS), __RISCV_ISA_EXT_DATA(zfa, RISCV_ISA_EXT_ZFA), + __RISCV_ISA_EXT_DATA_VALIDATE(zfbfmin, RISCV_ISA_EXT_ZFBFMIN, riscv_ext_f= _depends), __RISCV_ISA_EXT_DATA(zfh, RISCV_ISA_EXT_ZFH), __RISCV_ISA_EXT_DATA(zfhmin, RISCV_ISA_EXT_ZFHMIN), __RISCV_ISA_EXT_DATA(zca, RISCV_ISA_EXT_ZCA), @@ -377,6 +409,9 @@ const struct riscv_isa_ext_data riscv_isa_ext[] =3D { __RISCV_ISA_EXT_SUPERSET(zve64d, RISCV_ISA_EXT_ZVE64D, riscv_zve64d_exts), __RISCV_ISA_EXT_SUPERSET(zve64f, RISCV_ISA_EXT_ZVE64F, riscv_zve64f_exts), __RISCV_ISA_EXT_SUPERSET(zve64x, RISCV_ISA_EXT_ZVE64X, riscv_zve64x_exts), + __RISCV_ISA_EXT_DATA_VALIDATE(zvfbfmin, RISCV_ISA_EXT_ZVFBFMIN, riscv_vec= tor_f_validate), + __RISCV_ISA_EXT_DATA_VALIDATE(zvfbfwma, RISCV_ISA_EXT_ZVFBFWMA, + riscv_ext_zvfbfwma_validate), __RISCV_ISA_EXT_DATA(zvfh, RISCV_ISA_EXT_ZVFH), __RISCV_ISA_EXT_DATA(zvfhmin, RISCV_ISA_EXT_ZVFHMIN), __RISCV_ISA_EXT_DATA(zvkb, RISCV_ISA_EXT_ZVKB), --=20 2.48.1 From nobody Thu Dec 18 00:08:05 2025 Received: from mail-qt1-f177.google.com (mail-qt1-f177.google.com [209.85.160.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7FEF081AC8; Thu, 13 Feb 2025 00:39:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.177 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739407154; cv=none; b=jaW3ekh3qSCPqUz4HAJN4eW382MFP2pbd5DC+Luf+C/nVpuBT7g7MbI8d+NgyGjg3+dOlIhE2KqIR3QvNKvP7NybFpEwvJyTPnhgPbIQ4GsURLT4MXN7svvBXCd5sR0Vt9ZyCrk77yzfnsBjSDf5YsNEzAcFt3Z+LsBgm6CfueU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739407154; c=relaxed/simple; bh=/+w6HiAUlBc+kRrinIioqfpoFWtrMKoB/DUDSDW3RCU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=nfUGJCLTaxHFEQxZ/S+6qTRsmFRJi0aR46bwRPsx7kXuTo0NtOWYlxr498qQlOeZTk4nvPMm0UKpjYX0T0xczhQO5E6L/qr8a42oE44O/PxoZxzbUUhB3BCFy0SquA1B1ThstCFr4MM/wrq5XGtfoQvNyJG9FZj+oc5FuiKvTdw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=MrStPF+H; arc=none smtp.client-ip=209.85.160.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="MrStPF+H" Received: by mail-qt1-f177.google.com with SMTP id d75a77b69052e-46c8474d8daso2140031cf.3; 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=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=1VKAEXIbPsMighQ8qKly+RRtipWoEJVN3H+Ie+l08Lw=; b=MrStPF+Hb3N+pc/qdtGgDFGMcV3YJ6WmF3rUVxCVJ3HMDYeG/YL0WpzTwXM0HnsRUX ovKOV/efqY+JmU/BEeF4/Uk46wLCsihmkAu6cVV4bU3nVH3C+7zTn3IsyjCdGMOqPCzz rWegswOkfyBcBfZ5okJyay4UgxU3+uadSWuEP/pIyQano55DPX2/mMOarR1zjcYtgeE4 tiGclw77V3c1fKCNLzId8D6lxhGg/fnuYRIaKk/tz1pRv85AJUPzfj1h/U4lqtu60Zj6 3MkqnuWfCZy2n92lneHZUjebOEbY2E1N6Tt62AZs0oL6TILZbN3UCPwowI4oTN/6Y3uu abhQ== 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=fbqWkcA5ViqOHYyeHSzzgpgJqA84O7FRUxvLJb5Lqit7qGIu1pDNKE5UWNInIwbLa2 AQraijsgiXy27tJMJmGlwqJPqNRApp2OSvturij6e1qM8NPbBWS2Fr1/4IQmt0bJhrkX rsabeCXzZhZQl89Aorr9wl6IP7sptccA6Oz0ddjteiRNRsGsBUZoghiX7JDUzhb+G5Ig qubB5vc+IwmlEiqSyFrv9LSrJ6J5z9bULL1lDoickevaZ4oXy9WuHIx7Cu9MR+iQzquf baEhCjcLAeRMovSCFRKpSu8uC0nQZJjGTbbZc175IuqHDyLr0ChzOuF84sVxhngret53 g/RQ== X-Forwarded-Encrypted: i=1; AJvYcCWdUMumqZuMO1/gIj8B+9xy/HdDGOSLVVnPOxVctnW0gyLUz3QchEXVbL3hTjNo3pPM3Yj2OluBKTZ4fbpx@vger.kernel.org, AJvYcCX5KW4f0VECAZAW7UoNtxJXPc7KX0vlhX/UTVZiGMEZL+XbzmJNowkOmNkKejrXbsROTDWmy0bc5mab@vger.kernel.org X-Gm-Message-State: AOJu0YyH7g9vX3y89aW1qkMez3EjCBPURahDgRkn8g3M1se2UwK/Ty4+ iB0cNcnYDUiwTxZ+q/+nBAgUXOvjIaJQ4oPCl7vEGtgkcF/4mKDz X-Gm-Gg: ASbGncvNgo2a1ME7+VlJTlfrNEsrla4OqyKOZT3Ib0tqZeOZjaZ8Ci05ul4S/eE0xBL HsuQDtQFysroBGTIEOMcm+xAgae0tMH9YPHRC2YNhaS1ECoYcwt0MqnIL8LG28RiPp3YJvx3IT6 HY4UaPVCtv6oM0K3U+ad/dFZCdlCArEJNipVE8DsQi4GNg+u/Nl8pYLBklEb/jygEsdF8pWugeD lH4WB15dyY00U7r2T+kO9CEhoME+54+jVaUd31XmbOnZUsisZRmTel/Hv6r//9Rpg4= 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?q?Cl=C3=A9ment=20L=C3=A9ger?= , 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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Export Zfbmin, Zvfbfmin, Zvfbfwma ISA extension through hwprobe. Signed-off-by: Inochi Amaoto Reviewed-by: Cl=C3=A9ment L=C3=A9ger --- 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/risc= v/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. =20 + * :c:macro:`RISCV_HWPROBE_EXT_ZFBFMIN`: The Zfbfmin extension is support= ed 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 suppo= rted 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 suppo= rted 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 val= ues 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/uap= i/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_hwprob= e.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); } --=20 2.48.1