powerpc/perf: BHRB control to disable BHRB logic when not used
authorAthira Rajeev <atrajeev@linux.vnet.ibm.com>
Fri, 17 Jul 2020 14:38:23 +0000 (10:38 -0400)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 22 Jul 2020 11:56:42 +0000 (21:56 +1000)
commit1cade527f6e9bec6a6412d0641643c359ada8096
tree9d5f4e5e45d68ac56c36fa8872e895e595db7c62
parent80350a4bac992e3404067d31ff901ae9ff76aaa8
powerpc/perf: BHRB control to disable BHRB logic when not used

PowerISA v3.1 has few updates for the Branch History Rolling
Buffer(BHRB).

BHRB disable is controlled via Monitor Mode Control Register A (MMCRA)
bit, namely "BHRB Recording Disable (BHRBRD)". This field controls
whether BHRB entries are written when BHRB recording is enabled by
other bits. This patch implements support for this BHRB disable bit.
By setting 0b1 to this bit will disable the BHRB and by setting 0b0 to
this bit will have BHRB enabled. This addresses backward
compatibility (for older OS), since this bit will be cleared and
hardware will be writing to BHRB by default.

This patch addresses changes to set MMCRA (BHRBRD) at boot for
power10 (there by the core will run faster) and enable this feature
only on runtime ie, on explicit need from user. Also save/restore
MMCRA in the restore path of state-loss idle state to make sure we
keep BHRB disabled if it was not enabled on request at runtime.

Signed-off-by: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/1594996707-3727-12-git-send-email-atrajeev@linux.vnet.ibm.com
arch/powerpc/perf/core-book3s.c
arch/powerpc/perf/isa207-common.c
arch/powerpc/platforms/powernv/idle.c