Merge tag 'powerpc-6.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux

Pull powerpc fixes from Madhavan Srinivasan:

- Fix for kexec warning due to SMT disable or partial SMT enabled

- Handle font bitmap pointer with reloc_offset to fix boot crash

- Fix to enable cpuidle state for Power11

- Couple of misc fixes

Thanks to Aboorva Devarajan, Aditya Bodkhe, Cedar Maxwell, Christian
Zigotzky, Christophe Leroy, Christophe Leroy (CS GROUP), Finn Thain,
Gopi Krishna Menon, Guenter Roeck, Jan Stancek, Joe Lawrence, Josh
Poimboeuf, Justin M. Forbes, Madadi Vineeth Reddy, Naveen N Rao (AMD),
Nysal Jan K.A., Sachin P Bappalige, Samir M, Sourabh Jain, Srikar
Dronamraju, and Stan Johnson

* tag 'powerpc-6.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
powerpc/32: Restore disabling of interrupts at interrupt/syscall exit
powerpc/powernv: Enable cpuidle state detection for POWER11
powerpc: Add reloc_offset() to font bitmap pointer used for bootx_printf()
powerpc/tools: drop `-o pipefail` in gcc check scripts
selftests/powerpc/pmu/: Add check_extended_reg_test to .gitignore
powerpc/kexec: Enable SMT before waking offline CPUs

