Return-Path: Received: from mail-wi0-f172.google.com ([209.85.212.172]:35320 "EHLO mail-wi0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752817AbbG0IWZ (ORCPT ); Mon, 27 Jul 2015 04:22:25 -0400 Received: by wibxm9 with SMTP id xm9so101068674wib.0 for ; Mon, 27 Jul 2015 01:22:24 -0700 (PDT) Received: from ?IPv6:2a01:4240:53f0:43fb::cbb? (b.b.c.0.0.0.0.0.0.0.0.0.0.0.0.0.b.f.3.4.0.f.3.5.0.4.2.4.1.0.a.2.v6.cust.nbox.cz. [2a01:4240:53f0:43fb::cbb]) by smtp.gmail.com with ESMTPSA id fa8sm12272665wib.14.2015.07.27.01.22.23 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 Jul 2015 01:22:24 -0700 (PDT) From: "Jiri Slaby" To: Cc: "Catalin Marinas" Subject: [patch added to the 3.12 stable tree] arm64: Do not attempt to use init_mm in reset_context() Date: Mon, 27 Jul 2015 10:02:19 +0200 Message-Id: <1437984150-15702-38-git-send-email-jslaby@suse.com> In-Reply-To: <1437984150-15702-1-git-send-email-jslaby@suse.com> References: <1437984150-15702-1-git-send-email-jslaby@suse.com> Sender: stable-owner@vger.kernel.org List-ID: From: Catalin Marinas This patch has been added to the 3.12 stable tree. If you have any objections, please let us know. =============== 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 Signed-off-by: Jiri Slaby --- arch/arm64/mm/context.c | 8 ++++++++ 1 file changed, 8 insertions(+) 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) 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; -- 2.4.6