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

Exploration on implementation of RFC #893. #980

Closed
wants to merge 5 commits into from

Conversation

JarlEvanson
Copy link
Contributor

  • The system table implementation is similar to pull request Extremely WIP, just for discussion: Add global system table pointer #905.
  • The boot services will have access to a BootHandle, which allows for reference counting accesses to boot services. This means that the safety of exit_boot_services, and other data structures relying on the current lifetime safety can switch to relying on the lifetime of a BootHandle.

@nicholasbishop
Copy link
Contributor

Thanks for putting this up! The reference count approach is interesting and definitely worth exploring.

I'm curious, do you have a project that makes use of the exit_boot_services transition? Something I've been struggling with in this design space is that the project I work on that makes use of uefi-rs is a bootloader that does not invoke exit_boot_services. For my project, that's handled by the OS it boots into (specifically the Linux kernel's EFI stub). So part of me can't help but think "let's just make exit_boot_services unsafe and leave it up to the caller to make sure it's not hanging on to any resources that aren't valid after exiting boot services". But of course that just shifts the safety burden away from this library, which is not a very satisfying answer. I'd love to see real code that calls exit_boot_services to get a better idea of how various API choices will impact things in the real world.

(Incidentally, just mentioning this for reference, there was an issue filed a bit ago that also explored an approach involving reference counting: #655.)

@JarlEvanson
Copy link
Contributor Author

I have a project currently in the works that will exit_boot_services, but it is not to the point where it actually does as such.

The concept doesn't seem to work in combination with the multiprocessor APIs. In particular, I've been running into issues with the two startup function when the timeout is non-null. Termination of the application processors messes up the reference count if they have a BootHandle when terminated. It doesn't seem actually unsafe, but it means that anyone using such a thing would have to forgo the safety provided by using reference counting BootHandles to provide a safe exit_boot_services.

Briefly looking over #655, I think it would run into the same issues as I am currently running into.

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.

None yet

2 participants