File tree Expand file tree Collapse file tree 2 files changed +8
-9
lines changed Expand file tree Collapse file tree 2 files changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -1115,9 +1115,8 @@ void hash__early_init_mmu_secondary(void)
1115
1115
&& cpu_has_feature (CPU_FTR_HVMODE ))
1116
1116
tlbiel_all ();
1117
1117
1118
- #ifdef CONFIG_PPC_MEM_KEYS
1119
- mtspr (SPRN_UAMOR , default_uamor );
1120
- #endif
1118
+ if (IS_ENABLED (CONFIG_PPC_MEM_KEYS ) && mmu_has_feature (MMU_FTR_PKEY ))
1119
+ mtspr (SPRN_UAMOR , default_uamor );
1121
1120
}
1122
1121
#endif /* CONFIG_SMP */
1123
1122
Original file line number Diff line number Diff line change @@ -73,12 +73,6 @@ static int scan_pkey_feature(void)
73
73
if (early_radix_enabled ())
74
74
return 0 ;
75
75
76
- /*
77
- * Only P7 and above supports SPRN_AMR update with MSR[PR] = 1
78
- */
79
- if (!early_cpu_has_feature (CPU_FTR_ARCH_206 ))
80
- return 0 ;
81
-
82
76
ret = of_scan_flat_dt (dt_scan_storage_keys , & pkeys_total );
83
77
if (ret == 0 ) {
84
78
/*
@@ -124,6 +118,12 @@ void __init pkey_early_init_devtree(void)
124
118
__builtin_popcountl (ARCH_VM_PKEY_FLAGS >> VM_PKEY_SHIFT )
125
119
!= (sizeof (u64 ) * BITS_PER_BYTE ));
126
120
121
+ /*
122
+ * Only P7 and above supports SPRN_AMR update with MSR[PR] = 1
123
+ */
124
+ if (!early_cpu_has_feature (CPU_FTR_ARCH_206 ))
125
+ return ;
126
+
127
127
/* scan the device tree for pkey feature */
128
128
pkeys_total = scan_pkey_feature ();
129
129
if (!pkeys_total )
You can’t perform that action at this time.
0 commit comments