Revert "ARM: 6943/1: mm: use TTBR1 instead of reserved context ID"
This reverts commit52af9c6cd8
. Will Deacon reports that: In52af9c6c
("ARM: 6943/1: mm: use TTBR1 instead of reserved context ID") I updated the ASID rollover code to use only the kernel page tables whilst updating the ASID. Unfortunately, the code to restore the user page tables was part of a later patch which isn't yet in mainline, so this leaves the code quite broken. We're also in the process of eliminating __ARCH_WANT_INTERRUPTS_ON_CTXSW from ARM, so lets revert these until we can properly sort out what we're doing with the ARM context switching. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
This commit is contained in:
@@ -24,7 +24,9 @@ DEFINE_PER_CPU(struct mm_struct *, current_mm);
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* We fork()ed a process, and we need a new context for the child
|
* We fork()ed a process, and we need a new context for the child
|
||||||
* to run in.
|
* to run in. We reserve version 0 for initial tasks so we will
|
||||||
|
* always allocate an ASID. The ASID 0 is reserved for the TTBR
|
||||||
|
* register changing sequence.
|
||||||
*/
|
*/
|
||||||
void __init_new_context(struct task_struct *tsk, struct mm_struct *mm)
|
void __init_new_context(struct task_struct *tsk, struct mm_struct *mm)
|
||||||
{
|
{
|
||||||
@@ -34,11 +36,8 @@ void __init_new_context(struct task_struct *tsk, struct mm_struct *mm)
|
|||||||
|
|
||||||
static void flush_context(void)
|
static void flush_context(void)
|
||||||
{
|
{
|
||||||
u32 ttb;
|
/* set the reserved ASID before flushing the TLB */
|
||||||
/* Copy TTBR1 into TTBR0 */
|
asm("mcr p15, 0, %0, c13, c0, 1\n" : : "r" (0));
|
||||||
asm volatile("mrc p15, 0, %0, c2, c0, 1\n"
|
|
||||||
"mcr p15, 0, %0, c2, c0, 0"
|
|
||||||
: "=r" (ttb));
|
|
||||||
isb();
|
isb();
|
||||||
local_flush_tlb_all();
|
local_flush_tlb_all();
|
||||||
if (icache_is_vivt_asid_tagged()) {
|
if (icache_is_vivt_asid_tagged()) {
|
||||||
|
@@ -108,16 +108,18 @@ ENTRY(cpu_v7_switch_mm)
|
|||||||
#ifdef CONFIG_ARM_ERRATA_430973
|
#ifdef CONFIG_ARM_ERRATA_430973
|
||||||
mcr p15, 0, r2, c7, c5, 6 @ flush BTAC/BTB
|
mcr p15, 0, r2, c7, c5, 6 @ flush BTAC/BTB
|
||||||
#endif
|
#endif
|
||||||
mrc p15, 0, r2, c2, c0, 1 @ load TTB 1
|
#ifdef CONFIG_ARM_ERRATA_754322
|
||||||
mcr p15, 0, r2, c2, c0, 0 @ into TTB 0
|
dsb
|
||||||
|
#endif
|
||||||
|
mcr p15, 0, r2, c13, c0, 1 @ set reserved context ID
|
||||||
|
isb
|
||||||
|
1: mcr p15, 0, r0, c2, c0, 0 @ set TTB 0
|
||||||
isb
|
isb
|
||||||
#ifdef CONFIG_ARM_ERRATA_754322
|
#ifdef CONFIG_ARM_ERRATA_754322
|
||||||
dsb
|
dsb
|
||||||
#endif
|
#endif
|
||||||
mcr p15, 0, r1, c13, c0, 1 @ set context ID
|
mcr p15, 0, r1, c13, c0, 1 @ set context ID
|
||||||
isb
|
isb
|
||||||
mcr p15, 0, r0, c2, c0, 0 @ set TTB 0
|
|
||||||
isb
|
|
||||||
#endif
|
#endif
|
||||||
mov pc, lr
|
mov pc, lr
|
||||||
ENDPROC(cpu_v7_switch_mm)
|
ENDPROC(cpu_v7_switch_mm)
|
||||||
|
Reference in New Issue
Block a user