lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250911121219.20243-3-zihong.plct@isrc.iscas.ac.cn>
Date: Thu, 11 Sep 2025 20:12:09 +0800
From: Yao Zihong <zihong.plct@...c.iscas.ac.cn>
To: linux-riscv@...ts.infradead.org
Cc: linux-kernel@...r.kernel.org,
	zihong.plct@...c.iscas.ac.cn,
	zihongyao@...look.com,
	zhangyin2018@...as.ac.cn,
	Paul Walmsley <paul.walmsley@...ive.com>,
	Palmer Dabbelt <palmer@...belt.com>,
	Albert Ou <aou@...s.berkeley.edu>,
	Alexandre Ghiti <alex@...ti.fr>,
	Charlie Jenkins <charlie@...osinc.com>,
	Clément Léger <cleger@...osinc.com>,
	Jesse Taube <jesse@...osinc.com>,
	Miquel Sabaté Solà <mikisabate@...il.com>,
	Samuel Holland <samuel.holland@...ive.com>,
	Thomas Weißschuh <thomas.weissschuh@...utronix.de>,
	Nam Cao <namcao@...utronix.de>,
	Yunhui Cui <cuiyunhui@...edance.com>
Subject: [PATCH v1 2/2] riscv: hwprobe: report Zicbop presence and block size

Plumb Zicbop into sys_hwprobe. Semantics mirror Zicbom/Zicboz
to keep userspace expectations aligned.

Signed-off-by: Yao Zihong <zihong.plct@...c.iscas.ac.cn>
---
 arch/riscv/kernel/sys_hwprobe.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/arch/riscv/kernel/sys_hwprobe.c b/arch/riscv/kernel/sys_hwprobe.c
index 0b170e18a2be..857d4e602e76 100644
--- a/arch/riscv/kernel/sys_hwprobe.c
+++ b/arch/riscv/kernel/sys_hwprobe.c
@@ -112,6 +112,7 @@ static void hwprobe_isa_ext0(struct riscv_hwprobe *pair,
 		EXT_KEY(ZCB);
 		EXT_KEY(ZCMOP);
 		EXT_KEY(ZICBOM);
+		EXT_KEY(ZICBOP);
 		EXT_KEY(ZICBOZ);
 		EXT_KEY(ZICNTR);
 		EXT_KEY(ZICOND);
@@ -294,6 +295,11 @@ static void hwprobe_one_pair(struct riscv_hwprobe *pair,
 		if (hwprobe_ext0_has(cpus, RISCV_HWPROBE_EXT_ZICBOM))
 			pair->value = riscv_cbom_block_size;
 		break;
+	case RISCV_HWPROBE_KEY_ZICBOP_BLOCK_SIZE:
+		pair->value = 0;
+		if (hwprobe_ext0_has(cpus, RISCV_HWPROBE_EXT_ZICBOP))
+			pair->value = riscv_cbop_block_size;
+		break;
 	case RISCV_HWPROBE_KEY_HIGHEST_VIRT_ADDRESS:
 		pair->value = user_max_virt_addr();
 		break;
-- 
2.47.2


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