From: Madhavan Srinivasan <maddy@linux.ibm.com>
To: "Michal Suchánek" <msuchanek@suse.de>
Cc: atrajeev@linux.vnet.ibm.com, linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH] powerpc/perf: fix Threshold Event CounterMultiplier width for P10
Date: Tue, 13 Oct 2020 18:27:05 +0530 [thread overview]
Message-ID: <b840fcf3-6546-159e-e23a-c8fe00123539@linux.ibm.com> (raw)
In-Reply-To: <20201012112905.GQ29778@kitsune.suse.cz>
On 10/12/20 4:59 PM, Michal Suchánek wrote:
> Hello,
>
> On Mon, Oct 12, 2020 at 04:01:28PM +0530, Madhavan Srinivasan wrote:
>> Power9 and isa v3.1 has 7bit mantissa field for Threshold Event Counter
> ^^^ Shouldn't his be 3.0?
My bad, What I meant was
Power9, ISA v3.0 and ISA v3.1 define a 7 bit mantissa field for
Threshold Event Counter Multiplier(TECM).
Maddy
>
>> Multiplier (TECM). 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, the width of TECM field is
>> increase to 8bits. Patch fixes the current code to modify the MMCRA[TECM]
>> extraction macro to handling this changes.
>>
>> Fixes: 170a315f41c64 ('powerpc/perf: Support to export MMCRA[TEC*] field to userspace')
>> Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com>
>> ---
>> arch/powerpc/perf/isa207-common.c | 3 +++
>> arch/powerpc/perf/isa207-common.h | 4 ++++
>> 2 files changed, 7 insertions(+)
>>
>> diff --git a/arch/powerpc/perf/isa207-common.c b/arch/powerpc/perf/isa207-common.c
>> index 964437adec18..5fe129f02290 100644
>> --- a/arch/powerpc/perf/isa207-common.c
>> +++ b/arch/powerpc/perf/isa207-common.c
>> @@ -247,6 +247,9 @@ void isa207_get_mem_weight(u64 *weight)
>> u64 sier = mfspr(SPRN_SIER);
>> u64 val = (sier & ISA207_SIER_TYPE_MASK) >> ISA207_SIER_TYPE_SHIFT;
>>
>> + if (cpu_has_feature(CPU_FTR_ARCH_31))
>> + mantissa = P10_MMCRA_THR_CTR_MANT(mmcra);
>> +
>> if (val == 0 || val == 7)
>> *weight = 0;
>> else
>> diff --git a/arch/powerpc/perf/isa207-common.h b/arch/powerpc/perf/isa207-common.h
>> index 044de65e96b9..71380e854f48 100644
>> --- a/arch/powerpc/perf/isa207-common.h
>> +++ b/arch/powerpc/perf/isa207-common.h
>> @@ -219,6 +219,10 @@
>> #define MMCRA_THR_CTR_EXP(v) (((v) >> MMCRA_THR_CTR_EXP_SHIFT) &\
>> MMCRA_THR_CTR_EXP_MASK)
>>
>> +#define P10_MMCRA_THR_CTR_MANT_MASK 0xFFul
>> +#define P10_MMCRA_THR_CTR_MANT(v) (((v) >> MMCRA_THR_CTR_MANT_SHIFT) &\
>> + P10_MMCRA_THR_CTR_MANT_MASK)
>> +
>> /* MMCRA Threshold Compare bit constant for power9 */
>> #define p9_MMCRA_THR_CMP_SHIFT 45
>>
>> --
>> 2.26.2
>>
next prev parent reply other threads:[~2020-10-13 13:00 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-12 10:31 [PATCH] powerpc/perf: fix Threshold Event CounterMultiplier width for P10 Madhavan Srinivasan
2020-10-12 11:29 ` Michal Suchánek
2020-10-13 12:57 ` Madhavan Srinivasan [this message]
2020-10-13 15:58 ` Michal Suchánek
2020-10-14 5:50 ` Madhavan Srinivasan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b840fcf3-6546-159e-e23a-c8fe00123539@linux.ibm.com \
--to=maddy@linux.ibm.com \
--cc=atrajeev@linux.vnet.ibm.com \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=msuchanek@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).