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)
commit512a5a6452b6d742b6f713184414d28cb6413080
tree615ee8b6154239f3a83fd5103db685f1172fe3a3
parent5223134029a87db925ecc9449f9501bad391a52e
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