Skip to content

Conversation

@AjanZhong
Copy link
Contributor

Separate Exception Stacks has been enabled by default in commit [1], in this case, TSS will be appended to original GDT.

As secondary bootloader, UniversalPayload solution has different boot flow from original EDK2. When DxeMain tries to append TSS after original GDT, the original GDT is empty. It leads to system reboot when DxeMain tries to install new GDT which is appended with TSS.

To fix this issue, set up temporary GDT with 64-bit code and data descriptors.

[1] cec2c6

Description

Separate Exception Stacks has been enabled, however, in original implementation, GDT has not been enabled yet for UniversalPayload, it leads to new GDT with TSS appended is illegal format for GDT.
Add temporary GDT for UniversalPayload x64 solution to ensure separated exception stack can be enabled successfully.

  • Breaking change?
    • Breaking change - Does this PR cause a break in build or boot behavior?
    • N/A
  • Impacts security?
    • Security - Does this PR have a direct security impact?
    • N/A
  • Includes tests?
    • Tests - Does this PR include any explicit test code?
    • N/A

How This Was Tested

Validated on UniversalPayload x64 solution on top of QEMU

Integration Instructions

N/A

Copy link

@shuoliu0-ocp shuoliu0-ocp left a comment

Choose a reason for hiding this comment

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

is this needed for non-fit boot path as well?

@AjanZhong
Copy link
Contributor Author

is this needed for non-fit boot path as well?

It should be. However, we have no validation environment for non-fit solution. Need members who are working on non-fit solution to double check whether non-fit solution has same issue.

@AjanZhong
Copy link
Contributor Author

@gguo11837463 @gdong1 @ChaselChiu Hi, would you mind help review this patch when you are available. Thanks.

Separate Exception Stacks has been enabled by default in
commit [1], in this case, TSS will be appended to original GDT.

As secondary bootloader, UniversalPayload solution has different
boot flow from original EDK2. When DxeMain tries to append TSS
after original GDT, the original GDT is empty. It leads to system
reboot when DxeMain tries to install new GDT which is appended with
TSS.

To fix this issue, set up temporary GDT with 64-bit code and data
descriptors.

[1] tianocore@cec2c6

Signed-off-by: Ajan Zhong <[email protected]>
Variable ChildBusAddress is not used in function ParsePciRootBridge, it
triggers build error on GCC version gcc version 13.3.0.

Remove this variable to fix build error.

Signed-off-by: Ajan Zhong <[email protected]>
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.

2 participants