+33 -24
+1 -1
arch/powerpc/include/asm/hw_irq.h
··· 90 if (IS_ENABLED(CONFIG_BOOKE)) 91 wrtee(0); 92 else if (IS_ENABLED(CONFIG_PPC_8xx)) 93 - wrtspr(SPRN_NRI); 94 else if (IS_ENABLED(CONFIG_PPC_BOOK3S_64)) 95 __mtmsrd(0, 1); 96 else
··· 90 if (IS_ENABLED(CONFIG_BOOKE)) 91 wrtee(0); 92 else if (IS_ENABLED(CONFIG_PPC_8xx)) 93 + wrtspr_sync(SPRN_NRI); 94 else if (IS_ENABLED(CONFIG_PPC_BOOK3S_64)) 95 __mtmsrd(0, 1); 96 else
+1
arch/powerpc/include/asm/reg.h
··· 1400 : "r" ((unsigned long)(v)) \ 1401 : "memory") 1402 #define wrtspr(rn) asm volatile("mtspr " __stringify(rn) ",2" : : : "memory") 1403 1404 static inline void wrtee(unsigned long val) 1405 {
··· 1400 : "r" ((unsigned long)(v)) \ 1401 : "memory") 1402 #define wrtspr(rn) asm volatile("mtspr " __stringify(rn) ",2" : : : "memory") 1403 + #define wrtspr_sync(rn) asm volatile("mtspr " __stringify(rn) ",2; sync" : : : "memory") 1404 1405 static inline void wrtee(unsigned long val) 1406 {
+2 -1
arch/powerpc/kernel/btext.c
··· 20 #include <asm/io.h> 21 #include <asm/processor.h> 22 #include <asm/udbg.h> 23 24 #define NO_SCROLL 25 ··· 464 { 465 unsigned char *base = calc_base(locX << 3, locY << 4); 466 unsigned int font_index = c * 16; 467 - const unsigned char *font = font_sun_8x16.data + font_index; 468 int rb = dispDeviceRowBytes; 469 470 rmci_maybe_on();
··· 20 #include <asm/io.h> 21 #include <asm/processor.h> 22 #include <asm/udbg.h> 23 + #include <asm/setup.h> 24 25 #define NO_SCROLL 26 ··· 463 { 464 unsigned char *base = calc_base(locX << 3, locY << 4); 465 unsigned int font_index = c * 16; 466 + const unsigned char *font = PTRRELOC(font_sun_8x16.data) + font_index; 467 int rb = dispDeviceRowBytes; 468 469 rmci_maybe_on();
-15
arch/powerpc/kernel/entry_32.S
··· 101 .endm 102 #endif 103 104 - .macro clr_ri trash 105 - #ifndef CONFIG_BOOKE 106 - #ifdef CONFIG_PPC_8xx 107 - mtspr SPRN_NRI, \trash 108 - #else 109 - li \trash, MSR_KERNEL & ~MSR_RI 110 - mtmsr \trash 111 - #endif 112 - #endif 113 - .endm 114 - 115 .globl transfer_to_syscall 116 transfer_to_syscall: 117 stw r3, ORIG_GPR3(r1) ··· 149 cmpwi r3,0 150 REST_GPR(3, r1) 151 syscall_exit_finish: 152 - clr_ri r4 153 mtspr SPRN_SRR0,r7 154 mtspr SPRN_SRR1,r8 155 ··· 225 /* Clear the exception marker on the stack to avoid confusing stacktrace */ 226 li r10, 0 227 stw r10, 8(r11) 228 - clr_ri r10 229 mtspr SPRN_SRR1,r9 230 mtspr SPRN_SRR0,r12 231 REST_GPR(9, r11) ··· 257 .Lfast_user_interrupt_return: 258 lwz r11,_NIP(r1) 259 lwz r12,_MSR(r1) 260 - clr_ri r4 261 mtspr SPRN_SRR0,r11 262 mtspr SPRN_SRR1,r12 263 ··· 299 cmpwi cr1,r3,0 300 lwz r11,_NIP(r1) 301 lwz r12,_MSR(r1) 302 - clr_ri r4 303 mtspr SPRN_SRR0,r11 304 mtspr SPRN_SRR1,r12 305
··· 101 .endm 102 #endif 103 104 .globl transfer_to_syscall 105 transfer_to_syscall: 106 stw r3, ORIG_GPR3(r1) ··· 160 cmpwi r3,0 161 REST_GPR(3, r1) 162 syscall_exit_finish: 163 mtspr SPRN_SRR0,r7 164 mtspr SPRN_SRR1,r8 165 ··· 237 /* Clear the exception marker on the stack to avoid confusing stacktrace */ 238 li r10, 0 239 stw r10, 8(r11) 240 mtspr SPRN_SRR1,r9 241 mtspr SPRN_SRR0,r12 242 REST_GPR(9, r11) ··· 270 .Lfast_user_interrupt_return: 271 lwz r11,_NIP(r1) 272 lwz r12,_MSR(r1) 273 mtspr SPRN_SRR0,r11 274 mtspr SPRN_SRR1,r12 275 ··· 313 cmpwi cr1,r3,0 314 lwz r11,_NIP(r1) 315 lwz r12,_MSR(r1) 316 mtspr SPRN_SRR0,r11 317 mtspr SPRN_SRR1,r12 318
+4 -1
arch/powerpc/kernel/interrupt.c
··· 38 #else 39 static inline bool exit_must_hard_disable(void) 40 { 41 - return false; 42 } 43 #endif 44 ··· 443 444 if (unlikely(stack_store)) 445 __hard_EE_RI_disable(); 446 #endif /* CONFIG_PPC64 */ 447 } 448
··· 38 #else 39 static inline bool exit_must_hard_disable(void) 40 { 41 + return true; 42 } 43 #endif 44 ··· 443 444 if (unlikely(stack_store)) 445 __hard_EE_RI_disable(); 446 + #else 447 + } else { 448 + __hard_EE_RI_disable(); 449 #endif /* CONFIG_PPC64 */ 450 } 451
+19
arch/powerpc/kexec/core_64.c
··· 202 mb(); 203 } 204 205 /* 206 * We need to make sure each present CPU is online. The next kernel will scan 207 * the device tree and assume primary threads are online and query secondary ··· 232 static void wake_offline_cpus(void) 233 { 234 int cpu = 0; 235 236 for_each_present_cpu(cpu) { 237 if (!cpu_online(cpu)) {
··· 202 mb(); 203 } 204 205 + 206 + /* 207 + * The add_cpu() call in wake_offline_cpus() can fail as cpu_bootable() 208 + * returns false for CPUs that fail the cpu_smt_thread_allowed() check 209 + * or non primary threads if SMT is disabled. Re-enable SMT and set the 210 + * number of SMT threads to threads per core. 211 + */ 212 + static void kexec_smt_reenable(void) 213 + { 214 + #if defined(CONFIG_SMP) && defined(CONFIG_HOTPLUG_SMT) 215 + lock_device_hotplug(); 216 + cpu_smt_num_threads = threads_per_core; 217 + cpu_smt_control = CPU_SMT_ENABLED; 218 + unlock_device_hotplug(); 219 + #endif 220 + } 221 + 222 /* 223 * We need to make sure each present CPU is online. The next kernel will scan 224 * the device tree and assume primary threads are online and query secondary ··· 215 static void wake_offline_cpus(void) 216 { 217 int cpu = 0; 218 + 219 + kexec_smt_reenable(); 220 221 for_each_present_cpu(cpu) { 222 if (!cpu_online(cpu)) {
+5 -4
arch/powerpc/platforms/powernv/idle.c
··· 1171 u64 max_residency_ns = 0; 1172 int i; 1173 1174 - /* stop is not really architected, we only have p9,p10 drivers */ 1175 - if (!pvr_version_is(PVR_POWER10) && !pvr_version_is(PVR_POWER9)) 1176 return; 1177 1178 /* ··· 1190 struct pnv_idle_states_t *state = &pnv_idle_states[i]; 1191 u64 psscr_rl = state->psscr_val & PSSCR_RL_MASK; 1192 1193 - /* No deep loss driver implemented for POWER10 yet */ 1194 - if (pvr_version_is(PVR_POWER10) && 1195 state->flags & (OPAL_PM_TIMEBASE_STOP|OPAL_PM_LOSE_FULL_CONTEXT)) 1196 continue; 1197
··· 1171 u64 max_residency_ns = 0; 1172 int i; 1173 1174 + /* stop is not really architected, we only have p9,p10 and p11 drivers */ 1175 + if (!pvr_version_is(PVR_POWER9) && !pvr_version_is(PVR_POWER10) && 1176 + !pvr_version_is(PVR_POWER11)) 1177 return; 1178 1179 /* ··· 1189 struct pnv_idle_states_t *state = &pnv_idle_states[i]; 1190 u64 psscr_rl = state->psscr_val & PSSCR_RL_MASK; 1191 1192 + /* No deep loss driver implemented for POWER10 and POWER11 yet */ 1193 + if ((pvr_version_is(PVR_POWER10) || pvr_version_is(PVR_POWER11)) && 1194 state->flags & (OPAL_PM_TIMEBASE_STOP|OPAL_PM_LOSE_FULL_CONTEXT)) 1195 continue; 1196
-1
arch/powerpc/tools/gcc-check-fpatchable-function-entry.sh
··· 2 # SPDX-License-Identifier: GPL-2.0 3 4 set -e 5 - set -o pipefail 6 7 # To debug, uncomment the following line 8 # set -x
··· 2 # SPDX-License-Identifier: GPL-2.0 3 4 set -e 5 6 # To debug, uncomment the following line 7 # set -x
-1
arch/powerpc/tools/gcc-check-mprofile-kernel.sh
··· 2 # SPDX-License-Identifier: GPL-2.0 3 4 set -e 5 - set -o pipefail 6 7 # To debug, uncomment the following line 8 # set -x
··· 2 # SPDX-License-Identifier: GPL-2.0 3 4 set -e 5 6 # To debug, uncomment the following line 7 # set -x
+1
tools/testing/selftests/powerpc/pmu/sampling_tests/.gitignore
··· 1 bhrb_filter_map_test 2 bhrb_no_crash_wo_pmu_test 3 intr_regs_no_crash_wo_pmu_test 4 mmcr0_cc56run_test 5 mmcr0_exceptionbits_test
··· 1 bhrb_filter_map_test 2 bhrb_no_crash_wo_pmu_test 3 + check_extended_reg_test 4 intr_regs_no_crash_wo_pmu_test 5 mmcr0_cc56run_test 6 mmcr0_exceptionbits_test