powerpc/64s: Always set PMU control registers to frozen/disabled when not in use
authorNicholas Piggin <npiggin@gmail.com>
Tue, 23 Nov 2021 09:51:49 +0000 (19:51 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 24 Nov 2021 10:08:57 +0000 (21:08 +1100)
commit245ebf8e7380b3d84c0aac37fbfd9306b45a3a7a
treec971581a1e6f91ba65b4b13eef7d6b4781f6b10d
parentd3c8a2d3740d93778ea102d4c781746d284177bf
powerpc/64s: Always set PMU control registers to frozen/disabled when not in use

KVM PMU management code looks for particular frozen/disabled bits in
the PMU registers so it knows whether it must clear them when coming
out of a guest or not. Setting this up helps KVM make these optimisations
without getting confused. Longer term the better approach might be to
move guest/host PMU switching to the perf subsystem.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Reviewed-by: Athira Jajeev <atrajeev@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20211123095231.1036501-12-npiggin@gmail.com
arch/powerpc/kernel/cpu_setup_power.c
arch/powerpc/kernel/dt_cpu_ftrs.c
arch/powerpc/kvm/book3s_hv.c