diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2014-03-29 08:38:40 +1100 |
---|---|---|
committer | Eli Qiao <taget@linux.vnet.ibm.com> | 2014-03-31 11:16:42 +0800 |
commit | c7062d83fe7b9beaf4e848a2c92321f462ab54ae (patch) | |
tree | 67ad6c88ca0b349958aafcad4f01f7be9da3a63c | |
parent | 4d2c729771c7758335700a7c244314d8a50fa4cd (diff) | |
download | powerkvm-c7062d83fe7b9beaf4e848a2c92321f462ab54ae.tar.gz |
powerpc/ppc64: Do not turn AIL (reloc-on interrupts) too early
Turn them on at the same time as we allow MSR_IR/DR in the paca
kernel MSR, ie, after the MMU has been setup enough to be able
to handle relocated access to the linear mapping.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
-rw-r--r-- | arch/powerpc/kernel/cpu_setup_power.S | 2 | ||||
-rw-r--r-- | arch/powerpc/kernel/setup_64.c | 18 |
2 files changed, 15 insertions, 5 deletions
diff --git a/arch/powerpc/kernel/cpu_setup_power.S b/arch/powerpc/kernel/cpu_setup_power.S index 37d1bb002aa97..1557e7c2c7e15 100644 --- a/arch/powerpc/kernel/cpu_setup_power.S +++ b/arch/powerpc/kernel/cpu_setup_power.S @@ -56,7 +56,6 @@ _GLOBAL(__setup_cpu_power8) li r0,0 mtspr SPRN_LPID,r0 mfspr r3,SPRN_LPCR - oris r3, r3, LPCR_AIL_3@h bl __init_LPCR bl __init_HFSCR bl __init_tlb_power8 @@ -75,7 +74,6 @@ _GLOBAL(__restore_cpu_power8) li r0,0 mtspr SPRN_LPID,r0 mfspr r3,SPRN_LPCR - oris r3, r3, LPCR_AIL_3@h bl __init_LPCR bl __init_HFSCR bl __init_tlb_power8 diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c index 63741bf57d009..da13e02864262 100644 --- a/arch/powerpc/kernel/setup_64.c +++ b/arch/powerpc/kernel/setup_64.c @@ -165,6 +165,18 @@ static void fixup_boot_paca(void) get_paca()->data_offset = 0; } +static void cpu_ready_for_interrupts(void) +{ + /* Set IR and DR in PACA MSR */ + get_paca()->kernel_msr = MSR_KERNEL; + + /* Enable AIL if supported */ + if (cpu_has_feature(CPU_FTR_ARCH_207S)) { + unsigned long lpcr = mfspr(SPRN_LPCR); + mtspr(SPRN_LPCR, lpcr | LPCR_AIL_3); + } +} + /* * Early initialization entry point. This is called by head.S * with MMU translation disabled. We rely on the "feature" of @@ -232,9 +244,9 @@ void __init early_setup(unsigned long dt_ptr) /* * At this point, we can let interrupts switch to virtual mode * (the MMU has been setup), so adjust the MSR in the PACA to - * have IR and DR set. + * have IR and DR set and enable AIL if it exists */ - get_paca()->kernel_msr = MSR_KERNEL; + cpu_ready_for_interrupts(); /* Reserve large chunks of memory for use by CMA for KVM */ kvm_cma_reserve(); @@ -263,7 +275,7 @@ void early_setup_secondary(void) * (the MMU has been setup), so adjust the MSR in the PACA to * have IR and DR set. */ - get_paca()->kernel_msr = MSR_KERNEL; + cpu_ready_for_interrupts(); } #endif /* CONFIG_SMP */ |