From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CAABBC433E2 for ; Wed, 22 Jul 2020 12:55:33 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 55BE720656 for ; Wed, 22 Jul 2020 12:55:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 55BE720656 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 4BBb6W186wzDqpG for ; Wed, 22 Jul 2020 22:55:31 +1000 (AEST) Authentication-Results: lists.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=linux.vnet.ibm.com (client-ip=148.163.158.5; helo=mx0a-001b2d01.pphosted.com; envelope-from=atrajeev@linux.vnet.ibm.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=fail (p=none dis=none) header.from=linux.vnet.ibm.com Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4BBZWP4RMXzDr3t for ; Wed, 22 Jul 2020 22:28:33 +1000 (AEST) Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 06MCGnoK126430; Wed, 22 Jul 2020 08:28:24 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com with ESMTP id 32e1wm1303-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 22 Jul 2020 08:28:24 -0400 Received: from m0098420.ppops.net (m0098420.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 06MCGprf126621; Wed, 22 Jul 2020 08:28:23 -0400 Received: from ppma06fra.de.ibm.com (48.49.7a9f.ip4.static.sl-reverse.com [159.122.73.72]) by mx0b-001b2d01.pphosted.com with ESMTP id 32e1wm12yb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 22 Jul 2020 08:28:23 -0400 Received: from pps.filterd (ppma06fra.de.ibm.com [127.0.0.1]) by ppma06fra.de.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 06MCI0Gn017249; Wed, 22 Jul 2020 12:28:21 GMT Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by ppma06fra.de.ibm.com with ESMTP id 32brbgthy7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 22 Jul 2020 12:28:21 +0000 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 06MCSJxK56819778 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 22 Jul 2020 12:28:19 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 05EC511C050; Wed, 22 Jul 2020 12:28:19 +0000 (GMT) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6918B11C05B; Wed, 22 Jul 2020 12:28:15 +0000 (GMT) Received: from [9.85.103.169] (unknown [9.85.103.169]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Wed, 22 Jul 2020 12:28:15 +0000 (GMT) From: Athira Rajeev Message-Id: Content-Type: multipart/alternative; boundary="Apple-Mail=_B165C2CD-78CC-401B-A22B-726B6621829E" Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.80.23.2.2\)) Subject: Re: [v3 07/15] powerpc/perf: Add power10_feat to dt_cpu_ftrs Date: Wed, 22 Jul 2020 17:58:13 +0530 In-Reply-To: To: Jordan Niethe References: <1594996707-3727-1-git-send-email-atrajeev@linux.vnet.ibm.com> <1594996707-3727-8-git-send-email-atrajeev@linux.vnet.ibm.com> <9A4E06A2-5686-4C85-B2F7-0904F195B58A@linux.vnet.ibm.com> X-Mailer: Apple Mail (2.3608.80.23.2.2) X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235, 18.0.687 definitions=2020-07-22_05:2020-07-22, 2020-07-22 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 phishscore=0 mlxlogscore=999 impostorscore=0 mlxscore=0 suspectscore=0 bulkscore=0 clxscore=1015 spamscore=0 lowpriorityscore=0 adultscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2007220089 X-Mailman-Approved-At: Wed, 22 Jul 2020 22:44:44 +1000 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Gautham R Shenoy , Michael Neuling , maddy@linux.vnet.ibm.com, kvm@vger.kernel.org, kvm-ppc@vger.kernel.org, svaidyan@in.ibm.com, acme@kernel.org, jolsa@kernel.org, linuxppc-dev Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" --Apple-Mail=_B165C2CD-78CC-401B-A22B-726B6621829E Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On 22-Jul-2020, at 4:19 PM, Jordan Niethe wrote: >=20 > On Wed, Jul 22, 2020 at 5:55 PM Athira Rajeev > > = wrote: >>=20 >>=20 >>=20 >> On 22-Jul-2020, at 10:11 AM, Jordan Niethe = wrote: >>=20 >> On Sat, Jul 18, 2020 at 1:13 AM Athira Rajeev >> wrote: >>=20 >>=20 >> From: Madhavan Srinivasan >>=20 >> Add power10 feature function to dt_cpu_ftrs.c along >> with a power10 specific init() to initialize pmu sprs, >> sets the oprofile_cpu_type and cpu_features. This will >> enable performance monitoring unit(PMU) for Power10 >> in CPU features with "performance-monitor-power10". >>=20 >> For PowerISA v3.1, BHRB disable is controlled via Monitor Mode >> Control Register A (MMCRA) bit, namely "BHRB Recording Disable >> (BHRBRD)". This patch initializes MMCRA BHRBRD to disable BHRB >> feature at boot for power10. >>=20 >> Signed-off-by: Madhavan Srinivasan >> --- >> arch/powerpc/include/asm/reg.h | 3 +++ >> arch/powerpc/kernel/cpu_setup_power.S | 8 ++++++++ >> arch/powerpc/kernel/dt_cpu_ftrs.c | 26 ++++++++++++++++++++++++++ >> 3 files changed, 37 insertions(+) >>=20 >> diff --git a/arch/powerpc/include/asm/reg.h = b/arch/powerpc/include/asm/reg.h >> index 21a1b2d..900ada1 100644 >> --- a/arch/powerpc/include/asm/reg.h >> +++ b/arch/powerpc/include/asm/reg.h >> @@ -1068,6 +1068,9 @@ >> #define MMCR0_PMC2_LOADMISSTIME 0x5 >> #endif >>=20 >> +/* BHRB disable bit for PowerISA v3.10 */ >> +#define MMCRA_BHRB_DISABLE 0x0000002000000000 >>=20 >> Shouldn't this go under SPRN_MMCRA with the other MMCRA_*. >>=20 >>=20 >>=20 >> Hi Jordan >>=20 >> Ok, the definition of MMCRA is under #ifdef for 64 bit . if I move = definition of MMCRA_BHRB_DISABLE along with other SPR's, I also >> need to define this for 32-bit to satisfy core-book3s to compile as = below: >>=20 >> diff --git a/arch/powerpc/include/asm/reg.h = b/arch/powerpc/include/asm/reg.h >> index 900ada10762c..7e271657b412 100644 >> --- a/arch/powerpc/include/asm/reg.h >> +++ b/arch/powerpc/include/asm/reg.h >> @@ -888,6 +888,8 @@ >> #define MMCRA_SLOT 0x07000000UL /* SLOT bits (37-39) */ >> #define MMCRA_SLOT_SHIFT 24 >> #define MMCRA_SAMPLE_ENABLE 0x00000001UL /* enable sampling */ >> +/* BHRB disable bit for PowerISA v3.10 */ >> +#define MMCRA_BHRB_DISABLE 0x0000002000000000 >> #define POWER6_MMCRA_SDSYNC 0x0000080000000000ULL /* SDAR/SIAR = synced */ >> #define POWER6_MMCRA_SIHV 0x0000040000000000ULL >> #define POWER6_MMCRA_SIPR 0x0000020000000000ULL >> @@ -1068,9 +1070,6 @@ >> #define MMCR0_PMC2_LOADMISSTIME 0x5 >> #endif >>=20 >>=20 >>=20 >> -/* BHRB disable bit for PowerISA v3.10 */ >> -#define MMCRA_BHRB_DISABLE 0x0000002000000000 >> - >> /* >> * SPRG usage: >> * >> diff --git a/arch/powerpc/perf/core-book3s.c = b/arch/powerpc/perf/core-book3s.c >> index 36baae666387..88068f20827c 100644 >> --- a/arch/powerpc/perf/core-book3s.c >> +++ b/arch/powerpc/perf/core-book3s.c >> @@ -94,6 +94,7 @@ static unsigned int freeze_events_kernel =3D = MMCR0_FCS; >> #define SPRN_SIER2 0 >> #define SPRN_SIER3 0 >> #define MMCRA_SAMPLE_ENABLE 0 >> +#define MMCRA_BHRB_DISABLE 0 >>=20 >>=20 >>=20 >> static inline unsigned long perf_ip_adjust(struct pt_regs *regs) >> { >>=20 >>=20 >>=20 >> + >> /* >> * SPRG usage: >> * >> diff --git a/arch/powerpc/kernel/cpu_setup_power.S = b/arch/powerpc/kernel/cpu_setup_power.S >> index efdcfa7..b8e0d1e 100644 >> --- a/arch/powerpc/kernel/cpu_setup_power.S >> +++ b/arch/powerpc/kernel/cpu_setup_power.S >> @@ -94,6 +94,7 @@ _GLOBAL(__restore_cpu_power8) >> _GLOBAL(__setup_cpu_power10) >> mflr r11 >> bl __init_FSCR_power10 >> + bl __init_PMU_ISA31 >>=20 >> So we set MMCRA here but then aren't we still going to call = __init_PMU >> which will overwrite that? >> Would this setting MMCRA also need to be handled in = __restore_cpu_power10? >>=20 >>=20 >> Thanks for this nice catch ! When I rebased code initial phase, we = didn=E2=80=99t had power10 part filled in. >> It was a miss from my side in adding PMu init functions and thanks = for pointing this out. >> Below patch will call __init_PMU functions in setup and restore. = Please check if this looks good >>=20 >> -- >> diff --git a/arch/powerpc/kernel/cpu_setup_power.S = b/arch/powerpc/kernel/cpu_setup_power.S >> index efdcfa714106..e672a6c5fd7c 100644 >> --- a/arch/powerpc/kernel/cpu_setup_power.S >> +++ b/arch/powerpc/kernel/cpu_setup_power.S >> @@ -94,6 +94,9 @@ _GLOBAL(__restore_cpu_power8) >> _GLOBAL(__setup_cpu_power10) >> mflr r11 >> bl __init_FSCR_power10 >> + bl __init_PMU >> + bl __init_PMU_ISA31 >> + bl __init_PMU_HV >> b 1f >>=20 >> _GLOBAL(__setup_cpu_power9) >=20 > Won't you also need to change where the label 1 is: > --- a/arch/powerpc/kernel/cpu_setup_power.S > +++ b/arch/powerpc/kernel/cpu_setup_power.S > @@ -100,8 +100,8 @@ _GLOBAL(__setup_cpu_power10) > _GLOBAL(__setup_cpu_power9) > mflr r11 > bl __init_FSCR > -1: bl __init_PMU > - bl __init_hvmode_206 > + bl __init_PMU > +1: bl __init_hvmode_206 > mtlr r11 > beqlr > li r0,0 HI Jordan I will address these comments and include changes for cpu_setup_power.S = in a separate patch as suggested by Michael Ellerman Thanks Athira >=20 >> @@ -124,6 +127,9 @@ _GLOBAL(__setup_cpu_power9) >> _GLOBAL(__restore_cpu_power10) >> mflr r11 >> bl __init_FSCR_power10 >> + bl __init_PMU >> + bl __init_PMU_ISA31 >> + bl __init_PMU_HV >> b 1f >>=20 >> _GLOBAL(__restore_cpu_power9) >> @@ -233,3 +239,10 @@ __init_PMU_ISA207: >> li r5,0 >> mtspr SPRN_MMCRS,r5 >> blr >> + >> +__init_PMU_ISA31: >> + li r5,0 >> + mtspr SPRN_MMCR3,r5 >> + LOAD_REG_IMMEDIATE(r5, MMCRA_BHRB_DISABLE) >> + mtspr SPRN_MMCRA,r5 >> + blr >>=20 >> =E2=80=94 >>=20 >> b 1f >>=20 >> _GLOBAL(__setup_cpu_power9) >> @@ -233,3 +234,10 @@ __init_PMU_ISA207: >> li r5,0 >> mtspr SPRN_MMCRS,r5 >> blr >> + >> +__init_PMU_ISA31: >> + li r5,0 >> + mtspr SPRN_MMCR3,r5 >> + LOAD_REG_IMMEDIATE(r5, MMCRA_BHRB_DISABLE) >> + mtspr SPRN_MMCRA,r5 >> + blr >> diff --git a/arch/powerpc/kernel/dt_cpu_ftrs.c = b/arch/powerpc/kernel/dt_cpu_ftrs.c >> index 3a40951..f482286 100644 >> --- a/arch/powerpc/kernel/dt_cpu_ftrs.c >> +++ b/arch/powerpc/kernel/dt_cpu_ftrs.c >> @@ -450,6 +450,31 @@ static int __init feat_enable_pmu_power9(struct = dt_cpu_feature *f) >> return 1; >> } >>=20 >> +static void init_pmu_power10(void) >> +{ >> + init_pmu_power9(); >> + >> + mtspr(SPRN_MMCR3, 0); >> + mtspr(SPRN_MMCRA, MMCRA_BHRB_DISABLE); >> +} >> + >> +static int __init feat_enable_pmu_power10(struct dt_cpu_feature *f) >> +{ >> + hfscr_pmu_enable(); >> + >> + init_pmu_power10(); >> + init_pmu_registers =3D init_pmu_power10; >> + >> + cur_cpu_spec->cpu_features |=3D CPU_FTR_MMCRA; >> + cur_cpu_spec->cpu_user_features |=3D = PPC_FEATURE_PSERIES_PERFMON_COMPAT; >> + >> + cur_cpu_spec->num_pmcs =3D 6; >> + cur_cpu_spec->pmc_type =3D PPC_PMC_IBM; >> + cur_cpu_spec->oprofile_cpu_type =3D "ppc64/power10"; >> + >> + return 1; >> +} >> + >> static int __init feat_enable_tm(struct dt_cpu_feature *f) >> { >> #ifdef CONFIG_PPC_TRANSACTIONAL_MEM >> @@ -639,6 +664,7 @@ struct dt_cpu_feature_match { >> {"pc-relative-addressing", feat_enable, 0}, >> {"machine-check-power9", feat_enable_mce_power9, 0}, >> {"performance-monitor-power9", feat_enable_pmu_power9, 0}, >> + {"performance-monitor-power10", feat_enable_pmu_power10, 0}, >> {"event-based-branch-v3", feat_enable, 0}, >> {"random-number-generator", feat_enable, 0}, >> {"system-call-vectored", feat_disable, 0}, >> -- >> 1.8.3.1 --Apple-Mail=_B165C2CD-78CC-401B-A22B-726B6621829E Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8

On 22-Jul-2020, at 4:19 PM, Jordan Niethe <jniethe5@gmail.com> = wrote:

On Wed, Jul 22, 2020 at 5:55 PM = Athira Rajeev
<atrajeev@linux.vnet.ibm.com> wrote:



On 22-Jul-2020, at 10:11 AM, Jordan Niethe <jniethe5@gmail.com> = wrote:

On Sat, Jul 18, 2020 at 1:13 AM = Athira Rajeev
<atrajeev@linux.vnet.ibm.com> wrote:


From: Madhavan Srinivasan <maddy@linux.ibm.com>

Add = power10 feature function to dt_cpu_ftrs.c along
with a = power10 specific init() to initialize pmu sprs,
sets the = oprofile_cpu_type and cpu_features. This will
enable = performance monitoring unit(PMU) for Power10
in CPU = features with "performance-monitor-power10".

For PowerISA v3.1, BHRB disable is controlled via Monitor = Mode
Control Register A (MMCRA) bit, namely "BHRB = Recording Disable
(BHRBRD)". This patch initializes MMCRA = BHRBRD to disable BHRB
feature at boot for power10.

Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com>
---
arch/powerpc/include/asm/reg.h =        |  3 +++
arch/powerpc/kernel/cpu_setup_power.S |  8 ++++++++
arch/powerpc/kernel/dt_cpu_ftrs.c     | = 26 ++++++++++++++++++++++++++
3 files changed, 37 = insertions(+)

diff --git = a/arch/powerpc/include/asm/reg.h b/arch/powerpc/include/asm/reg.h
index 21a1b2d..900ada1 100644
--- = a/arch/powerpc/include/asm/reg.h
+++ = b/arch/powerpc/include/asm/reg.h
@@ -1068,6 +1068,9 @@
#define MMCR0_PMC2_LOADMISSTIME =        0x5
#endif

+/* BHRB disable bit for PowerISA v3.10 */
+#define MMCRA_BHRB_DISABLE =     0x0000002000000000

Shouldn't this go under SPRN_MMCRA with the other MMCRA_*.



Hi Jordan

Ok, the definition of MMCRA is under #ifdef = for 64 bit .  if I move definition of MMCRA_BHRB_DISABLE along with = other SPR's, I also
need to define this for 32-bit to = satisfy core-book3s to compile as below:

diff= --git a/arch/powerpc/include/asm/reg.h = b/arch/powerpc/include/asm/reg.h
index = 900ada10762c..7e271657b412 100644
--- = a/arch/powerpc/include/asm/reg.h
+++ = b/arch/powerpc/include/asm/reg.h
@@ -888,6 +888,8 @@
#define   MMCRA_SLOT   0x07000000UL /* = SLOT bits (37-39) */
#define   MMCRA_SLOT_SHIFT =     24
#define =   MMCRA_SAMPLE_ENABLE 0x00000001UL /* enable sampling */
+/* BHRB disable bit for PowerISA v3.10 */
+#define   MMCRA_BHRB_DISABLE =  0x0000002000000000
#define =   POWER6_MMCRA_SDSYNC 0x0000080000000000ULL =    /* SDAR/SIAR synced */
#define =   POWER6_MMCRA_SIHV   0x0000040000000000ULL
#define   POWER6_MMCRA_SIPR =   0x0000020000000000ULL
@@ -1068,9 +1070,6 @@
#define MMCR0_PMC2_LOADMISSTIME =        0x5
#endif



-/* BHRB disable = bit for PowerISA v3.10 */
-#define MMCRA_BHRB_DISABLE =     0x0000002000000000
-
/*
 * SPRG usage:
 *
diff --git a/arch/powerpc/perf/core-book3s.c = b/arch/powerpc/perf/core-book3s.c
index = 36baae666387..88068f20827c 100644
--- = a/arch/powerpc/perf/core-book3s.c
+++ = b/arch/powerpc/perf/core-book3s.c
@@ -94,6 +94,7 @@ static = unsigned int freeze_events_kernel =3D MMCR0_FCS;
#define = SPRN_SIER2 =             0<= br class=3D"">#define SPRN_SIER3 =             0<= br class=3D"">#define MMCRA_SAMPLE_ENABLE    0
+#define MMCRA_BHRB_DISABLE     0



static inline = unsigned long perf_ip_adjust(struct pt_regs *regs)
{



+
/*
* SPRG usage:
*
diff --git a/arch/powerpc/kernel/cpu_setup_power.S = b/arch/powerpc/kernel/cpu_setup_power.S
index = efdcfa7..b8e0d1e 100644
--- = a/arch/powerpc/kernel/cpu_setup_power.S
+++ = b/arch/powerpc/kernel/cpu_setup_power.S
@@ -94,6 +94,7 @@ = _GLOBAL(__restore_cpu_power8)
_GLOBAL(__setup_cpu_power10)
      mflr =    r11
      bl=      __init_FSCR_power10
+ =       bl =      __init_PMU_ISA31

So we set MMCRA here but then aren't we still going to call = __init_PMU
which will overwrite that?
Would = this setting MMCRA also need to be handled in __restore_cpu_power10?


Thanks for this nice catch ! =  When I rebased code initial phase, we didn=E2=80=99t had power10 = part filled in.
It was a miss from my side in adding PMu = init functions and thanks for pointing this out.
Below = patch will call __init_PMU functions in setup and restore. Please check = if this looks good

--
diff = --git a/arch/powerpc/kernel/cpu_setup_power.S = b/arch/powerpc/kernel/cpu_setup_power.S
index = efdcfa714106..e672a6c5fd7c 100644
--- = a/arch/powerpc/kernel/cpu_setup_power.S
+++ = b/arch/powerpc/kernel/cpu_setup_power.S
@@ -94,6 +94,9 @@ = _GLOBAL(__restore_cpu_power8)
_GLOBAL(__setup_cpu_power10)
 mflr r11
 bl __init_FSCR_power10
+ bl __init_PMU
+ bl __init_PMU_ISA31
+ bl __init_PMU_HV
 b 1f

_GLOBAL(__setup_cpu_power9)

Won't you also need to change = where the label 1 is:
--- a/arch/powerpc/kernel/cpu_setup_power.S
+++ = b/arch/powerpc/kernel/cpu_setup_power.S
@@ -100,8 +100,8 @@ _GLOBAL(__setup_cpu_power10)
_GLOBAL(__setup_cpu_power9)
       mflr =    r11
       bl =      __init_FSCR
-1:     bl =      __init_PMU
-       bl =      __init_hvmode_206
+ =       bl =      __init_PMU
+1:     bl =      __init_hvmode_206
       mtlr =    r11
       beqlr
       li =      r0,0

HI Jordan

I will = address these comments and include changes for cpu_setup_power.S in a = separate patch as suggested by Michael Ellerman

Thanks
Athira

@@ -124,6 +127,9 @@ = _GLOBAL(__setup_cpu_power9)
_GLOBAL(__restore_cpu_power10)
 mflr = r11
 bl __init_FSCR_power10
+ bl = __init_PMU
+ bl __init_PMU_ISA31
+ bl = __init_PMU_HV
 b 1f

_GLOBAL(__restore_cpu_power9)
@@ -233,3 +239,10 = @@ __init_PMU_ISA207:
 li r5,0
 mtspr SPRN_MMCRS,r5
 blr
+
+__init_PMU_ISA31:
+ li r5,0
+ mtspr SPRN_MMCR3,r5
+ LOAD_REG_IMMEDIATE(r5, = MMCRA_BHRB_DISABLE)
+ mtspr SPRN_MMCRA,r5
+ = blr

=E2=80=94

      b =       1f

_GLOBAL(__setup_cpu_power9)
@@ -233,3 +234,10 = @@ __init_PMU_ISA207:
      li=      r5,0
      mtspr =   SPRN_MMCRS,r5
      blr
+
+__init_PMU_ISA31:
+ =       li =      r5,0
+ =       mtspr   SPRN_MMCR3,r5
+       LOAD_REG_IMMEDIATE(r5, = MMCRA_BHRB_DISABLE)
+ =       mtspr   SPRN_MMCRA,r5
+       blr
diff = --git a/arch/powerpc/kernel/dt_cpu_ftrs.c = b/arch/powerpc/kernel/dt_cpu_ftrs.c
index 3a40951..f482286 = 100644
--- a/arch/powerpc/kernel/dt_cpu_ftrs.c
+++ b/arch/powerpc/kernel/dt_cpu_ftrs.c
@@ = -450,6 +450,31 @@ static int __init feat_enable_pmu_power9(struct = dt_cpu_feature *f)
      return 1;
}

+static void = init_pmu_power10(void)
+{
+ =       init_pmu_power9();
+
+       mtspr(SPRN_MMCR3, = 0);
+ =       mtspr(SPRN_MMCRA, = MMCRA_BHRB_DISABLE);
+}
+
+static int __init feat_enable_pmu_power10(struct = dt_cpu_feature *f)
+{
+ =       hfscr_pmu_enable();
++       init_pmu_power10();
+       init_pmu_registers =3D = init_pmu_power10;
+
+ =       cur_cpu_spec->cpu_features |=3D = CPU_FTR_MMCRA;
+ =       cur_cpu_spec->cpu_user_features = |=3D PPC_FEATURE_PSERIES_PERFMON_COMPAT;
+
+ =       cur_cpu_spec->num_pmcs =          =3D 6;
+ =       cur_cpu_spec->pmc_type =          =3D = PPC_PMC_IBM;
+ =       cur_cpu_spec->oprofile_cpu_type =3D= "ppc64/power10";
+
+ =       return 1;
+}
+
static int __init feat_enable_tm(struct = dt_cpu_feature *f)
{
#ifdef = CONFIG_PPC_TRANSACTIONAL_MEM
@@ -639,6 +664,7 @@ struct = dt_cpu_feature_match {
      {"pc-relative-addressing", = feat_enable, 0},
      {"machine-check-power9", = feat_enable_mce_power9, 0},
      {"performance-monitor-power= 9", feat_enable_pmu_power9, 0},
+ =       {"performance-monitor-power10", = feat_enable_pmu_power10, 0},
      {"event-based-branch-v3", = feat_enable, 0},
      {"random-number-generator",= feat_enable, 0},
      {"system-call-vectored", = feat_disable, 0},
--
1.8.3.1

= --Apple-Mail=_B165C2CD-78CC-401B-A22B-726B6621829E--