riscv-software-src / riscv-software-src/opensbi

Detect extensions from $menvcfg

Open
#324 2 comments 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.