Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

powerpc: Don't try to set LPCR unless we're in hypervisor mode

Commit 8f619b5429d9 ("powerpc/ppc64: Do not turn AIL (reloc-on
interrupts) too early") added code to set the AIL bit in the LPCR
without checking whether the kernel is running in hypervisor mode. The
result is that when the kernel is running as a guest (i.e., under
PowerKVM or PowerVM), the processor takes a privileged instruction
interrupt at that point, causing a panic. The visible result is that
the kernel hangs after printing "returning from prom_init".

This fixes it by checking for hypervisor mode being available before
setting LPCR. If we are not in hypervisor mode, we enable relocation-on
interrupts later in pSeries_setup_arch using the H_SET_MODE hcall.

Signed-off-by: Paul Mackerras <paulus@samba.org>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Paul Mackerras and committed by
Linus Torvalds
18aa0da3 d7e8af1a

+2 -1
+2 -1
arch/powerpc/kernel/setup_64.c
··· 201 201 get_paca()->kernel_msr = MSR_KERNEL; 202 202 203 203 /* Enable AIL if supported */ 204 - if (cpu_has_feature(CPU_FTR_ARCH_207S)) { 204 + if (cpu_has_feature(CPU_FTR_HVMODE) && 205 + cpu_has_feature(CPU_FTR_ARCH_207S)) { 205 206 unsigned long lpcr = mfspr(SPRN_LPCR); 206 207 mtspr(SPRN_LPCR, lpcr | LPCR_AIL_3); 207 208 }