cpuid icon indicating copy to clipboard operation
cpuid copied to clipboard

Support RISC-V

Open come-maiz opened this issue 9 months ago • 3 comments

Please support the RISC-V processors in this project.

I'm looking at supporting open architectures in Ethereum software, a necessary step for transparency and decentralization. Prysm uses cpuid in https://github.com/prysmaticlabs/gohashtree to select optimizations implemented in assembly.

come-maiz avatar Mar 21 '25 15:03 come-maiz

@come-maiz Do you have reference documentation? Also, do you have hardware where it would be possible to test implementations?

klauspost avatar Mar 21 '25 18:03 klauspost

Yes, and yes. I'm documenting my exploration here: https://collective.flashbots.net/t/risc-v/4793

I'm right now figuring out why if I add:

//go:build riscv64

to detect_riscv.go, it still doesn't see the functions I define there. I'm testing this in a RISC-V QEMU. I haven't programmed in a while, so this will require patience :)

come-maiz avatar Mar 21 '25 19:03 come-maiz

This is my humble approach to read hwprobe:

https://github.com/come-maiz/cpuid/blob/riscv/os_linux_riscv64.go

If you want to guide me, I can continue working on it and make a pull request :)

come-maiz avatar Mar 22 '25 05:03 come-maiz