AdvLoggerPkg/AdvancedFileLogger: Flush logs only once per reset - #923
AdvLoggerPkg/AdvancedFileLogger: Flush logs only once per reset#923liqiqiii wants to merge 1 commit into
Conversation
A capsule-armed reset converts a warm reset into a cold reset by issuing a second, nested ResetSystem() call. NvmExpressDxe shuts its controller down on the first reset notification (via the reset notification protocol, which fires after this platform-specific reset filter) and does not re-initialize it, so re-writing the logs on the nested reset issues I/O to a powered-down NVMe controller. This stalls for the full NVMe command timeout (~5 seconds) and logs a fatal NVMe WHEA telemetry record (EFI_IO_BUS_SCSI | EFI_IOB_EC_INTERFACE_ERROR, 0x02070005), and the log write ultimately fails with a timeout. Add a module-static latch so the in-memory log is flushed to media only once per reset sequence. Nested reset notifications early-return instead of re-writing to the already-shut-down controller. The normal ReadyToBoot / ExitBootServices / sync flush paths are unaffected. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: cccd4451-999f-4caf-bdb4-da35fd5bef85
✅ QEMU Validation PassedSource Dependencies
Results
Workflow run: https://github.com/microsoft/mu_plus/actions/runs/29968504342 This comment was automatically generated by the Mu QEMU PR Validation workflow. |
|
Has the unregister path been tested? What if, after the log was written, the notification function was unregistered? |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## release/202511 #923 +/- ##
================================================
Coverage ? 3.02%
================================================
Files ? 37
Lines ? 4332
Branches ? 73
================================================
Hits ? 131
Misses ? 4195
Partials ? 6
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Good catch Aaron, I will get some Intel secured core/non secured core devices tested as well. The secured core could be highly influence by this. |
Description
A capsule-armed reset converts a warm reset into a cold reset by issuing a second, nested
ResetSystem()call.NvmExpressDxeshuts its controller down on the first reset notification (via the reset notification protocol, which fires after this platform-specific reset filter) and does not re-initialize it, so re-writing the logs on the nested reset issues I/O to a powered-down NVMe controller. This stalls for the full NVMe command timeout (~5 seconds) and logs a fatal NVMe WHEA telemetry record(EFI_IO_BUS_SCSI | EFI_IOB_EC_INTERFACE_ERROR, 0x02070005), and the log write ultimately fails with a timeout.Add a module-static latch so the in-memory log is flushed to media only once per reset sequence. Nested reset notifications early-return instead of re-writing to the already-shut-down controller. The normal ReadyToBoot / ExitBootServices / sync flush paths are unaffected.
For details on how to complete these options and their meaning refer to CONTRIBUTING.md.
How This Was Tested
Tested with hardware, work as expected.