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

Entry state unspecified #13

Open
ghost opened this issue Feb 20, 2019 · 5 comments
Open

Entry state unspecified #13

ghost opened this issue Feb 20, 2019 · 5 comments

Comments

@ghost
Copy link

ghost commented Feb 20, 2019

I'd expect this specification to describe the initial state of the system. That is, when whatever is supposed to use the SBI starts executing the first time. It should specify the current privilege level (supervisor mode?), the register state (opensbi and bbl pass important parameters like hart ID and FDT address in registers), and the state of other harts (opensbi and bbl start all harts that jump to the payload at the same time, which I find... surprising).

Maybe this is intentional and this is supposed to be the concern of boot loader implementations. Even then, it might be a good idea to define basic defaults.

@aswaterman
Copy link

Yeah, this document certainly should state what can be assumed about the initial state. As you can see, it is rather incomplete.

@iamgreaser
Copy link

I've hit this point myself and it's kinda documented in a weird place, namely a file called mee-spec.md located in the Metal library: https://github.com/sifive/freedom-metal/blob/v201908-branch/doc/mee-spec.md#c-startup-interface

What's different from that, however, is that a2 appears to not be explicitly assigned to a "yes I've finished setting everything up" callback (at least on OpenSBI).

Would that be a suitable starting point for filling in the gaps here?

@repnop
Copy link

repnop commented Jun 3, 2022

Is there any desire to have some description of entry state specified now that version 1.0.0 has been ratified? While most projects seem like they'll be using OpenSBI or a custom in-house SBI, having some wording (or at least mention that the spec deliberately doesn't specify it) would be useful.

@axel-h
Copy link

axel-h commented Mar 21, 2023

Is there any update here? Does this basically fall down do the documents in https://github.com/riscv-software-src/opensbi/tree/master/docs/firmware that describe the supported payloads for the initial start and then it's up to what is passed to the SBI call "HART start" to start other cores.

@atishp04
Copy link
Collaborator

atishp04 commented Mar 27, 2023

SBI specification is just an interface specification between supervisor mode(S/VS) and its execution environment (M/HS mode). It should specify any entry state when entering or transitioning between those two only. The HSM/SUSP extension addresses the entry state requirement for that reason. The entry state of the system should be platform/firmware specific. Any firmware or platform specification probably is the right place to provide those information.

The OpenSBI doc is guidance for OpenSBI implementation specific. Other implementations may or may not follow that.

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

5 participants