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

Support the platform specific event hooks which can be customized. #469

Closed

Conversation

Eathonhsu
Copy link

@Eathonhsu Eathonhsu commented Apr 17, 2024

Description

The current event triggers lack flexibility and cannot be effectively used on some platforms.

  1. Create hook functions at the end of dxe event before and after the event.
  2. Create a hook after the boot manager dispatch the deferred 3rd party images Event.
  • Impacts functionality?
    • Functionality - Does the change ultimately impact how firmware functions?
    • Examples: Add a new library, publish a new PPI, update an algorithm, ...
  • Impacts security?
    • Security - Does the change have a direct security impact on an application,
      flow, or firmware?
    • Examples: Crypto algorithm change, buffer overflow fix, parameter
      validation improvement, ...
  • Breaking change?
    • Breaking change - Will anyone consuming this change experience a break
      in build or boot behavior?
    • Examples: Add a new library class, move a module to a different repo, call
      a function in a new library class in a pre-existing module, ...
  • Includes tests?
    • Tests - Does the change include any explicit test code?
    • Examples: Unit tests, integration tests, robot tests, ...
  • Includes documentation?
    • Documentation - Does the change contain explicit documentation additions
      outside direct code modifications (and comments)?
    • Examples: Update readme file, add feature readme file, link to documentation
      on an a separate Web page, ...

How This Was Tested

It will not affect the original process, mainly serving as an extension for platform use.

Integration Instructions

Create a new library to be replaced by the platform to expand functionality.

@codecov-commenter
Copy link

codecov-commenter commented Apr 17, 2024

Codecov Report

Attention: Patch coverage is 0% with 17 lines in your changes are missing coverage. Please review.

Project coverage is 12.00%. Comparing base (cd7ce3e) to head (2cf4944).

Files Patch % Lines
.../BdsPlatformEventLibNull/BdsPlatformEventLibNull.c 0.00% 13 Missing ⚠️
...rePkg/Library/PlatformBootManagerLib/BdsPlatform.c 0.00% 4 Missing ⚠️
Additional details and impacted files
@@                Coverage Diff                 @@
##           release/202311     #469      +/-   ##
==================================================
- Coverage           12.01%   12.00%   -0.02%     
==================================================
  Files                 110      111       +1     
  Lines               19003    19019      +16     
  Branches             1735     1735              
==================================================
  Hits                 2283     2283              
- Misses              16674    16690      +16     
  Partials               46       46              
Flag Coverage Δ
MfciPkg 38.51% <ø> (ø)
MsCorePkg 1.42% <0.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Fixed ci build issue.
@apop5
Copy link
Contributor

apop5 commented Apr 18, 2024

@Eathonhsu can you please fill out the Description details?

@apop5 apop5 requested a review from kuqin12 April 18, 2024 04:12
@@ -41,11 +41,15 @@ ExitPmAuth (

DEBUG ((DEBUG_INFO, "ExitPmAuth ()- Start\n"));

BeforeEndOfDxeEventHook (); // MS_CHANGE
Copy link
Contributor

Choose a reason for hiding this comment

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

Since this is in MU_PLUS, we should not need to use MS_CHANGE tags in this PR.

//
// Since PI1.2.1, we need signal EndOfDxe as ExitPmAuth
//
EfiEventGroupSignal (&gEfiEndOfDxeEventGroupGuid);

AfterEndOfDxeEventHook (); // MS_CHANGE
Copy link
Contributor

Choose a reason for hiding this comment

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

What are the usage of these hooks?

Also, is the abstraction method better than the event signaling? i.e. line 49?

@apop5 @spbrogan thoughts?

Copy link
Author

Choose a reason for hiding this comment

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

In practical cases, we would use these hooks to send platform-specific events to enable the functionality to be activated properly.

Why I choose to use a library instead of send EventGroupSignal, the reason is that after the platform receives the event callback, the callback function will send its platform-specific events. I'm concerned about potential nesting of muti-events.

@Eathonhsu
Copy link
Author

@Eathonhsu can you please fill out the Description details?

Updated, thanks for the suggestion

@github-actions github-actions bot added the impact:breaking-change Requires integration attention label Apr 19, 2024
@apop5
Copy link
Contributor

apop5 commented Apr 19, 2024

@Eathonhsu can you please fill out the Description details?

Updated, thanks for the suggestion

I added the "breaking change" because this would require existing platforms to include a new library instance in their project to allow this to build.

Copy link

This PR has been automatically marked as stale because it has not had activity in 60 days. It will be closed if no further activity occurs within 7 days. Thank you for your contributions.

@github-actions github-actions bot added the state:stale Has not been updated in a long time label Jun 21, 2024
Copy link

This pull request has been automatically been closed because it did not have any activity in 60 days and no follow up within 7 days after being marked stale. Thank you for your contributions.

@github-actions github-actions bot closed this Jun 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
impact:breaking-change Requires integration attention state:stale Has not been updated in a long time
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants