Skip to content

Commit c0a3601

Browse files
ozbenhmpe
authored andcommitted
powerpc/64: Fix setting of AIL in hypervisor mode
Commit d3cbff1 "powerpc: Put exception configuration in a common place" broke the setting of the AIL bit (which enables taking exceptions with the MMU still on) on all processors, moving it incorrectly to a function called only on the boot CPU. This was correct for the guest case but not when running in hypervisor mode. This fixes it by partially reverting that commit, putting the setting back in cpu_ready_for_interrupts() Fixes: d3cbff1 ("powerpc: Put exception configuration in a common place") Cc: stable@vger.kernel.org # v4.8+ Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
1 parent 2ffd04d commit c0a3601

1 file changed

Lines changed: 14 additions & 6 deletions

File tree

arch/powerpc/kernel/setup_64.c

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -226,17 +226,25 @@ static void __init configure_exceptions(void)
226226
if (firmware_has_feature(FW_FEATURE_OPAL))
227227
opal_configure_cores();
228228

229-
/* Enable AIL if supported, and we are in hypervisor mode */
230-
if (early_cpu_has_feature(CPU_FTR_HVMODE) &&
231-
early_cpu_has_feature(CPU_FTR_ARCH_207S)) {
232-
unsigned long lpcr = mfspr(SPRN_LPCR);
233-
mtspr(SPRN_LPCR, lpcr | LPCR_AIL_3);
234-
}
229+
/* AIL on native is done in cpu_ready_for_interrupts() */
235230
}
236231
}
237232

238233
static void cpu_ready_for_interrupts(void)
239234
{
235+
/*
236+
* Enable AIL if supported, and we are in hypervisor mode. This
237+
* is called once for every processor.
238+
*
239+
* If we are not in hypervisor mode the job is done once for
240+
* the whole partition in configure_exceptions().
241+
*/
242+
if (early_cpu_has_feature(CPU_FTR_HVMODE) &&
243+
early_cpu_has_feature(CPU_FTR_ARCH_207S)) {
244+
unsigned long lpcr = mfspr(SPRN_LPCR);
245+
mtspr(SPRN_LPCR, lpcr | LPCR_AIL_3);
246+
}
247+
240248
/* Set IR and DR in PACA MSR */
241249
get_paca()->kernel_msr = MSR_KERNEL;
242250
}

0 commit comments

Comments
 (0)