[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251009134318.23040-3-zihong.plct@isrc.iscas.ac.cn>
Date: Thu, 9 Oct 2025 21:41:52 +0800
From: Yao Zihong <zihong.plct@...c.iscas.ac.cn>
To: linux-riscv@...ts.infradead.org,
linux-kernel@...r.kernel.org
Cc: ajones@...tanamicro.com,
alexghiti@...osinc.com,
shuah@...nel.org,
samuel.holland@...ive.com,
evan@...osinc.com,
cleger@...osinc.com,
zihong.plct@...c.iscas.ac.cn,
zihongyao@...look.com,
zhangyin2018@...as.ac.cn,
Paul Walmsley <pjw@...nel.org>,
Palmer Dabbelt <palmer@...belt.com>,
Albert Ou <aou@...s.berkeley.edu>,
Alexandre Ghiti <alex@...ti.fr>,
Charlie Jenkins <charlie@...osinc.com>,
Jesse Taube <jesse@...osinc.com>,
Inochi Amaoto <inochiama@...il.com>,
Aleksa Paunovic <aleksa.paunovic@...cgroup.com>,
Thomas Weißschuh <thomas.weissschuh@...utronix.de>,
Yunhui Cui <cuiyunhui@...edance.com>,
Nam Cao <namcao@...utronix.de>
Subject: [PATCH v2 2/4] riscv: hwprobe: Report Zicbop presence and block size
Plumb Zicbop into 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 000f4451a9d8..7a6ae1327504 100644
--- a/arch/riscv/kernel/sys_hwprobe.c
+++ b/arch/riscv/kernel/sys_hwprobe.c
@@ -113,6 +113,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);
@@ -293,6 +294,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