[PATCH v2 0/4] riscv: hwprobe: Add Zicbop support

Yao Zihong posted 4 patches 4 months ago
There is a newer version of this series
Documentation/arch/riscv/hwprobe.rst          |   8 +-
arch/riscv/include/asm/hwprobe.h              |   2 +-
arch/riscv/include/uapi/asm/hwprobe.h         |   2 +
arch/riscv/kernel/sys_hwprobe.c               |   6 +
.../testing/selftests/riscv/hwprobe/Makefile  |   5 +-
.../selftests/riscv/hwprobe/prefetch.c        | 236 ++++++++++++++++++
6 files changed, 256 insertions(+), 3 deletions(-)
create mode 100644 tools/testing/selftests/riscv/hwprobe/prefetch.c
[PATCH v2 0/4] riscv: hwprobe: Add Zicbop support
Posted by Yao Zihong 4 months ago
Changes since v1:
------------------
- Bump RISCV_HWPROBE_MAX_KEY (modified 1/4).
- Add documentation for the Zicbop hwprobe bit/key (new 3/4).
- Add a selftest(prefetch.c) for Zicbop (new 4/4).

Add UAPI and kernel plumbing to expose the Zicbop extension presence
and its block size through hwprobe. The interface mirrors
Zicbom/Zicboz. This allows userspace to safely discover and optimize
for Zicbop when available.

Background: Zicbop is mandated by the RVA22U64 profile. Downstream may
combine the presence bit with ZICBOP_BLOCK_SIZE to make profile-level
policy decisions or enable Zicbop-specific optimizations.

Yao Zihong (4):
  uapi: riscv: hwprobe: Add Zicbop extension bit and block-size key
  riscv: hwprobe: Report Zicbop presence and block size
  docs: riscv: Document hwprobe for Zicbop
  selftests/riscv: Add Zicbop prefetch test

 Documentation/arch/riscv/hwprobe.rst          |   8 +-
 arch/riscv/include/asm/hwprobe.h              |   2 +-
 arch/riscv/include/uapi/asm/hwprobe.h         |   2 +
 arch/riscv/kernel/sys_hwprobe.c               |   6 +
 .../testing/selftests/riscv/hwprobe/Makefile  |   5 +-
 .../selftests/riscv/hwprobe/prefetch.c        | 236 ++++++++++++++++++
 6 files changed, 256 insertions(+), 3 deletions(-)
 create mode 100644 tools/testing/selftests/riscv/hwprobe/prefetch.c

-- 
2.47.2
Re: [PATCH v2 0/4] riscv: hwprobe: Add Zicbop support
Posted by Andrew Jones 4 months ago
On Thu, Oct 09, 2025 at 09:41:50PM +0800, Yao Zihong wrote:
> Changes since v1:
> ------------------
> - Bump RISCV_HWPROBE_MAX_KEY (modified 1/4).
> - Add documentation for the Zicbop hwprobe bit/key (new 3/4).
> - Add a selftest(prefetch.c) for Zicbop (new 4/4).
> 
> Add UAPI and kernel plumbing to expose the Zicbop extension presence
> and its block size through hwprobe. The interface mirrors
> Zicbom/Zicboz. This allows userspace to safely discover and optimize
> for Zicbop when available.
> 
> Background: Zicbop is mandated by the RVA22U64 profile. Downstream may
> combine the presence bit with ZICBOP_BLOCK_SIZE to make profile-level
> policy decisions or enable Zicbop-specific optimizations.
> 
> Yao Zihong (4):
>   uapi: riscv: hwprobe: Add Zicbop extension bit and block-size key
>   riscv: hwprobe: Report Zicbop presence and block size
>   docs: riscv: Document hwprobe for Zicbop
>   selftests/riscv: Add Zicbop prefetch test
> 
>  Documentation/arch/riscv/hwprobe.rst          |   8 +-
>  arch/riscv/include/asm/hwprobe.h              |   2 +-
>  arch/riscv/include/uapi/asm/hwprobe.h         |   2 +
>  arch/riscv/kernel/sys_hwprobe.c               |   6 +
>  .../testing/selftests/riscv/hwprobe/Makefile  |   5 +-
>  .../selftests/riscv/hwprobe/prefetch.c        | 236 ++++++++++++++++++
>  6 files changed, 256 insertions(+), 3 deletions(-)
>  create mode 100644 tools/testing/selftests/riscv/hwprobe/prefetch.c
> 
> -- 
> 2.47.2
>

I'm not sure why patches 1-3 aren't just squashed together like commit
eb1003970940 ("RISC-V: hwprobe: Expose Zicbom extension and its block
size") does for zicbom.

Thanks,
drew
Re: [PATCH v2 0/4] riscv: hwprobe: Add Zicbop support
Posted by Yao Zihong 3 months, 4 weeks ago
I found that there are a few different styles in the tree, but
following the Zicbom example would indeed be cleaner.

I’ll squash 1-3 together in v3 for simplicity and consistency.

Thanks,
Zihong