]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
powerpc: Enable the DAWR on POWER9 DD2.3 and above
authorReza Arbab <arbab@linux.ibm.com>
Tue, 3 May 2022 17:01:52 +0000 (12:01 -0500)
committerMichael Ellerman <mpe@ellerman.id.au>
Sun, 22 May 2022 05:59:53 +0000 (15:59 +1000)
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
Documentation/powerpc/dawr-power9.rst
arch/powerpc/include/asm/cputable.h
arch/powerpc/kernel/cputable.c
arch/powerpc/kernel/dt_cpu_ftrs.c

index e55ac6a24b97f944119fc54b7667152392e212c6..310f2e0cea812a3870ab43fbce628f8007fe5dfb 100644 (file)
@@ -2,15 +2,23 @@
 DAWR issues on POWER9
 =====================
 
-On POWER9 the Data Address Watchpoint Register (DAWR) can cause a checkstop
-if it points to cache inhibited (CI) memory. Currently Linux has no way to
-distinguish CI memory when configuring the DAWR, so (for now) the DAWR is
-disabled by this commit::
-
-    commit 9654153158d3e0684a1bdb76dbababdb7111d5a0
-    Author: Michael Neuling <mikey@neuling.org>
-    Date:   Tue Mar 27 15:37:24 2018 +1100
-    powerpc: Disable DAWR in the base POWER9 CPU features
+On older POWER9 processors, the Data Address Watchpoint Register (DAWR) can
+cause a checkstop if it points to cache inhibited (CI) memory. Currently Linux
+has no way to distinguish CI memory when configuring the DAWR, so on affected
+systems, the DAWR is disabled.
+
+Affected processor revisions
+============================
+
+This issue is only present on processors prior to v2.3. The revision can be
+found in /proc/cpuinfo::
+
+    processor       : 0
+    cpu             : POWER9, altivec supported
+    clock           : 3800.000000MHz
+    revision        : 2.3 (pvr 004e 1203)
+
+On a system with the issue, the DAWR is disabled as detailed below.
 
 Technical Details:
 ==================
index 48a55cb1bf5c1009183c05ea3d0f08752508ca85..549eb6dd146f1d600516bee9235fdfe8bf5525f2 100644 (file)
@@ -440,6 +440,10 @@ static inline void cpu_feature_keys_init(void) { }
 #define CPU_FTRS_POWER9_DD2_2 (CPU_FTRS_POWER9 | CPU_FTR_POWER9_DD2_1 | \
                               CPU_FTR_P9_TM_HV_ASSIST | \
                               CPU_FTR_P9_TM_XER_SO_BUG)
+#define CPU_FTRS_POWER9_DD2_3 (CPU_FTRS_POWER9 | CPU_FTR_POWER9_DD2_1 | \
+                              CPU_FTR_P9_TM_HV_ASSIST | \
+                              CPU_FTR_P9_TM_XER_SO_BUG | \
+                              CPU_FTR_DAWR)
 #define CPU_FTRS_POWER10 (CPU_FTR_LWSYNC | \
            CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | CPU_FTR_ARCH_206 |\
            CPU_FTR_MMCRA | CPU_FTR_SMT | \
@@ -469,14 +473,16 @@ static inline void cpu_feature_keys_init(void) { }
 #define CPU_FTRS_POSSIBLE      \
            (CPU_FTRS_POWER7 | CPU_FTRS_POWER8E | CPU_FTRS_POWER8 | \
             CPU_FTR_ALTIVEC_COMP | CPU_FTR_VSX_COMP | CPU_FTRS_POWER9 | \
-            CPU_FTRS_POWER9_DD2_1 | CPU_FTRS_POWER9_DD2_2 | CPU_FTRS_POWER10)
+            CPU_FTRS_POWER9_DD2_1 | CPU_FTRS_POWER9_DD2_2 | \
+            CPU_FTRS_POWER9_DD2_3 | CPU_FTRS_POWER10)
 #else
 #define CPU_FTRS_POSSIBLE      \
            (CPU_FTRS_PPC970 | CPU_FTRS_POWER5 | \
             CPU_FTRS_POWER6 | CPU_FTRS_POWER7 | CPU_FTRS_POWER8E | \
             CPU_FTRS_POWER8 | CPU_FTRS_CELL | CPU_FTRS_PA6T | \
             CPU_FTR_VSX_COMP | CPU_FTR_ALTIVEC_COMP | CPU_FTRS_POWER9 | \
-            CPU_FTRS_POWER9_DD2_1 | CPU_FTRS_POWER9_DD2_2 | CPU_FTRS_POWER10)
+            CPU_FTRS_POWER9_DD2_1 | CPU_FTRS_POWER9_DD2_2 | \
+            CPU_FTRS_POWER9_DD2_3 | CPU_FTRS_POWER10)
 #endif /* CONFIG_CPU_LITTLE_ENDIAN */
 #endif
 #else
