diff options
author | Paul Mackerras <paulus@samba.org> | 2014-04-11 16:29:45 +1000 |
---|---|---|
committer | Eli Qiao <taget@linux.vnet.ibm.com> | 2014-04-11 16:43:43 +0800 |
commit | 45a88bf8a35a84c91115c328c8d797ada0f14098 (patch) | |
tree | 82035e4549496522c65c8cfd27a019a2b4df12ea | |
parent | 9b2d298a1fe9d61e9fcacc9511926646b540b627 (diff) | |
download | powerkvm-45a88bf8a35a84c91115c328c8d797ada0f14098.tar.gz |
powerpc: Don't try to set LPCR unless we're in hypervisor mode
Commit c7062d83fe7b ("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.
This fixes BZ 108728.
Signed-off-by: Paul Mackerras <paulus@samba.org>
-rw-r--r-- | arch/powerpc/kernel/setup_64.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c index da13e02864262..5571bf73e9911 100644 --- a/arch/powerpc/kernel/setup_64.c +++ b/arch/powerpc/kernel/setup_64.c @@ -171,7 +171,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); } |