PMUSEREN & mainline kernel regression ?

Hi,

I am working on porting FD.io/VPP onto the Cortex Tegra K1, and I encountered a problem when using the mainline kernel (tested with 3.18.33 and 4.5.3)

I can NOT use the 3.10 kernel sources provided by nvidia as this specific application (wich is based on DPDK requires) requires hugepages.

In order to have access to the Performance Monitor in userspace (LP0), I have a simple kernel module which, at initialisation enable PMUSEREN.EN :

asm volatile("mcr p15, 0, %0, c9, c14, 0" :: "r"(1)); /* Enable user mode access */

In userspace, with another kernel than the one provided by nvidia, the bit is reset to 0 !
It is not a kernel problem, as this works with different kernel version on a RaspberryPi.

Some code:

Any idea ?
Thanks !

Good, I was finally able to figure out the problem :-)

In the functions cpu_v7_do_suspend/cpu_v7_do_resume ( arch/arm/mm/proc-v7.S ), the performance monitor registers were saved and restored in the kernel provided by nVidia !

Maybe the whole file has too many modifications to be upstreamed ‘as-is’ ?

Anyway, I modified the mainstream file to save/restore only the required registers.

Here are the 2 modified functions:

Hope this helps !