-
Notifications
You must be signed in to change notification settings - Fork 104
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
base: master
Are you sure you want to change the base?
Conversation
nrspruit
commented
Feb 26, 2025
- 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.
dbe5e16
to
0276d13
Compare
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.
Looks ok to me, let's get one more review.
source/loader/ze_ldrddi.cpp
Outdated
@@ -55,6 +55,10 @@ namespace loader | |||
|
|||
uint32_t total_driver_handle_count = 0; | |||
|
|||
if (!loader::context->coredriverSortingCompleted) { |
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.
what if zeDriverGet
is called again within driverSorting
function?
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.
Fixed in latest, the recursion is now prevented.
1ac4a8f
to
e2d5fdd
Compare
- 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]>
Signed-off-by: Neil R. Spruit <[email protected]>
Signed-off-by: Neil R. Spruit <[email protected]>
Signed-off-by: Neil R. Spruit <[email protected]>
…rting once Signed-off-by: Neil R. Spruit <[email protected]>
e2d5fdd
to
5e2e830
Compare