Skip to content

Commit

Permalink
arm64: Fix purecap efi_rt_arch_call_nofault not preserving DAIF
Browse files Browse the repository at this point in the history
x16 is IP0, a call-clobbered register; call-preserved registers start at
x19, so use that and actually restore DAIF properly.

Fixes:	260b5a0 ("efirt: Shim AArch64 interface for pure-capability Morello kernels")
  • Loading branch information
jrtc27 committed Feb 2, 2025
1 parent cfcd2e5 commit a829658
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sys/arm64/arm64/efirt_support.S
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ ENTRY(efi_rt_arch_call_nofault)
* Temporarily disable all interrupts as we can't handle them whilst
* CSP is clobbered during the EFI call.
*/
mrs x16, daif
mrs x19, daif
msr daifset, #(DAIF_ALL)

/*
Expand All @@ -120,7 +120,7 @@ ENTRY(efi_rt_arch_call_nofault)
mov csp, c8

/* Restore interrupt mask */
msr daif, x16
msr daif, x19

/* Done with the almighty DDC */
msr ddc, czr
Expand Down

0 comments on commit a829658

Please sign in to comment.