About

The riscv_hwprobe syscall (0) allows userspace to probe hardware characteristics in a standardized manner. At this moment the syscall supports probe for:

  • mvendorid/marchid/mimpid
  • user visible behavior (rv32ima/rv64ima)
  • enabled extensions (some, more is being added)
  • hart performance information

Linux-user support for riscv_hwprobe will allow RISC-V binaries to fetch system/CPU capabilities on the fly instead of making assumptions inside the code.

(0) https://docs.kernel.org/riscv/hwprobe.html

Project Scope and Timelines

Initial addition to qemu linux-user waiting for kernel release.

Continued tracking kernel capabilities of known extensions is also needed, but not part of this task.

Components and Repos

Main repo: https://gitlab.com/qemu-project/qemu.git

Pending patch: https://lists.gnu.org/archive/html/qemu-devel/2023-06/msg03347.html

As more extensions are being to kernel we need to keep adding them to linux-user (again done outside of this task).

Currently: https://github.com/torvalds/linux/blob/master/arch/riscv/include/uapi/asm/hwprobe.h

Stakeholders and Partners

Other hw/riscv/virt.c contributors

Dependencies

Inclusion in a released kernel (included in 6.4, released 2023-06-25).

Qemu do not include syscalls not yet released.

Measure of Success

Patch integrated.

RISE Requirements

A program should not be able to determine if it's running in qemu linux-user or on bare metal by using riscv_hwprobe syscall.

Status

Development

COMPLETED

URL: NA

Development Timeline

2Q2023


Dependencies

None


Upstreaming

COMPLETED


Upstream Version

QEMU 8.1 (ETA August 23)


Contacts