]> Git Repo - linux.git/commitdiff
powerpc: Don't try to set LPCR unless we're in hypervisor mode
authorPaul Mackerras <[email protected]>
Fri, 11 Apr 2014 06:43:35 +0000 (16:43 +1000)
committerLinus Torvalds <[email protected]>
Sun, 13 Apr 2014 00:58:48 +0000 (17:58 -0700)
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 <[email protected]>
Acked-by: Benjamin Herrenschmidt <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
arch/powerpc/kernel/setup_64.c

index 3d7a50a08f5e17d080f701ff4a14a39da39aa6a1..fbe24377eda3e4f268d6074e0803dd0891c8c416 100644 (file)
@@ -201,7 +201,8 @@ static void cpu_ready_for_interrupts(void)
        get_paca()->kernel_msr = MSR_KERNEL;
 
        /* Enable AIL if supported */
-       if (cpu_has_feature(CPU_FTR_ARCH_207S)) {
+       if (cpu_has_feature(CPU_FTR_HVMODE) &&
+           cpu_has_feature(CPU_FTR_ARCH_207S)) {
                unsigned long lpcr = mfspr(SPRN_LPCR);
                mtspr(SPRN_LPCR, lpcr | LPCR_AIL_3);
        }
This page took 0.058369 seconds and 4 git commands to generate.