index f9b3def5b254431531b5693e1cc11d7aac0b40f5..a5dbfccd2047915c068f3c8bcded0ca0048d7b54 100644 (file)
@@ -487,11 +487,29 @@ static struct cpu_spec __initdata cpu_specs[] = {
                .machine_check_early    = __machine_check_early_realmode_p9,
                .platform               = "power9",
        },
-       {       /* Power9 DD2.2 or later */
+       {       /* Power9 DD2.2 */
+               .pvr_mask               = 0xffffefff,
+               .pvr_value              = 0x004e0202,
+               .cpu_name               = "POWER9 (raw)",
+               .cpu_features           = CPU_FTRS_POWER9_DD2_2,
+               .cpu_user_features      = COMMON_USER_POWER9,
+               .cpu_user_features2     = COMMON_USER2_POWER9,
+               .mmu_features           = MMU_FTRS_POWER9,
+               .icache_bsize           = 128,
+               .dcache_bsize           = 128,
+               .num_pmcs               = 6,
+               .pmc_type               = PPC_PMC_IBM,
+               .oprofile_cpu_type      = "ppc64/power9",
+               .cpu_setup              = __setup_cpu_power9,
+               .cpu_restore            = __restore_cpu_power9,
+               .machine_check_early    = __machine_check_early_realmode_p9,
+               .platform               = "power9",
+       },
+       {       /* Power9 DD2.3 or later */
                .pvr_mask               = 0xffff0000,
                .pvr_value              = 0x004e0000,
                .cpu_name               = "POWER9 (raw)",
-               .cpu_features           = CPU_FTRS_POWER9_DD2_2,
+               .cpu_features           = CPU_FTRS_POWER9_DD2_3,
                .cpu_user_features      = COMMON_USER_POWER9,
                .cpu_user_features2     = COMMON_USER2_POWER9,
                .mmu_features           = MMU_FTRS_POWER9,
index c8e147b66d34e51aac42f1428963f10b30193c53..2ad365c21afa8af428488e4e66e83d009001c82f 100644 (file)
@@ -774,20 +774,26 @@ static __init void cpufeatures_cpu_quirks(void)
        if ((version & 0xffffefff) == 0x004e0200) {
                /* DD2.0 has no feature flag */
                cur_cpu_spec->cpu_features |= CPU_FTR_P9_RADIX_PREFETCH_BUG;
+               cur_cpu_spec->cpu_features &= ~(CPU_FTR_DAWR);
        } else if ((version & 0xffffefff) == 0x004e0201) {
                cur_cpu_spec->cpu_features |= CPU_FTR_POWER9_DD2_1;
                cur_cpu_spec->cpu_features |= CPU_FTR_P9_RADIX_PREFETCH_BUG;
+               cur_cpu_spec->cpu_features &= ~(CPU_FTR_DAWR);
        } else if ((version & 0xffffefff) == 0x004e0202) {
                cur_cpu_spec->cpu_features |= CPU_FTR_P9_TM_HV_ASSIST;
                cur_cpu_spec->cpu_features |= CPU_FTR_P9_TM_XER_SO_BUG;
                cur_cpu_spec->cpu_features |= CPU_FTR_POWER9_DD2_1;
+               cur_cpu_spec->cpu_features &= ~(CPU_FTR_DAWR);
+       } else if ((version & 0xffffefff) == 0x004e0203) {
+               cur_cpu_spec->cpu_features |= CPU_FTR_P9_TM_HV_ASSIST;
+               cur_cpu_spec->cpu_features |= CPU_FTR_P9_TM_XER_SO_BUG;
+               cur_cpu_spec->cpu_features |= CPU_FTR_POWER9_DD2_1;
        } else if ((version & 0xffff0000) == 0x004e0000) {
                /* DD2.1 and up have DD2_1 */
                cur_cpu_spec->cpu_features |= CPU_FTR_POWER9_DD2_1;
        }
 
        if ((version & 0xffff0000) == 0x004e0000) {
-               cur_cpu_spec->cpu_features &= ~(CPU_FTR_DAWR);
                cur_cpu_spec->cpu_features |= CPU_FTR_P9_TIDR;
        }