Skip to content

Use cpuid instead of boot_cpu_has to check cpu features #133

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

Merged
merged 1 commit into from
Apr 20, 2021

Conversation

haitaohuang
Copy link
Contributor

For non-FLC platforms, Linux kernel 5.11 or above disables sgx feature flag
so boot_cpu_has is not usable.

Signed-off-by: Haitao Huang [email protected]

For non-FLC platforms, Linux kernel 5.11 or above disables sgx feature flag
so boot_cpu_has is not usable.

Signed-off-by: Haitao Huang <[email protected]>
Copy link
Contributor

@jbdelcuv jbdelcuv left a comment

Choose a reason for hiding this comment

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

It's always nice to use macros instead of constants.
Does it make sense that the SGX in-kernel driver disables the CPU feature bit on non-FLC platforms? Are you planning to submit a PR to change that behavior?

@haitaohuang
Copy link
Contributor Author

@jbdelcuv I'm told the kernel cpu feature bits only mean for those understood by kernel so no patches to kernel.
About macros, I think the code is easier to follow and for reader to verify correctness by just using straight numbers for cpu leaf and bits returned.

Copy link
Contributor

@jbdelcuv jbdelcuv left a comment

Choose a reason for hiding this comment

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

Thanks for the clarification.
Looks good to me.

@haitaohuang haitaohuang merged commit 2d2b795 into intel:master Apr 20, 2021
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