-
Notifications
You must be signed in to change notification settings - Fork 14.3k
Revert "[llvm-exegesis][AArch64] Disable pauth and ldgm as unsupported instructions fixed (#136868)" #142382
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…d instructions fixed (llvm#136868)" This reverts commit 475531b. But it does not revert the changes from commits 36850a0 and 5dc3cd0.
@llvm/pr-subscribers-tools-llvm-exegesis Author: Tulio Magno Quites Machado Filho (tuliom) ChangesThis reverts commit 475531b. But it does not revert the changes from commits Full diff: https://github.com/llvm/llvm-project/pull/142382.diff 2 Files Affected:
diff --git a/llvm/test/tools/llvm-exegesis/AArch64/skip_unsupported_instructions.s b/llvm/test/tools/llvm-exegesis/AArch64/skip_unsupported_instructions.s
deleted file mode 100644
index 72009756ed1d5..0000000000000
--- a/llvm/test/tools/llvm-exegesis/AArch64/skip_unsupported_instructions.s
+++ /dev/null
@@ -1,14 +0,0 @@
-llvm/test/tools/llvm-exegesis/AArch64/skip_unsupported_instructions.s
-
-# TODO: This is failing on some systems that have hardware support for
-# pointer authentication. This needs to be fixed before reenabling.
-# REQUIRES: disabled
-
-# REQUIRES: aarch64-registered-target
-
-# Check for skipping of illegal instruction errors (AUT and LDGM)
-# RUN: llvm-exegesis -mcpu=neoverse-v2 -mode=latency --opcode-name=AUTIA --benchmark-phase=assemble-measured-code 2>&1 | FileCheck %s --check-prefix=CHECK-AUTIA
-# CHECK-AUTIA-NOT: snippet crashed while running: Illegal instruction
-
-# RUN: llvm-exegesis -mcpu=neoverse-v2 -mode=latency --opcode-name=LDGM --benchmark-phase=assemble-measured-code 2>&1 | FileCheck %s --check-prefix=CHECK-LDGM
-# CHECK-LDGM: LDGM: Unsupported opcode: load tag multiple
diff --git a/llvm/tools/llvm-exegesis/lib/AArch64/Target.cpp b/llvm/tools/llvm-exegesis/lib/AArch64/Target.cpp
index a1eb5a46f21fc..d6f4c5220f71d 100644
--- a/llvm/tools/llvm-exegesis/lib/AArch64/Target.cpp
+++ b/llvm/tools/llvm-exegesis/lib/AArch64/Target.cpp
@@ -12,12 +12,6 @@
#if defined(__aarch64__) && defined(__linux__)
#include <linux/prctl.h> // For PR_PAC_* constants
#include <sys/prctl.h>
-#ifndef PR_PAC_SET_ENABLED_KEYS
-#define PR_PAC_SET_ENABLED_KEYS 60
-#endif
-#ifndef PR_PAC_GET_ENABLED_KEYS
-#define PR_PAC_GET_ENABLED_KEYS 61
-#endif
#ifndef PR_PAC_APIAKEY
#define PR_PAC_APIAKEY (1UL << 0)
#endif
@@ -38,47 +32,6 @@
namespace llvm {
namespace exegesis {
-bool isPointerAuth(unsigned Opcode) {
- switch (Opcode) {
- default:
- return false;
-
- // FIXME: Pointer Authentication instructions.
- // We would like to measure these instructions, but they can behave
- // differently on different platforms, and maybe the snippets need to look
- // different for these instructions,
- // Platform-specific handling: On Linux, we disable authentication, may
- // interfere with measurements. On non-Linux platforms, disable opcodes for
- // now.
- case AArch64::AUTDA:
- case AArch64::AUTDB:
- case AArch64::AUTDZA:
- case AArch64::AUTDZB:
- case AArch64::AUTIA:
- case AArch64::AUTIA1716:
- case AArch64::AUTIASP:
- case AArch64::AUTIAZ:
- case AArch64::AUTIB:
- case AArch64::AUTIB1716:
- case AArch64::AUTIBSP:
- case AArch64::AUTIBZ:
- case AArch64::AUTIZA:
- case AArch64::AUTIZB:
- return true;
- }
-}
-
-bool isLoadTagMultiple(unsigned Opcode) {
- switch (Opcode) {
- default:
- return false;
-
- // Load tag multiple instruction
- case AArch64::LDGM:
- return true;
- }
-}
-
static unsigned getLoadImmediateOpcode(unsigned RegBitWidth) {
switch (RegBitWidth) {
case 32:
@@ -198,35 +151,6 @@ class ExegesisAArch64Target : public ExegesisTarget {
// Function return is a pseudo-instruction that needs to be expanded
PM.add(createAArch64ExpandPseudoPass());
}
-
- const char *getIgnoredOpcodeReasonOrNull(const LLVMState &State,
- unsigned Opcode) const override {
- if (const char *Reason =
- ExegesisTarget::getIgnoredOpcodeReasonOrNull(State, Opcode))
- return Reason;
-
- if (isPointerAuth(Opcode)) {
-#if defined(__aarch64__) && defined(__linux__)
- // Disable all PAC keys. Note that while we expect the measurements to
- // be the same with PAC keys disabled, they could potentially be lower
- // since authentication checks are bypassed.
- if (prctl(PR_PAC_SET_ENABLED_KEYS,
- PR_PAC_APIAKEY | PR_PAC_APIBKEY | PR_PAC_APDAKEY |
- PR_PAC_APDBKEY, // all keys
- 0, // disable all
- 0, 0) < 0) {
- return "Failed to disable PAC keys";
- }
-#else
- return "Unsupported opcode: isPointerAuth";
-#endif
- }
-
- if (isLoadTagMultiple(Opcode))
- return "Unsupported opcode: load tag multiple";
-
- return nullptr;
- }
};
} // namespace
|
Copying some folks from PR #136868 : This commit is still causing issues in |
Hi @tuliom , is the opcode test also crashing with the commit ? |
@@ -12,12 +12,6 @@ | |||
#if defined(__aarch64__) && defined(__linux__) | |||
#include <linux/prctl.h> // For PR_PAC_* constants |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you also remove this header due to #139443
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@abhilash1910 I believe that would require to also revert 36850a0 and 5dc3cd0 because they depend on this header.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this header is duplicated in sys/prctl.h ; but sure we can keep it and remove safely in my PR. Thanks
Yes, it is. However it doesn't give too much information.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm in favor of reverting this. The test has been failing for over a month, and I think it's better to revert while the fix is still being worked on.
…d instructions fixed (llvm#136868)" (llvm#142382) This reverts commit 475531b. But it does not revert the changes from commits 36850a0 and 5dc3cd0.
…d instructions fixed (llvm#136868)" (llvm#142382) This reverts commit 475531b. But it does not revert the changes from commits 36850a0 and 5dc3cd0.
…d instructions fixed (llvm#136868)" (llvm#142382) This reverts commit 475531b. But it does not revert the changes from commits 36850a0 and 5dc3cd0.
This reverts commit 475531b. But it does not revert the changes from commits
36850a0 and
5dc3cd0.