Skip to content

Commit 635c646

Browse files
Update llvm/tools/llvm-exegesis/lib/AArch64/Target.cpp
Co-authored-by: Anatoly Trosinenko <[email protected]>
1 parent 079d268 commit 635c646

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

llvm/tools/llvm-exegesis/lib/AArch64/Target.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -232,13 +232,13 @@ class ExegesisAArch64Target : public ExegesisTarget {
232232
// be the same with PAC keys disabled, they could potentially be lower
233233
// since authentication checks are bypassed.
234234
if ((long)PacKeys != 0) {
235-
if (prctl_wrapper(PR_PAC_SET_ENABLED_KEYS,
236-
PR_PAC_APIAKEY | PR_PAC_APIBKEY | PR_PAC_APDAKEY |
237-
PR_PAC_APDBKEY, // all keys
238-
0, // disable all
239-
0, // unused
240-
0) // unused
241-
< 0) {
235+
// Operate on all keys.
236+
const long KeysToControl =
237+
PR_PAC_APIAKEY | PR_PAC_APIBKEY | PR_PAC_APDAKEY | PR_PAC_APDBKEY;
238+
// Disable all.
239+
const long EnabledBitMask = 0;
240+
if (prctl_wrapper(PR_PAC_SET_ENABLED_KEYS, KeysToControl,
241+
EnabledBitMask) < 0) {
242242
return "Failed to disable PAC keys";
243243
}
244244
}

0 commit comments

Comments
 (0)