Re-add Support for Rust <=1.93 Toolchains With Unsafe CPUID Instrinsics#84
Merged
Javagedes merged 1 commit intoOpenDevicePartnership:mainfrom Apr 1, 2026
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
9ace3af to
0b1e959
Compare
os-d
approved these changes
Mar 24, 2026
vineelko
approved these changes
Mar 24, 2026
Javagedes
reviewed
Mar 24, 2026
Javagedes
approved these changes
Mar 24, 2026
cfernald
approved these changes
Mar 24, 2026
cfernald
reviewed
Mar 24, 2026
makubacki
approved these changes
Mar 26, 2026
Collaborator
makubacki
left a comment
There was a problem hiding this comment.
@kouchekiniad, please add specific versions in the commit/PR message. It will be easier to understand now, but particularly in the future with versions explicitly stated.
0b1e959 to
3eda0ec
Compare
3eda0ec to
f8cd0c9
Compare
<=1.93 Toolchains With Unsafe CPUID Instrinsics
This change adds unsafe wrappers with `#[allow(unused_unsafe)]` around calls to __cpuid and __cpuid_count to simultaneously support Rust <= 1.93 toolchains that consider __cpuid unsafe and Rust >= 1.94 (or >= nightly-2025-12-27) toolchains that consider __cpuid safe.
f8cd0c9 to
180bf84
Compare
Javagedes
approved these changes
Apr 1, 2026
vineelko
approved these changes
Apr 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This change adds
unsafe { }wrappers around the__cpuidand__cpuid_countintrinsics, adding back support for Rust <= 1.93 toolchains where these are consideredunsafecalls. To prevent warnings about these wrappers being unnecessary on Rust >= 1.94 (or >=nightly-2025-12-27) toolchains, this change additionally adds#[allow(unused_unsafe)]declarations to the wrappers.How This Was Tested
Built Patina and Patina-MTRR; Ran tests with nightly and non-nightly toolchains.
Integration Instructions
n/a