How can I log unaligned memory accesses on Linux / aarch64 (Cortex-a57)?
I understand there are two different things involved here:
- Choosing to raise an interrupt from the cpu on an unaligned access (ie. interrupts for unaligned memory accesses that would otherwise be supported by the cpu at a performance cost)
- Choosing how to handle these interrupts in Linux (log them / fire a SIGBUS / soft emulate unaligned access)
My problem is that first, I do not know how to manage the cpu's control registers from my program (nor if I should actually do it in my userspace application), and second, the /proc/cpu/alignment
interface for managing the unaligned accesses in Linux seems to be gone (I am using a 4.4.0 kernel), see link below.
Managing unaligned accesses from the kernel: https://www.kernel.org/doc/Documentation/arm/mem_alignment (likely out-of-date)