powerpc/perf: Fix Threshold Event Counter Multiplier width for P10
authorMadhavan Srinivasan <maddy@linux.ibm.com>
Tue, 15 Dec 2020 08:56:18 +0000 (03:56 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 30 Dec 2020 10:53:53 +0000 (11:53 +0100)
commit34169b582aa9ed98cd48ec543b8f1b1b72b67e52
treec40961292cf9cbf1783d0b2fd65a5681dc48345f
parentb6fba53d44e8fb3247f814caf707668445511bdc
powerpc/perf: Fix Threshold Event Counter Multiplier width for P10

[ Upstream commit ef0e3b650f8ddc54bb70868852f50642ee3ae765 ]

Threshold Event Counter Multiplier (TECM) is part of Monitor Mode
Control Register A (MMCRA). This field along with Threshold Event
Counter Exponent (TECE) is used to get threshould counter value.
In Power10, this is a 8bit field, so patch fixes the
current code to modify the MMCRA[TECM] extraction macro to
handle this change. ISA v3.1 says this is a 7 bit field but
POWER10 it's actually 8 bits which will hopefully be fixed
in ISA v3.1 update.

Fixes: 170a315f41c6 ("powerpc/perf: Support to export MMCRA[TEC*] field to userspace")
Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com>
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/1608022578-1532-1-git-send-email-atrajeev@linux.vnet.ibm.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/powerpc/perf/isa207-common.c
arch/powerpc/perf/isa207-common.h