Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detect extensions from $menvcfg #324

Open
yong-xuan opened this issue Sep 1, 2023 · 2 comments
Open

Detect extensions from $menvcfg #324

yong-xuan opened this issue Sep 1, 2023 · 2 comments

Comments

@yong-xuan
Copy link
Contributor

yong-xuan commented Sep 1, 2023

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);
        ...
    }
    ...
}
@atishp04
Copy link
Collaborator

Generally, we should move away from WARL based detection mechanism as it will be unmanageable in the future with more number of extensions.

@yong-xuan
Copy link
Contributor Author

Hi @atishp04,
Thank you!
OpenSBI can detect extensions from the ISA string since d72f5f1. It appears that we can consider removing all extension detection within hart_detect_features()?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants