microsoft / mu_feature_mm_supv

Project Mu - Feature Repo - MM Supervisor
https://microsoft.github.io/mu
Other
48 stars 30 forks source link

Fix exception handling errors for supervisor #261

Closed kuqin12 closed 7 months ago

kuqin12 commented 7 months ago

Preface

Please ensure you have read the contribution docs prior to submitting the pull request. In particular, pull request guidelines.

Description

The current exception handling routine has 2 issues:

  1. When it comes to page fault, the miscellaneous exception handler will print the exception context and then hand off to the specific page fault handler, which will make the log appear as the system double fault.
  2. When the page fault exception occurs, the existing setup will switch the system to use a separate stack, which is hardcoded to be 4KB from the top of supervisor stack. This size is insufficient after switching to PageTableLib based page table attribute manipulations.

This change should fix both issues.

For each item, place an "x" in between [ and ] if true. Example: [x]. (you can also check items in the GitHub UI)

How This Was Tested

This change is tested on QEMU Q35 and verified bootable into UEFI shell.

Integration Instructions

N/A

codecov-commenter commented 7 months ago

Codecov Report

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

Project coverage is 0.47%. Comparing base (1bd76ee) to head (0622859).

Files Patch % Lines
MmSupervisorPkg/Core/Misc/SmmFuncsArch.c 0.00% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #261 +/- ## ======================================== - Coverage 0.47% 0.47% -0.01% ======================================== Files 144 144 Lines 22282 22287 +5 Branches 60 60 ======================================== Hits 105 105 - Misses 22172 22177 +5 Partials 5 5 ``` | [Flag](https://app.codecov.io/gh/microsoft/mu_feature_mm_supv/pull/261/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=microsoft) | Coverage Δ | | |---|---|---| | [MmSupervisorPkg](https://app.codecov.io/gh/microsoft/mu_feature_mm_supv/pull/261/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=microsoft) | `0.47% <0.00%> (-0.01%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=microsoft#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.