hv: riscv add SBI interface to query machine IDs

Add wrapper functions to query machine vendor ID (mvendorid),
architecture ID (marchid), and implementation ID (mimpid) through
the SBI base extension.

These IDs identify the RISC-V processor vendor, microarchitecture,
and specific implementation respectively. The hypervisor needs to
retrieve these values from the underlying SBI firmware to forward
them to the Service VM via vSBI, allowing the Service VM to see
the actual hardware characteristics.

Tracked-On: #8851
Signed-off-by: Haoyu Tang <haoyu.tang@intel.com>
Acked-by: Wang Yu1 <yu1.wang@intel.com>
This commit is contained in:
Haoyu Tang
2025-09-23 10:56:59 +08:00
committed by Sun, Victor
parent 75a932eeab
commit 3b5847a67b
2 changed files with 65 additions and 0 deletions

View File

@@ -135,4 +135,7 @@ sbiret sbi_ecall(uint64_t arg0, uint64_t arg1, uint64_t arg2,
uint64_t arg3, uint64_t arg4, uint64_t arg5,
uint64_t func, uint64_t ext);
uint64_t sbi_get_mvendorid(void);
uint64_t sbi_get_marchid(void);
uint64_t sbi_get_mimpid(void);
#endif /* RISCV_SBI_H */