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

Anatoly Trosinenko via llvm-commits llvm-commits at lists.llvm.org
Mon May 12 02:19:02 PDT 2025


================
@@ -199,6 +200,11 @@ class ExegesisAArch64Target : public ExegesisTarget {
     PM.add(createAArch64ExpandPseudoPass());
   }
 
+  static long prctl_wrapper(int op, long arg2 = 0, long arg3 = 0, long arg4 = 0,
----------------
atrosinenko wrote:

@davemgreen @abhilash1910 The idea was to leverage C++ ability to specify the default argument values instead of passing zeros explicitly with an "unused" comment (and to convert variadic arguments to `long` along the way). It may be a good idea to explain this in a brief comment before `prctl_wrapper` (especially the conversion to `long`). By the way, `arg4` and `arg5` could probably be omitted for brevity, as this function is not a generic `prctl` wrapper anyway: for example, some non-PAuth `prctl` operations may involve [more complicated](https://man7.org/linux/man-pages/man2/PR_SET_NAME.2const.html) argument types.

Something along the lines:
```cpp
  // Converts variadic arguments to `long` and passes zeros for the unused
  // arg2-arg5, as tested by the Linux kernel.
  static long prctl_wrapper(int op, long arg2 = 0, long arg3 = 0) {
    return prctl(op, arg2, arg3, /*arg4=*/0L, /*arg5=*/0L);
  }
```

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


More information about the llvm-commits mailing list