summaryrefslogtreecommitdiffstats
path: root/arch/arm64/mm
diff options
context:
space:
mode:
authorCatalin Marinas <catalin.marinas@arm.com>2015-06-12 11:24:41 +0100
committerCatalin Marinas <catalin.marinas@arm.com>2015-06-12 15:36:18 +0100
commit565630d503ef24e44c252bed55571b3a0d68455f (patch)
treefbd1c12f5bf48144cfc29c7c7d59aecae42c67b2 /arch/arm64/mm
parent8a14849b4a355278f0b7baf6e2da7dc7144a23e8 (diff)
downloadop-kernel-dev-565630d503ef24e44c252bed55571b3a0d68455f.zip
op-kernel-dev-565630d503ef24e44c252bed55571b3a0d68455f.tar.gz
arm64: Do not attempt to use init_mm in reset_context()
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> Cc: <stable@vger.kernel.org>
Diffstat (limited to 'arch/arm64/mm')
-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 baa758d..76c1e6c 100644
--- a/arch/arm64/mm/context.c
+++ b/arch/arm64/mm/context.c
@@ -92,6 +92,14 @@ static void reset_context(void *info)
unsigned int cpu = smp_processor_id();
struct mm_struct *mm = current->active_mm;
+ /*
+ * current->active_mm could be init_mm for the idle thread immediately
+ * after secondary CPU boot or hotplug. TTBR0_EL1 is already set to
+ * the reserved value, so no need to reset any context.
+ */
+ if (mm == &init_mm)
+ return;
+
smp_rmb();
asid = cpu_last_asid + cpu;
OpenPOWER on IntegriCloud