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 new_unchecked API #21

Merged
merged 1 commit into from
Dec 17, 2023
Merged

Conversation

stefano-garzarella
Copy link
Contributor

In some scenarios we cannot use cpuid (e.g. for now in Coconut SVSM) or we want to force the use of rdrand and rdseed, so let's provide a new unsafe constructor.

@nagisa
Copy link
Owner

nagisa commented Dec 4, 2023

Is Coconut SVSM not its own target? For SGX we’ve adjusted plain fn new to not make any checks, but regardless I think it isn’t a terrible idea to provide an unchecked method.

src/lib.rs Show resolved Hide resolved
In some scenarios we cannot use `cpuid` (e.g. for now in Coconut SVSM)
or we want to force the use of `rdrand` and `rdseed`, so let's provide a
new unsafe constructor.

Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
@stefano-garzarella
Copy link
Contributor Author

Is Coconut SVSM not its own target?

I'm not sure if I get it.
Coconut SVSM is almost a firmware, e.g. we are using x86_64-unknown-none to build it. So I suppose it does not have its own target.

For SGX we’ve adjusted plain fn new to not make any checks,

Oh I see, IIUC in our case target_env is "".

but regardless I think it isn’t a terrible idea to provide an unchecked method.

Yeah, thanks!

@stefano-garzarella
Copy link
Contributor Author

@nagisa I updated this PR with your suggestions, please let me know if it is fine to be merged.

FYI I'll be off from Dec 18 to Jan 1.

@nagisa nagisa merged commit b4c39a3 into nagisa:master Dec 17, 2023
25 of 37 checks passed
@nagisa
Copy link
Owner

nagisa commented Dec 17, 2023

Published as 0.8.3

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