[llvm] [llvm-exegesis] [AArch64] Resolving Illegal Instruction Error (PR #132346)

Sjoerd Meijer via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 24 10:52:23 PDT 2025


================
@@ -35,6 +35,14 @@ const ExegesisTarget *ExegesisTarget::lookup(Triple TT) {
   return nullptr;
 }
 
+static bool isPointerAuthOpcode(unsigned Opcode) {
+  return (Opcode >= 1648 && Opcode <= 1667); // AUT instruction class range
----------------
sjoerdmeijer wrote:

Hey @davemgreen , this is on Grace, which has the all the required extensions (and kernel modules).
I am able to successfully run the code example from the pointer auth [learning path](https://learn.arm.com/learning-paths/servers-and-cloud-computing/pac/example/). I see pauth instructions and everything runs fine.

Here's is a small reproducer that runs fine:

    extern "C" void kernel();
    asm(R"(
    .global kernel
    kernel:
        paciasp
        autiasp
        ret
    )");
    int main(void) {
      kernel();
      return 0;
    }
 
If you modify this, removes the signing and only authenticate this:
 
    asm(R"(
    .global kernel
    kernel:
        autiasp
        ret
    )");

Then you'll get an illegal instruction exception. At least, on Grace this is the observed behaviour. That's why I wrote these instructions need to come in pairs, but you're saying that the behaviour can be different on different platforms. Hmmmm, not ideal. But I think we do have a problem reliably testing these things, and on top of all of this, I don't think this is the right snippet to test it latency/throughput:

     0000000000000000 <foo>:
     0: f81f0ff6      str     x22, [sp, #-0x10]!
     4: d280000a      mov     x10, #0x0               // =0
     8: d2800016      mov     x22, #0x0               // =0. 
     c: dac11aca      autda   x10, x22
    10: f84107f6      ldr     x22, [sp], #0x10
    14: d65f03c0      ret

So, what do you think about disabling for now?
Or would you like to see a Grace specific workaround to disable this for now?





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


More information about the llvm-commits mailing list