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

SecurityPkg: Optimization by moving PeiServicesLocatePpi outside loop #6074

Merged

Conversation

AshrafAliS
Copy link
Contributor

Description

This update refactors the code by moving the LocatePpi function call outside of the for loop where it was previously called repeatedly. By relocating the LocatePpi invocation outside of the loop, we can eliminate locating the same PPI again and again.

  • Breaking change?
    • Breaking change - Does this PR cause a break in build or boot behavior?
    • Examples: Does it add a new library class or move a module to a different repo.
  • Impacts security?
    • Security - Does this PR have a direct security impact?
    • Examples: Crypto algorithm change or buffer overflow fix.
  • Includes tests?
    • Tests - Does this PR include any explicit test code?
    • Examples: Unit tests or integration tests.

How This Was Tested

  • Code review testing.
  • Added qquivalent logic to EmulatorPkg and confirmed It doesn't cause issues.

Integration Instructions

N/A

@AshrafAliS AshrafAliS force-pushed the Remove_locating_shadow_ppi_multiple_times branch from b1c7469 to e4c6fb5 Compare August 16, 2024 08:12
This update refactors the code by moving the LocatePpi function call
outside of the for loop where it was previously called repeatedly.
By relocating the LocatePpi invocation outside of the loop,
we improve the efficiency of the code by avoiding redundant lookups.

Signed-off-by: Ashraf Ali <[email protected]>
@AshrafAliS AshrafAliS force-pushed the Remove_locating_shadow_ppi_multiple_times branch from e598d33 to b23b707 Compare September 2, 2024 07:48
@jyao1
Copy link
Contributor

jyao1 commented Sep 2, 2024

It seems good to me.

Would you please clarify that how you validate this patch ?

@AshrafAliS
Copy link
Contributor Author

It seems good to me.

Would you please clarify that how you validate this patch ?

i did the 2 level of validation from my side.

  1. replicating the same logic in the EmulatorPkg to see if there is any change in logic/flow. i verified that it it's not breaking anything.
  2. after applying the change, tested in the intel platform as well to make sure FV hashes are verified correctly.

@jyao1 jyao1 added the push Auto push patch series in PR if all checks pass label Sep 3, 2024
@mergify mergify bot merged commit cb9bdf3 into tianocore:master Sep 3, 2024
126 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
push Auto push patch series in PR if all checks pass
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants