aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorCatalin Marinas <catalin.marinas@arm.com>2015-06-12 06:24:41 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-07-21 13:10:03 -0400
commiteeac30f17f468292f1141c6f5d95afc38a18260f (patch)
tree0a63b35c115efaf8470e4f006ad0bf35655f5c70 /arch
parent6bc62fd9b8493bd6a07bb73a5d63ed28fea40b78 (diff)
arm64: Do not attempt to use init_mm in reset_context()
commit 565630d503ef24e44c252bed55571b3a0d68455f upstream. After secondary CPU boot or hotplug, the active_mm of the idle thread is &init_mm. The init_mm.pgd (swapper_pg_dir) is only meant for TTBR1_EL1 and must not be set in TTBR0_EL1. Since when active_mm == &init_mm the TTBR0_EL1 is already set to the reserved value, there is no need to perform any context reset. Signed-off-by: Catalin Marinas <catalin.marinas@arm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm64/mm/context.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/arch/arm64/mm/context.c b/arch/arm64/mm/context.c
index baa758d37021..76c1e6cd36fc 100644
--- a/arch/arm64/mm/context.c
+++ b/arch/arm64/mm/context.c
@@ -92,6 +92,14 @@ static void reset_context(void *info)
92 unsigned int cpu = smp_processor_id(); 92 unsigned int cpu = smp_processor_id();
93 struct mm_struct *mm = current->active_mm; 93 struct mm_struct *mm = current->active_mm;
94 94
95 /*
96 * current->active_mm could be init_mm for the idle thread immediately
97 * after secondary CPU boot or hotplug. TTBR0_EL1 is already set to
98 * the reserved value, so no need to reset any context.
99 */
100 if (mm == &init_mm)
101 return;
102
95 smp_rmb(); 103 smp_rmb();
96 asid = cpu_last_asid + cpu; 104 asid = cpu_last_asid + cpu;
97 105