armv8_pmu_cycle_counter_el0
armv8_pmu_cycle_counter_el0 copied to clipboard
Got "illegal instruction" after insmod ko and read pmccntr_el0 in user-space application
@jerinjacobk I have cross-compiled your provided kernel-space code, and insmod it on my develop board, but I still got "illegal instruction", How could I fix it ?
I have typed lsmod command, it shown like below Module Size Used by pmu_el0_cycle_counter 16384 0
@peyer Are you running Linux perf application in parallel? . Share the kernel version, board name, cpu name and which instruction causing illegal instruction
I have captured all infomation like below
After loading module, I just use "asm volatile("mrs %0, pmccntr_el0" : "=r"(val));", which lead to illegal instruction. My board is Firefly-RK3399,
@jerinjacobk I also tried some other github project
- https://github.com/thoughtpolice/enable_arm_pmu
- https://github.com/XKCP/XKCP/blob/master/support/Kernel-PMU/enable_arm_pmu.c
- https://ilinuxkernel.com/?p=1755
Unfortunately, I still could not access pmccntr_el0 in my application.