[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 19 04:41:00 PDT 2025
================
@@ -199,6 +200,12 @@ class ExegesisAArch64Target : public ExegesisTarget {
PM.add(createAArch64ExpandPseudoPass());
}
+ // 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);
+ }
----------------
atrosinenko wrote:
> `State.getExegesisTarget().getOptions().AArch64DisablePACControl`
Do you propose asking the target whether we need to call `prctl` - something like "is the CPU has FEAT_FPAC"? If you just want to provide a command line option to the user, it should be enough to define a `static cl::opt<bool> AArch64DisablePacControl(/*...*/)` global variable like it is done [here](https://github.com/llvm/llvm-project/blob/c28d6c2f5fefa13e7c7efd245ace2698e47a494c/llvm/tools/llvm-exegesis/llvm-exegesis.cpp#L110) (here are [the docs](https://llvm.org/docs/CommandLine.html)).
https://github.com/llvm/llvm-project/pull/138643
More information about the llvm-commits
mailing list