]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/powernv: Access LDBAR only if ultravisor disabled
authorClaudio Carvalho <cclaudio@linux.ibm.com>
Thu, 22 Aug 2019 03:48:37 +0000 (00:48 -0300)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 29 Aug 2019 23:40:16 +0000 (09:40 +1000)
commitd7b17ae67b70cc080b3866ecfd760dafb0dfe3f8
tree615ee8b6154239f3a83fd5103db685f1172fe3a3
parented16b2dc7c549cc97654e77af1a915304803e1f5
powerpc/powernv: Access LDBAR only if ultravisor disabled

LDBAR is a per-thread SPR populated and used by the thread-imc pmu
driver to dump the data counter into memory. It contains memory along
with few other configuration bits. LDBAR is populated and enabled only
when any of the thread imc pmu events are monitored.

In ultravisor enabled systems, LDBAR becomes ultravisor privileged and
an attempt to write to it will cause a Hypervisor Emulation Assistance
interrupt.

In ultravisor enabled systems, the ultravisor is responsible to maintain
the LDBAR (e.g. save and restore it).

This restricts LDBAR access to only when ultravisor is disabled.

Signed-off-by: Claudio Carvalho <cclaudio@linux.ibm.com>
Reviewed-by: Ram Pai <linuxram@us.ibm.com>
Reviewed-by: Ryan Grimm <grimm@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20190822034838.27876-7-cclaudio@linux.ibm.com
arch/powerpc/platforms/powernv/idle.c