Skip to content

Commit

Permalink
powerpc/ppc64: Do not turn AIL (reloc-on interrupts) too early
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Benjamin Herrenschmidt committed Apr 7, 2014
1 parent a944a9c commit 8f619b5
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
2 changes: 0 additions & 2 deletions arch/powerpc/kernel/cpu_setup_power.S
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
18 changes: 15 additions & 3 deletions arch/powerpc/kernel/setup_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,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
Expand Down Expand Up @@ -264,9 +276,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();
Expand Down Expand Up @@ -307,7 +319,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 */
Expand Down

0 comments on commit 8f619b5

Please sign in to comment.