May need to set test suite ARMv7 qemu environment into privilege mode to use `mrc`
Cuda-Chen opened this issue · 1 comments
Cuda-Chen commented
Currently I am porting _rdtsc
x86 intrinsic onto ARMv7.
On ARMv7 platform, usually we can access PMCCNTR
to get cycle count. In order to access this register, the program has to run in PL1 or high mode, or running in user mode when PMUSERENR
.EN == 1. However, the PMUSERENR
is set to zero in the test suite qemu environment and I can't change the value because the test suite qemu environment is running in user mode.
As such, I come up with the following two solutions, and I would like to know which solution is acceptable to this project:
- Set test suite qemu environment to privilege mode.
- Fallback to call syscall such as
gettimeofday()
if we can't set the value ofPMUSERENR
(in Linux kernel, this kind of syscall is able to accessPMCCNTR
).