-
-
Notifications
You must be signed in to change notification settings - Fork 171
Check table version before calling UEFI 2.0+ functions #436
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
Check table version before calling UEFI 2.0+ functions #436
Conversation
c3e6f73
to
b3fe281
Compare
What platform is this relevant for? EFI 1.10 (the last EFI) only supports ia32 and ia64. ia64 is not supported by Rust or LLVM, and I don't know of a single 32-bit x86 device that uses EFI 1.10 or older. Also the crate is called |
b3fe281
to
ac443f2
Compare
Unfortunately some x86_64 machines use the ia32 mode of UEFI (for example some Intel Compute Sticks). The specific machines I had in mind with this change though are old (but not that old) Apple machines, which were stuck on EFI 1.10 for a long time. See torvalds/linux@f5390cd for example. |
ac443f2
to
3dc6c88
Compare
I knew about those, but they're all UEFI already, not stuck on EFI
I see. The mentioned Linux patch disables using 2.0 features on Apple hardware even when they're reported as supported. Should this be replicated here too then? As from what I understand without this the single platform this patch targets still won't work. |
Oops, I somehow edited your comment instead of replying, sorry about that. I believe I have restored your comment to its original form :)
For older Macs that report 1.10 this change will work fine, but you are right that for the MacBookPro16,1 described here it will still be broken. I don't think we have a way to check for system vendor here currently though. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything looks fine now 👍
Add constants for all the EFI versions (from section 4.3 "EFI System Table"). Also make the new/major/minor methods of Revision const.
The create_event_ex function (in boot services) and query_variable_info (in runtime services) were added to their respective tables in UEFI 2.0. In earlier versions these functions can't be called, so check the table revision before using these function pointers.
3dc6c88
to
ae47b34
Compare
The create_event_ex function (in boot services) and query_variable_info (in runtime services) were added to their respective tables in UEFI 2.0. In earlier versions these functions can't be called, so check the table revision before using these function pointers.