Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

riscv: add ISA extension parsing for Zilsd and Zclsd

Add parsing for Zilsd and Zclsd ISA extensions which were ratified in
commit f88abf1 ("Integrating load/store pair for RV32 with the
main manual") of the riscv-isa-manual.

Signed-off-by: Pincheng Wang <pincheng.plct@isrc.iscas.ac.cn>
Reviewed-by: Nutty Liu <nutty.liu@hotmail.com>
Link: https://patch.msgid.link/20250826162939.1494021-3-pincheng.plct@isrc.iscas.ac.cn
[pjw@kernel.org: cleaned up checkpatch issues, whitespace; updated to apply]
Signed-off-by: Paul Walmsley <pjw@kernel.org>

authored by

Pincheng Wang and committed by
Paul Walmsley
3f0cbfb8 4115155b

+26
+2
arch/riscv/include/asm/hwcap.h
··· 108 108 #define RISCV_ISA_EXT_ZICBOP 99 109 109 #define RISCV_ISA_EXT_SVRSW60T59B 100 110 110 #define RISCV_ISA_EXT_ZALASR 101 111 + #define RISCV_ISA_EXT_ZILSD 102 112 + #define RISCV_ISA_EXT_ZCLSD 103 111 113 112 114 #define RISCV_ISA_EXT_XLINUXENVCFG 127 113 115
+24
arch/riscv/kernel/cpufeature.c
··· 242 242 return -EPROBE_DEFER; 243 243 } 244 244 245 + static int riscv_ext_zilsd_validate(const struct riscv_isa_ext_data *data, 246 + const unsigned long *isa_bitmap) 247 + { 248 + if (IS_ENABLED(CONFIG_64BIT)) 249 + return -EINVAL; 250 + 251 + return 0; 252 + } 253 + 254 + static int riscv_ext_zclsd_validate(const struct riscv_isa_ext_data *data, 255 + const unsigned long *isa_bitmap) 256 + { 257 + if (IS_ENABLED(CONFIG_64BIT)) 258 + return -EINVAL; 259 + 260 + if (__riscv_isa_extension_available(isa_bitmap, RISCV_ISA_EXT_ZILSD) && 261 + __riscv_isa_extension_available(isa_bitmap, RISCV_ISA_EXT_ZCA)) 262 + return 0; 263 + 264 + return -EPROBE_DEFER; 265 + } 266 + 245 267 static int riscv_vector_f_validate(const struct riscv_isa_ext_data *data, 246 268 const unsigned long *isa_bitmap) 247 269 { ··· 506 484 __RISCV_ISA_EXT_DATA_VALIDATE(zcd, RISCV_ISA_EXT_ZCD, riscv_ext_zcd_validate), 507 485 __RISCV_ISA_EXT_DATA_VALIDATE(zcf, RISCV_ISA_EXT_ZCF, riscv_ext_zcf_validate), 508 486 __RISCV_ISA_EXT_DATA_VALIDATE(zcmop, RISCV_ISA_EXT_ZCMOP, riscv_ext_zca_depends), 487 + __RISCV_ISA_EXT_DATA_VALIDATE(zclsd, RISCV_ISA_EXT_ZCLSD, riscv_ext_zclsd_validate), 488 + __RISCV_ISA_EXT_DATA_VALIDATE(zilsd, RISCV_ISA_EXT_ZILSD, riscv_ext_zilsd_validate), 509 489 __RISCV_ISA_EXT_DATA(zba, RISCV_ISA_EXT_ZBA), 510 490 __RISCV_ISA_EXT_DATA(zbb, RISCV_ISA_EXT_ZBB), 511 491 __RISCV_ISA_EXT_DATA(zbc, RISCV_ISA_EXT_ZBC),