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

Fix driver sorting given driver failures and instrumentation #288

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

nrspruit
Copy link
Contributor

  • To avoid issues when sorting of the drivers can cause an invalid call during instrumentation after driver failures, then the driver sorting has been moved to occur during the call to zeDriverGet or zeinitDrivers.
  • In addition, the driver type is not init to UINT32_MAX in the enum such that all failing drivers are forced to the back of the sorted list.

@nrspruit nrspruit requested a review from rwmcguir February 26, 2025 16:05
@nrspruit nrspruit force-pushed the delay_driver_sorting branch 2 times, most recently from dbe5e16 to 0276d13 Compare February 26, 2025 16:43
rwmcguir
rwmcguir previously approved these changes Feb 26, 2025
Copy link
Contributor

@rwmcguir rwmcguir left a comment

Choose a reason for hiding this comment

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

Looks ok to me, let's get one more review.

@@ -55,6 +55,10 @@ namespace loader

uint32_t total_driver_handle_count = 0;

if (!loader::context->coredriverSortingCompleted) {
Copy link
Contributor

Choose a reason for hiding this comment

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

what if zeDriverGet is called again within driverSorting function?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in latest, the recursion is now prevented.

@nrspruit nrspruit force-pushed the delay_driver_sorting branch 3 times, most recently from 1ac4a8f to e2d5fdd Compare February 28, 2025 16:03
nrspruit added 5 commits March 3, 2025 15:12
- To avoid issues when sorting of the drivers can cause an invalid call
  during instrumentation after driver failures, then the driver sorting
has been moved to occur during the call to zeDriverGet or zeinitDrivers.
- In addition, the driver type is not init to UINT32_MAX in the enum
  such that all failing drivers are forced to the back of the sorted
list.

Signed-off-by: Neil R. Spruit <[email protected]>
@nrspruit nrspruit force-pushed the delay_driver_sorting branch from e2d5fdd to 5e2e830 Compare March 3, 2025 23:12
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.

3 participants