Hi All,
Have anyone tried to test single step exception with ARM64 on Qemu? I
was testing ARM64 uprobe patches[1] with qemu and I noticed that it does
not generate single step exception. I also tried kprobe[2], which uses
single step exception and it does not work. However, these code works
fine with real silicon.
Test case can be summarized as under:
1. After kernel code is executed, it programs ELR_EL1 with the address
of instruction which is to be single stepped. Lets say 0x7ffffff004 is
the address of instruction which is to be single stepped. So, ELR_EL1
has been programmed with 0x7ffffff004.
2. MDSCR_EL1.SS is set to 1
3. ERET has been called to execute instruction to be single stepped.
With Qemu, I always see
undefined instruction: pc=0000007ffffff008
Code: bad PC value
It seems that Qemu could not notice MDSCR_EL1.SS = 1 and since, kernel
had written a single valid instruction at location 0x7ffffff004, so it
raised an undefined exception while executing next invalid instruction.
My Qemu version is:
QEMU emulator version 2.1.2, Copyright (c) 2003-2008 Fabrice Bellard
You may use code in [3] to test single steping.
Please let me know, if any more input is needed to reproduce it.
~Pratyush
[1] https://lkml.org/lkml/2014/12/31/151
[2] https://lkml.org/lkml/2014/11/18/33
[3] https://github.com/pratyushanand/linux.git:ml_arm64_uprobe_devel_v2