riscv-software-src / riscv-software-src/opensbi
Detect extensions from $menvcfg
Open
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 1.5k
- Forks
- 712
- PR merge metrics
- No merged PRs in 30d
Description
Hi @avpatel,
Currently "Boot HART ISA Extensions" only shows extensions which can be detected by test and set their CSR. Maybe we can detect more extensions from $menvcfg?
static int hart_detect_features(struct sbi_scratch *scratch)
{
...
if (hfeatures->priv_version >= SBI_HART_PRIV_VER_1_12) {
csr_write(CSR_MENVCFG, ~0);
csr_read(CSR_MENVCFG, menvcfg_val);
if (menvcfg_val | ENVCFG_CBZE)
__sbi_hart_update_extension(hfeatures,
SBI_HART_EXT_ZICBOZ, true);
...
}
...
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in hart_detect_features and inspect the existing CSR_MENVCFG handling for privileged version 1.12 and the SBI_HART_EXT_ZICBOZ update. Identify which additional extensions can be reported from MENVCFG, then verify that the Boot HART ISA Extensions output reflects the detected features.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- operating-systems
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100