[llvm] [llvm-exegesis][AArch64] Check for PAC keys before disabling them (PR #138643)

Oliver Hunt via llvm-commits llvm-commits at lists.llvm.org
Tue May 6 23:28:42 PDT 2025


================
@@ -207,15 +207,28 @@ class ExegesisAArch64Target : public ExegesisTarget {
 
     if (isPointerAuth(Opcode)) {
 #if defined(__aarch64__) && defined(__linux__)
+
+      // For some systems with existing PAC keys set, it is better to
+      // check the existing state of the key before setting it.
+      // For systems without PAC, this is a No-op but with PAC, it is
+      // safer to check the existing key state and then disable/enable them.
+      // Hence the guard placed for switching.
+      unsigned long pac_keys = 0;
----------------
ojhunt wrote:

@asl this is a linux pac question so I'm not sure if this is correct behavior and will leave it to you

I am curious though - this seems like a PAC behavior choice based on compile time process configuration rather than specified target info? Is this expected behavior (I don't understand how ptrauth works on linux)

https://github.com/llvm/llvm-project/pull/138643


More information about the llvm-commits mailing list