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 EC2ADC433E3 for ; Wed, 22 Jul 2020 12:47:08 +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 3F9702080D for ; Wed, 22 Jul 2020 12:47:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3F9702080D 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 4BBZwp2HX0zDr69 for ; Wed, 22 Jul 2020 22:47:06 +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=mx0b-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 mx0b-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 4BBSSF0l7hzDqS2 for ; Wed, 22 Jul 2020 17:55:24 +1000 (AEST) Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 06M7avCs051944; Wed, 22 Jul 2020 03:55:17 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 32e1vrhab5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 22 Jul 2020 03:55:17 -0400 Received: from m0098417.ppops.net (m0098417.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 06M7awd3052143; Wed, 22 Jul 2020 03:55:16 -0400 Received: from ppma03fra.de.ibm.com (6b.4a.5195.ip4.static.sl-reverse.com [149.81.74.107]) by mx0a-001b2d01.pphosted.com with ESMTP id 32e1vrhaae-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 22 Jul 2020 03:55:16 -0400 Received: from pps.filterd (ppma03fra.de.ibm.com [127.0.0.1]) by ppma03fra.de.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 06M7kEml032219; Wed, 22 Jul 2020 07:55:14 GMT Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by ppma03fra.de.ibm.com with ESMTP id 32brq82fks-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 22 Jul 2020 07:55:14 +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 06M7tCJ044499166 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 22 Jul 2020 07:55:12 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id F099D11C04A; Wed, 22 Jul 2020 07:55:11 +0000 (GMT) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id DE16911C058; Wed, 22 Jul 2020 07:55:08 +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 07:55:08 +0000 (GMT) From: Athira Rajeev Message-Id: <9A4E06A2-5686-4C85-B2F7-0904F195B58A@linux.vnet.ibm.com> Content-Type: multipart/alternative; boundary="Apple-Mail=_28D83C0F-1F3F-49AA-95FF-7F8F48673511" 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 13:25:06 +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> 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_03:2020-07-22, 2020-07-22 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 mlxlogscore=999 malwarescore=0 priorityscore=1501 adultscore=0 mlxscore=0 impostorscore=0 bulkscore=0 phishscore=0 lowpriorityscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2007220052 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=_28D83C0F-1F3F-49AA-95FF-7F8F48673511 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > 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 >> 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 > 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 =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 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.=20 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 =20 _GLOBAL(__setup_cpu_power9) @@ -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 =E2=80=94 >> 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=_28D83C0F-1F3F-49AA-95FF-7F8F48673511 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8

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
 #define SPRN_SIER3           =   0
 #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)
@@ -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-address= ing", feat_enable, 0},
       {"machine-check-power= 9", 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-gener= ator", feat_enable, 0},
       {"system-call-vectore= d", feat_disable, 0},
--
1.8.3.1

= --Apple-Mail=_28D83C0F-1F3F-49AA-95FF-7F8F48673511--