Skip to content

Commit 26b78c8

Browse files
rarbabmpe
authored andcommitted
powerpc: Enable the DAWR on POWER9 DD2.3 and above
The hardware bug in POWER9 preventing use of the DAWR was fixed in DD2.3. Set the CPU_FTR_DAWR feature bit on these newer systems to start using it again, and update the documentation accordingly. The CPU features for DD2.3 are currently determined by "DD2.2 or later" logic. In adding DD2.3 as a discrete case for the first time here, I'm carrying the quirks of DD2.2 forward to keep all behavior outside of this DAWR change the same. This leaves the assessment and potential removal of those quirks on DD2.3 for later. Signed-off-by: Reza Arbab <arbab@linux.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/20220503170152.23412-1-arbab@linux.ibm.com
1 parent b4d9cc7 commit 26b78c8

4 files changed

Lines changed: 52 additions & 14 deletions

File tree

Documentation/powerpc/dawr-power9.rst

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,23 @@
22
DAWR issues on POWER9
33
=====================
44

5-
On POWER9 the Data Address Watchpoint Register (DAWR) can cause a checkstop
6-
if it points to cache inhibited (CI) memory. Currently Linux has no way to
7-
distinguish CI memory when configuring the DAWR, so (for now) the DAWR is
8-
disabled by this commit::
9-
10-
commit 9654153158d3e0684a1bdb76dbababdb7111d5a0
11-
Author: Michael Neuling <mikey@neuling.org>
12-
Date: Tue Mar 27 15:37:24 2018 +1100
13-
powerpc: Disable DAWR in the base POWER9 CPU features
5+
On older POWER9 processors, the Data Address Watchpoint Register (DAWR) can
6+
cause a checkstop if it points to cache inhibited (CI) memory. Currently Linux
7+
has no way to distinguish CI memory when configuring the DAWR, so on affected
8+
systems, the DAWR is disabled.
9+
10+
Affected processor revisions
11+
============================
12+
13+
This issue is only present on processors prior to v2.3. The revision can be
14+
found in /proc/cpuinfo::
15+
16+
processor : 0
17+
cpu : POWER9, altivec supported
18+
clock : 3800.000000MHz
19+
revision : 2.3 (pvr 004e 1203)
20+
21+
On a system with the issue, the DAWR is disabled as detailed below.
1422

1523
Technical Details:
1624
==================

arch/powerpc/include/asm/cputable.h

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,10 @@ static inline void cpu_feature_keys_init(void) { }
440440
#define CPU_FTRS_POWER9_DD2_2 (CPU_FTRS_POWER9 | CPU_FTR_POWER9_DD2_1 | \
441441
CPU_FTR_P9_TM_HV_ASSIST | \
442442
CPU_FTR_P9_TM_XER_SO_BUG)
443+
#define CPU_FTRS_POWER9_DD2_3 (CPU_FTRS_POWER9 | CPU_FTR_POWER9_DD2_1 | \
444+
CPU_FTR_P9_TM_HV_ASSIST | \
445+
CPU_FTR_P9_TM_XER_SO_BUG | \
446+
CPU_FTR_DAWR)
443447
#define CPU_FTRS_POWER10 (CPU_FTR_LWSYNC | \
444448
CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | CPU_FTR_ARCH_206 |\
445449
CPU_FTR_MMCRA | CPU_FTR_SMT | \
@@ -469,14 +473,16 @@ static inline void cpu_feature_keys_init(void) { }
469473
#define CPU_FTRS_POSSIBLE \
470474
(CPU_FTRS_POWER7 | CPU_FTRS_POWER8E | CPU_FTRS_POWER8 | \
471475
CPU_FTR_ALTIVEC_COMP | CPU_FTR_VSX_COMP | CPU_FTRS_POWER9 | \
472-
CPU_FTRS_POWER9_DD2_1 | CPU_FTRS_POWER9_DD2_2 | CPU_FTRS_POWER10)
476+
CPU_FTRS_POWER9_DD2_1 | CPU_FTRS_POWER9_DD2_2 | \
477+
CPU_FTRS_POWER9_DD2_3 | CPU_FTRS_POWER10)
473478
#else
474479
#define CPU_FTRS_POSSIBLE \
475480
(CPU_FTRS_PPC970 | CPU_FTRS_POWER5 | \
476481
CPU_FTRS_POWER6 | CPU_FTRS_POWER7 | CPU_FTRS_POWER8E | \
477482
CPU_FTRS_POWER8 | CPU_FTRS_CELL | CPU_FTRS_PA6T | \
478483
CPU_FTR_VSX_COMP | CPU_FTR_ALTIVEC_COMP | CPU_FTRS_POWER9 | \
479-
CPU_FTRS_POWER9_DD2_1 | CPU_FTRS_POWER9_DD2_2 | CPU_FTRS_POWER10)
484+
CPU_FTRS_POWER9_DD2_1 | CPU_FTRS_POWER9_DD2_2 | \
485+
CPU_FTRS_POWER9_DD2_3 | CPU_FTRS_POWER10)
480486
#endif /* CONFIG_CPU_LITTLE_ENDIAN */
481487
#endif
482488
#else

