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

Define better error codes for TEE SBI calls #106

Open
abrestic-rivos opened this issue Sep 23, 2022 · 1 comment
Open

Define better error codes for TEE SBI calls #106

abrestic-rivos opened this issue Sep 23, 2022 · 1 comment
Assignees
Labels
spec Differences from the AP-TEE spec or changes requested from reviewing the spec.

Comments

@abrestic-rivos
Copy link
Collaborator

We've been mostly using the existing SBI error codes as defined in v1.0 of the spec, but the TEE API is much larger and more complex than any existing extension, and there are several cases where we're over-using e.g. INVALID_PARAM or INVALID_ADDRESS where we could be providing a more useful error code that would be more helpful while debugging.

Some possible examples of where we could do a better job:

  • OUT_OF_PAGES when the map_*_pages() calls fail due to being out page-table pages.
  • ALREADY_MAPPED or ALREADY_CONVERTED in the cases where a map or conversion operation (partially) specifies memory that was already mapped/converted.
  • error codes (e.g. NOT_RUNNABLE) to communicate that a vCPU or VM is not in the proper lifecycle state.
  • BUSY or IN_PROGRESS for operations that fail because it's already going on elsewhere, for example running a vCPU or initiating a fence.
  • UNSUPPORTED_PAGE_SIZE for operations that take page sizes and the requested page size isn't supported by the TSM

This has been coming up a bunch in the review of the spec doc at riscv-non-isa/riscv-ap-tee#5.

cc @rsahita @atulkharerivos @atishp04

@atulkharerivos atulkharerivos self-assigned this Sep 26, 2022
@atulkharerivos
Copy link
Contributor

SGTM; will take this up and the associated code changes.

@abrestic-rivos abrestic-rivos added the spec Differences from the AP-TEE spec or changes requested from reviewing the spec. label Sep 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
spec Differences from the AP-TEE spec or changes requested from reviewing the spec.
Projects
None yet
Development

No branches or pull requests

2 participants