-
Notifications
You must be signed in to change notification settings - Fork 164
[REBASE&FF] ReportStatusCode: Always cache protocol before usage #1602
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
[REBASE&FF] ReportStatusCode: Always cache protocol before usage #1602
Conversation
afb96fb to
dbb5edc
Compare
MdeModulePkg/Library/DxeReportStatusCodeLib/ReportStatusCodeLib.c
Outdated
Show resolved
Hide resolved
ed956ed to
89ea636
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## release/202502 #1602 +/- ##
=================================================
Coverage ? 1.32%
=================================================
Files ? 802
Lines ? 306180
Branches ? 2120
=================================================
Hits ? 4051
Misses ? 302109
Partials ? 20
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
os-d
left a comment
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.
Can you take this to edk2, too?
ya, I will. Figured we wanted this here first though |
MdeModulePkg/Library/DxeReportStatusCodeLib/ReportStatusCodeLib.c
Outdated
Show resolved
Hide resolved
MdeModulePkg/Library/DxeReportStatusCodeLib/TestDxeReportStatusCodeLibTestApp.c
Outdated
Show resolved
Hide resolved
MdeModulePkg/Library/DxeReportStatusCodeLib/TestDxeReportStatusCodeLibTestApp.h
Outdated
Show resolved
Hide resolved
89ea636 to
3c7de8c
Compare
MdeModulePkg/Library/DxeReportStatusCodeLib/TestDxeReportStatusCodeLibTestApp.c
Show resolved
Hide resolved
b938184 to
27ce6c2
Compare
|
I have re-requested all reviews, as I have made a fundamental change to the pull request. |
27ce6c2 to
e7f73d1
Compare
fbd8e25 to
4994b4c
Compare
95f48c7 to
ccc6b80
Compare
663f9ac to
75c5980
Compare
This commit adds a UEFI_APPLICATION unit test for DxeReportStatusCodeLib that ensures that the platform does not invert the TPL on an initial call to ReportStatusCode functionality. This functionality has the potential to invert the TPL due to the fact that on an initial call to report status code functionality, if the EFI_STATUS_CODE protocal has not been located, it will attempt to locate it. LocateProtocol performs a tpl raise to EFI_NOTIFY. If the caller of ReportStatusCode is in a TPL higher then EFI_NOTIFY, we will invert the TPL and assert.
This commit stops the library for querying the protocol database for the status code protocol at the time of use of the library function. This logic can result in a TPL inversion if the protocol has not yet been located and the caller is running in a TPL higher then TPL_NOTIFY. Instead, the protocol is now located during construction of the library during driver startup. If the protocol is not found, then an on-protocol install event is registered. A deconstructor is also added to close the event in the case that the driver is unloaded before the protocol is installed.
This commit stops the library for querying the protocol database for the status code protocol at the time of use of the library function. This logic can result in a TPL inversion if the protocol has not yet been located and the caller is running in a TPL higher then TPL_NOTIFY. Instead, the protocol is now located during construction of the library during driver startup. If the protocol is not found, then an on-protocol install event is registered. A deconstructor is also added to close the event in the case that the driver is unloaded before the protocol is installed.
75c5980 to
4ebfdfd
Compare
Description
This commit stops the library for querying the protocol database for the
status code protocol at the time of use of the library function. This
logic can result in a TPL inversion if the protocol has not yet been
located and the caller is running in a TPL higher then TPL_NOTIFY.
Instead, the protocol is now located during construction of the library
during driver startup. If the protocol is not found, then an on-protocol
install event is registered. A deconstructor is also added to close the
event in the case that the driver is unloaded before the protocol is
installed.
This PR is a rebase and fast forward as it includes a new test.
How This Was Tested
Integration Instructions
N/A