|
28 | 28 | #endif // HAVE_LIBPFM
|
29 | 29 | #include <linux/prctl.h> // For PR_PAC_* constants
|
30 | 30 | #include <sys/prctl.h>
|
31 |
| -#ifndef PR_PAC_SET_ENABLED_KEYS |
32 |
| -#define PR_PAC_SET_ENABLED_KEYS 60 |
33 |
| -#endif |
34 |
| -#ifndef PR_PAC_GET_ENABLED_KEYS |
35 |
| -#define PR_PAC_GET_ENABLED_KEYS 61 |
36 |
| -#endif |
37 | 31 | #ifndef PR_PAC_APIAKEY
|
38 | 32 | #define PR_PAC_APIAKEY (1UL << 0)
|
39 | 33 | #endif
|
|
54 | 48 | namespace llvm {
|
55 | 49 | namespace exegesis {
|
56 | 50 |
|
57 |
| -bool isPointerAuth(unsigned Opcode) { |
58 |
| - switch (Opcode) { |
59 |
| - default: |
60 |
| - return false; |
61 |
| - |
62 |
| - // FIXME: Pointer Authentication instructions. |
63 |
| - // We would like to measure these instructions, but they can behave |
64 |
| - // differently on different platforms, and maybe the snippets need to look |
65 |
| - // different for these instructions, |
66 |
| - // Platform-specific handling: On Linux, we disable authentication, may |
67 |
| - // interfere with measurements. On non-Linux platforms, disable opcodes for |
68 |
| - // now. |
69 |
| - case AArch64::AUTDA: |
70 |
| - case AArch64::AUTDB: |
71 |
| - case AArch64::AUTDZA: |
72 |
| - case AArch64::AUTDZB: |
73 |
| - case AArch64::AUTIA: |
74 |
| - case AArch64::AUTIA1716: |
75 |
| - case AArch64::AUTIASP: |
76 |
| - case AArch64::AUTIAZ: |
77 |
| - case AArch64::AUTIB: |
78 |
| - case AArch64::AUTIB1716: |
79 |
| - case AArch64::AUTIBSP: |
80 |
| - case AArch64::AUTIBZ: |
81 |
| - case AArch64::AUTIZA: |
82 |
| - case AArch64::AUTIZB: |
83 |
| - return true; |
84 |
| - } |
85 |
| -} |
86 |
| - |
87 |
| -bool isLoadTagMultiple(unsigned Opcode) { |
88 |
| - switch (Opcode) { |
89 |
| - default: |
90 |
| - return false; |
91 |
| - |
92 |
| - // Load tag multiple instruction |
93 |
| - case AArch64::LDGM: |
94 |
| - return true; |
95 |
| - } |
96 |
| -} |
97 |
| - |
98 | 51 | static unsigned getLoadImmediateOpcode(unsigned RegBitWidth) {
|
99 | 52 | switch (RegBitWidth) {
|
100 | 53 | case 32:
|
@@ -330,36 +283,6 @@ class ExegesisAArch64Target : public ExegesisTarget {
|
330 | 283 | PM.add(createAArch64ExpandPseudoPass());
|
331 | 284 | }
|
332 | 285 |
|
333 |
| - const char *getIgnoredOpcodeReasonOrNull(const LLVMState &State, |
334 |
| - unsigned Opcode) const override { |
335 |
| - if (const char *Reason = |
336 |
| - ExegesisTarget::getIgnoredOpcodeReasonOrNull(State, Opcode)) |
337 |
| - return Reason; |
338 |
| - |
339 |
| - if (isPointerAuth(Opcode)) { |
340 |
| -#if defined(__aarch64__) && defined(__linux__) |
341 |
| - // Disable all PAC keys. Note that while we expect the measurements to |
342 |
| - // be the same with PAC keys disabled, they could potentially be lower |
343 |
| - // since authentication checks are bypassed. |
344 |
| - if (prctl(PR_PAC_SET_ENABLED_KEYS, |
345 |
| - PR_PAC_APIAKEY | PR_PAC_APIBKEY | PR_PAC_APDAKEY | |
346 |
| - PR_PAC_APDBKEY, // all keys |
347 |
| - 0, // disable all |
348 |
| - 0, 0) < 0) { |
349 |
| - return "Failed to disable PAC keys"; |
350 |
| - } |
351 |
| -#else |
352 |
| - return "Unsupported opcode: isPointerAuth"; |
353 |
| -#endif |
354 |
| - } |
355 |
| - |
356 |
| - if (isLoadTagMultiple(Opcode)) |
357 |
| - return "Unsupported opcode: load tag multiple"; |
358 |
| - |
359 |
| - return nullptr; |
360 |
| - } |
361 |
| -}; |
362 |
| - |
363 | 286 | } // namespace
|
364 | 287 |
|
365 | 288 | #ifdef __linux__
|
|
0 commit comments