autiasp, autibsp instructions are the counterpart of paciasp/pacibsp instructions
therefore let's emit .cfi_negate_ra_state for these too.
In case of Armv8.3 instruction set the retaa/retbb will do the return and authentication
in one step here we can't emit the . cfi_negate_ra_state because that would be point after
the ret* instruction.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
(Slightly OT:
As my draft D109253 and D109254 show, aarch64 CFI is currently quite bad in prologue and epilogue code. Do we know how to fix that? :)
I realized that we have another issue: the uwtable IR attribute isn't sufficient to encode the different degree of unwind tables: (as an size optimization omitting most callee-saved-registers), -funwind-tables, -fasynchronous-unwind-tables.
)
Does this handle -homogeneous-prolog-epilog or adaptForLdStOpt correctly? If yes, is it necessary to improve test coverage when they are used together?
Note that v8.3 retaa performs the autiasp internally, but does not write back the resulting value to x30, so even if we could emit the CFI directive here, doing so would not be correct.
D111411 is also in the queue to improve the situation of the prologues.
Does this handle -homogeneous-prolog-epilog or adaptForLdStOpt correctly?
I don't know, need to check.
llvm/lib/Target/AArch64/AArch64InstrInfo.cpp | ||
---|---|---|
7182 |
fix a typo
Looks okay to me, based on a few tests that I modified to run with PAUTH.
It is a bit messy to run all tests with PAUTH, I can push a patch with additional test.
This causes unwind problems when landing pads of the exception handlers involved, because for those the .cfi_negate_ra_state is processed twice and the signature from the return address is not stripped but should be.
Let's reland after D114545.
Reopen to reflect the status that this has not been relanded.
I agree that we should re-consider this.