Skip to content

[REBASE & FF] Follow AAPCS in AArch64 Exception Handler - #1914

Merged
os-d merged 2 commits into
OpenDevicePartnership:mainfrom
os-d:aapcs_exception
Oct 23, 2026
Merged

os-d merged 2 commits into
OpenDevicePartnership:mainfrom
os-d:aapcs_exception

Conversation

@os-d

@os-d os-d commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

Description

AArch64 stacktrace: Fix Stack Unwind

The current AArch64 stack trace calculated the new FP/LR but it didn't return them and so the upper level function would see the PC didn't change and stop walking the stack. This would not process past the common exception handler. With this fix, the stack is walked back to the Patina entry point.

Follow AAPCS in AArch64 Exception Handler

edk2 updated the AArch64 exception handler in tianocore/edk2#13007 to follow AAPCS. The Patina one was based on the edk2 exception handler, so this updates it to also ensure AAPCS is followed.

This doesn't affect HW or SW debuggers or the stacktrace, but it can affect crash dumps, which patina does not currently support, but may in the future.

  • Impacts functionality?
  • Impacts security?
  • Breaking change?
  • Includes tests?
  • Includes documentation?

How This Was Tested

Tested on QemuArmVirt with the QEMU debugger, Patina debugger, and with the stack trace.

Integration Instructions

N/A.

os-d added 2 commits October 23, 2026 09:59
The current AArch64 stack trace calculated the new FP/LR but
it didn't return them and so the upper level function would
see the PC didn't change and stop walking the stack. This would
not process past the common exception handler. With this fix,
the stack is walked back to the Patina entry point.

Signed-off-by: Oliver Smith-Denny <osde@microsoft.com>
edk2 updated the AArch64 exception handler in
tianocore/edk2#13007 to follow
AAPCS. The Patina one was based on the edk2 exception
handler, so this updates it to also ensure AAPCS is
followed.

This doesn't affect HW or SW debuggers or the stacktrace,
but it can affect crash dumps, which patina does not currently
support, but may in the future.

Signed-off-by: Oliver Smith-Denny <osde@microsoft.com>
@os-d
os-d requested review from cfernald, kuqin12 and vineelko October 23, 2026 17:09
@patina-automation

patina-automation Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

✅ QEMU Validation Passed

All QEMU validation jobs completed successfully.

Note: Q35 is only built on Windows hosts (QEMU boot is disabled due to a QEMU vfat issue).

Workflow run: https://github.com/OpenDevicePartnership/patina/actions/runs/39994716189

Boot Time to EFI Shell

Platform Elapsed
ArmVirt (Linux Host) 29.0s
Q35 (Linux Host) 34.1s

Dependencies

Repository Ref
patina 8800653
patina-dxe-core-qemu 28cfae7
patina-fw-patcher 5e02eb7
patina-qemu firmware v4.1.3
patina-qemu build script 500fcf6

This comment was automatically generated by the Patina QEMU PR Validation Post workflow.

@codecov

codecov Bot commented Oct 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@os-d
os-d enabled auto-merge (rebase) October 23, 2026 17:20
@os-d
os-d merged commit 4a4f95a into OpenDevicePartnership:main Oct 23, 2026
11 checks passed
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.

3 participants