arch/powerpc/kernel/cputable.c

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -487,11 +487,29 @@ static struct cpu_spec __initdata cpu_specs[] = {
487487
.machine_check_early = __machine_check_early_realmode_p9,
488488
.platform = "power9",
489489
},
490-
{ /* Power9 DD2.2 or later */
490+
{ /* Power9 DD2.2 */
491+
.pvr_mask = 0xffffefff,
492+
.pvr_value = 0x004e0202,
493+
.cpu_name = "POWER9 (raw)",
494+
.cpu_features = CPU_FTRS_POWER9_DD2_2,
495+
.cpu_user_features = COMMON_USER_POWER9,
496+
.cpu_user_features2 = COMMON_USER2_POWER9,
497+
.mmu_features = MMU_FTRS_POWER9,
498+
.icache_bsize = 128,
499+
.dcache_bsize = 128,
500+
.num_pmcs = 6,
501+
.pmc_type = PPC_PMC_IBM,
502+
.oprofile_cpu_type = "ppc64/power9",
503+
.cpu_setup = __setup_cpu_power9,
504+
.cpu_restore = __restore_cpu_power9,
505+
.machine_check_early = __machine_check_early_realmode_p9,
506+
.platform = "power9",
507+
},
508+
{ /* Power9 DD2.3 or later */
491509
.pvr_mask = 0xffff0000,
492510
.pvr_value = 0x004e0000,
493511
.cpu_name = "POWER9 (raw)",
494-
.cpu_features = CPU_FTRS_POWER9_DD2_2,
512+
.cpu_features = CPU_FTRS_POWER9_DD2_3,
495513
.cpu_user_features = COMMON_USER_POWER9,
496514
.cpu_user_features2 = COMMON_USER2_POWER9,
497515
.mmu_features = MMU_FTRS_POWER9,

arch/powerpc/kernel/dt_cpu_ftrs.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -774,20 +774,26 @@ static __init void cpufeatures_cpu_quirks(void)
774774
if ((version & 0xffffefff) == 0x004e0200) {
775775
/* DD2.0 has no feature flag */
776776
cur_cpu_spec->cpu_features |= CPU_FTR_P9_RADIX_PREFETCH_BUG;
777+
cur_cpu_spec->cpu_features &= ~(CPU_FTR_DAWR);
777778
} else if ((version & 0xffffefff) == 0x004e0201) {
778779
cur_cpu_spec->cpu_features |= CPU_FTR_POWER9_DD2_1;
779780
cur_cpu_spec->cpu_features |= CPU_FTR_P9_RADIX_PREFETCH_BUG;
781+
cur_cpu_spec->cpu_features &= ~(CPU_FTR_DAWR);
780782
} else if ((version & 0xffffefff) == 0x004e0202) {
781783
cur_cpu_spec->cpu_features |= CPU_FTR_P9_TM_HV_ASSIST;
782784
cur_cpu_spec->cpu_features |= CPU_FTR_P9_TM_XER_SO_BUG;
783785
cur_cpu_spec->cpu_features |= CPU_FTR_POWER9_DD2_1;
786+
cur_cpu_spec->cpu_features &= ~(CPU_FTR_DAWR);
787+
} else if ((version & 0xffffefff) == 0x004e0203) {
788+
cur_cpu_spec->cpu_features |= CPU_FTR_P9_TM_HV_ASSIST;
789+
cur_cpu_spec->cpu_features |= CPU_FTR_P9_TM_XER_SO_BUG;
790+
cur_cpu_spec->cpu_features |= CPU_FTR_POWER9_DD2_1;
784791
} else if ((version & 0xffff0000) == 0x004e0000) {
785792
/* DD2.1 and up have DD2_1 */
786793
cur_cpu_spec->cpu_features |= CPU_FTR_POWER9_DD2_1;
787794
}
788795

789796
if ((version & 0xffff0000) == 0x004e0000) {
790-
cur_cpu_spec->cpu_features &= ~(CPU_FTR_DAWR);
791797
cur_cpu_spec->cpu_features |= CPU_FTR_P9_TIDR;
792798
}
793799

0 commit comments

Comments
 (0)