This is an archive of the discontinued LLVM Phabricator instance.

Run address expression argument values through ABI::FixCodeAddress to strip TBI/pointer auth bytes on AArch64
ClosedPublic

Authored by jasonmolenda on Jan 12 2023, 12:58 PM.

Details

Summary

This is a different way of accomplishing the phab @DavidSpickett put up a few months ago, https://reviews.llvm.org/D136938 , which cleared these bits specifically for breakpoints in Target::GetBreakableLoadAddress.

I don't have an actual test case for this; this phabracator includes a test, but it actually won't run and I'm undecided about committing it (@JDevlieghere thinks landing a test that can't run any time soon is a bad idea). The llvm.org clang doesn't support generating the (not yet finalized) arm64e ABI on Darwin systems (ARMv8.3+ using a ptrauth ABI), although it can be forced to output a non-ptrauth codegen in an arm64e mach-o file. Even if the in-tree llvm.org clang could generate correct arm64e binaries, macOS won't allow you to run them without setting a boot-arg (-arm64e_preview_abi) on the test system & rebooting for it to be enabled. I included the test case in this phabracator to show an example of how it could be tested if these things weren't true. :)

Diff Detail

Event Timeline

jasonmolenda created this revision.Jan 12 2023, 12:58 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 12 2023, 12:58 PM
jasonmolenda requested review of this revision.Jan 12 2023, 12:58 PM

I am looking at this, just taking some time to get a PAC enabled environment going again. At first glance it seems like a better way to do things. I just want to run the test from my patch against this one.

I can port the test to AArch64 Linux though that's not much closer to being run on a bot either. At least these tests are pretty simple, less likely to rot in the meantime.
(we could do with a "qemu-system-aarch64 max features" bot but unlikely I'll have time to set one up)

JDevlieghere accepted this revision.Jan 19 2023, 4:07 PM

Someday I'd like to have a decorator that's a bit smarter and allows us to run these tests if the test compiler has ptrauth/PAC support and the host can run it. At least then these tests would automatically run for us (and maybe you) downstream. But with the current state of things this is as good as it gets.

lldb/source/Interpreter/OptionArgParser.cpp
161–162
This revision is now accepted and ready to land.Jan 19 2023, 4:07 PM