[llvm] [llvm-exegesis] [AArch64] Resolving "snippet crashed while running: Segmentation fault" for Load Instructions (PR #142552)
Lakshay Kumar via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 10 02:42:12 PDT 2025
lakshayk-nv wrote:
> For using --execution_mode=subprocess, this is about the minimum support needed.
>>
Added changes includes implementation of required functions (mmap, munmap and configurePerfCounter), saving auxiliary memory address to stack and temporary fix to load first register via mmap address and rest by setRegto as done previously, which resolve most AArch64 load instructions.
Moreover, I wanted to understand x86 implementation for Memory Annotation (from @boomanaiden154, as you owner/implementor of them)
Q1. Motivation behind munmap calls ?
Q2. How is File Descriptor being managed ?
Q2.1. mmap for manual snippet requires file descriptor at an offset to Aux Memory starting address.
([llvm/tools/llvm-exegesis/lib/Assembler.cpp:70](https://github.com/llvm/llvm-project/blob/main/llvm/tools/llvm-exegesis/lib/Assembler.cpp)
```
ET.getAuxiliaryMemoryStartAddress() + sizeof(int)(MemVal.Index + SubprocessMemory::AuxiliaryMemoryOffset`)
```
But file descriptor at this or any address seems not to populated i.e. No call for `__NR_perf_event_open` which init fd
Q2.2 Similarly for Auxiliary Memory requires `X86::RSI` to contain fd value. i.e. `RSI` is moved `ArgumentRegisters::AuxiliaryMemoryFD` which is used by mmap syscall.
Q3. File Descriptor for configurePerfCounter?
`configurePerfCounter` calls `SYS_ioctl` with file descriptor at `getAuxiliaryMemoryStartAddress()` but seeming not initialized.
https://github.com/llvm/llvm-project/pull/142552
More information about the llvm-commits
mailing list