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

Updating Errors to correctly use SEV API errors #228

Merged
merged 1 commit into from
Nov 4, 2024

Conversation

DGonzalezVillal
Copy link
Member

The AMD PSP provides defined SEV errors in the API with clear codes and mistakes. The library currently only bubbles up IO errors and not the correct SEV error when IOCTL calls fail. This commit rearranges the error file to use SEV errors correctly, and then changes the way IOCTL calls returns errors, so that the appropriate SEV error is bubbled up when an error is encountered.

src/error.rs Outdated Show resolved Hide resolved
src/error.rs Outdated Show resolved Hide resolved
src/firmware/host/mod.rs Outdated Show resolved Hide resolved
@DGonzalezVillal DGonzalezVillal force-pushed the firmware-error branch 3 times, most recently from 38eaae9 to 1e2c9b6 Compare September 12, 2024 17:11
src/error.rs Outdated Show resolved Hide resolved
larrydewey
larrydewey previously approved these changes Sep 12, 2024
Copy link
Contributor

@larrydewey larrydewey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

…TL calls to bubble correct errors

The AMD PSP provides defined SEV errors in the API with clear codes and
mistakes. The library currently only bubbles up IO errors and not the
correct SEV error when IOCTL calls fail. This commit rearranges the
error file to use SEV errors correctly, and then changes the way IOCTL
calls returns errors, so that the appropriate SEV error is bubbled up
when an error is encountered.

Guest IOCTL calls do not fail the same way host IOCTLS do. You need to
manually check for failures even if the ioctl function itself might not
return an error.

Signed-off-by: DGonzalezVillal <[email protected]>
@tylerfanelli
Copy link
Member

@larrydewey can you re-review?

@tylerfanelli tylerfanelli merged commit 0ec4e9e into virtee:main Nov 4, 2024
53 checks passed
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.

4 participants