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

Add SBI_ERR_FAILED to several functions #164

Closed
wants to merge 2 commits into from

Conversation

jones-drew
Copy link
Contributor

Many functions need SBI_ERR_FAILED with the generic "...failed for
unspecified or unknown other reasons" meaning since SBI implementations
can fail for many [SBI-specific] reasons and it's not reasonable to try
and enumerate them all. A quick audit found the main need is by
functions which take physical address parameters since SBI implementations
may fail on addresses which S-mode knows to be valid (per the platform's
memory layout and ISA), but are not valid for the specific SBI
implementation. Also during the quick audit one SSE function was
identified as needing SBI_ERR_FAILED since event injection has lots of
moving parts.

Event injection depends on platform-specific support which may
fail or any number of reasons. Provide a catch-all error to the
function which may be used in those cases.

Reviewed-by: Atish Patra <atishp@rivosinc.com>
Signed-off-by: Andrew Jones <ajones@ventanamicro.com>
Functions which take physical addresses return SBI_ERR_INVALID_ADDRESS
for address parameters or address parameter plus size parameter inputs
which result in invalid physical addresses with respect to the
platform's physical memory layout. Also provide these functions
SBI_ERR_FAILED which may be used for addresses that the specific SBI
implementation does not support. It should be less confusing to S-mode
to get a generic error than an invalid address error for addresses
which S-mode is sure are valid.

Also add a new specification to return SBI_ERR_INVALID_ADDRESS for
invalid physical addresses and non-normative text stating when
SBI_ERR_FAILED may be returned instead.

Signed-off-by: Andrew Jones <ajones@ventanamicro.com>
@atishp04
Copy link
Collaborator

Closing the PR as the patches are merged from the mailing list.

@atishp04 atishp04 closed this Sep 16, 2024
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

Successfully merging this pull request may close these issues.

2 participants