Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp457236imu; Wed, 12 Dec 2018 21:25:33 -0800 (PST) X-Google-Smtp-Source: AFSGD/UN+8TtVqTsVcL1V314CBTcCfVmlnqfeks0gTihkCCv8jpB2jjYygrVbKs/dunhZ2w6U7PQ X-Received: by 2002:a17:902:a6:: with SMTP id a35mr22395640pla.201.1544678733701; Wed, 12 Dec 2018 21:25:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544678733; cv=none; d=google.com; s=arc-20160816; b=xNkBY7lW6mfLYErv5/TB5/NGH0aNksLClUnhQLHH9Yz+EOvoG7+KTm4is0mqA+CNqm UBTMAaQO2+w7Z6nDnx9KJZi0kRtPd8s5zlUsBSyq0nZMyXj6IGfFPiNXEvqq5Xi0Un9P Vv7Y3PEPtsOQVfexi6dfAzDgftLgrqOl5MoT7p9iNzZBu7F7qBNSPf9L36t2T8z6rJFA uraKQsfHy0dwOcgpa5wpUENaTJKpZaRr7Y7RcNioYjcpXLJJ4wJrN4oVIK97k54jwCWM 8lnUXMYPaU8qO7ltnWNuNeGsvu8PVqMUXKw7sQnzbQW1zvQdzt3HWhZhOS6WYGdAS7FQ Nw4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=T+bov1s7uPUUt2flzevFiGtl1wqIIJ2TOIfomd+w+To=; b=QuJ2EGVziteBXGUfiROOtq/YfOQ0goTICxGDZtPJk8FxzIdl9v9oUI68qbIxmTws1C XIM+eaGWwIqiwBtiPgGXGKmRJk7yPhoc7qosJa5VBKK5iQDm03fdXpd9YQyAxf74/Qlc D4FUMxNfP03bS3HCVmvzkJ+ChxfaROTrxxfFXegVcUO19rwrs0Uwt+mDBI9LdO/EBlJn QLGMdttUiaNXnJKwbMKtnoWD3Rs+S3c6abqc+KsqMRharBv9w9SioDWNAuVkIIr6BnWO DsfTLN4WqyptW94shs6k/WlB8NMAAeuPfU3/DYrAlINcBSCQNxxUICFsae+i9WxSJzl/ S9UQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lca.pw header.s=google header.b=Dj9m70el; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p12si714710plk.77.2018.12.12.21.25.16; Wed, 12 Dec 2018 21:25:33 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@lca.pw header.s=google header.b=Dj9m70el; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726895AbeLMFXU (ORCPT + 99 others); Thu, 13 Dec 2018 00:23:20 -0500 Received: from mail-qt1-f194.google.com ([209.85.160.194]:46741 "EHLO mail-qt1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726226AbeLMFXT (ORCPT ); Thu, 13 Dec 2018 00:23:19 -0500 Received: by mail-qt1-f194.google.com with SMTP id y20so822271qtm.13 for ; Wed, 12 Dec 2018 21:23:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lca.pw; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=T+bov1s7uPUUt2flzevFiGtl1wqIIJ2TOIfomd+w+To=; b=Dj9m70eleoZgBa8BKuA1YWEPUTpmJnw/74UHJOuBoD5eqOrACBo9OZIeQy6rZqX8vV xkWDwoYJRFOoySx9t0MJlH7lX1r7UXY1PQFuRdglNHjyJo33DSt/t/KzOdEeNheFIfbw 95tzZeaCQql9OE9OgzsaKZpwPv/sJvyYGX2xmxdz1LRwZhSaN+FjVS6/4dWn5fH8hng5 /lb4X0x8BT+xk4MuS0uI82bN+L0T/qxexHYFSx4k52Z8cIrsYE5bBQ+y48ozint0D619 SifA6g8TkQoVniVsHZ5/ehsWF2kzadkYYpF4Y8gl2VhO1q6y2KWETqFnX3kmUNIPQ6dR rIVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=T+bov1s7uPUUt2flzevFiGtl1wqIIJ2TOIfomd+w+To=; b=uPzoJePrxio28j7a/PxYhIbhqK3QDdyBTADkqvqO8C+icSoirz2Tn0N2DMyamo48Z8 9uauzdqmFhI2rcut/daUzml4Pdjo/qtUeYsTQzPNKYRVctGrnyDOl2n9Fsqb8ipvg+0Y BsbNrzZQI+glsyy8FjpIQjQxm+jfqCuN0LJ73GJ3xnRf4/XpRh2BbhyG4IA+vrKxMc7z vFpHbKU2V1UAA0xBPUMPrlrxWabnyjBy+YO+RSv25QbzUhu1kIuJWIQQd6NmFHoLWvrb RiYy7j2RrVEibOA4fuIVJ9uaf8nDucr+ITiJf8NAbWtEFMxVvyBgIm0mkKhoAzD1eHxr V27g== X-Gm-Message-State: AA+aEWZ4E8fbEn+I3IiHod5Jc5yNdwQj6QEySdldRw7V29Xx73j9H9vg X+trLJmukgv6IiyLMzO8xXra1Q== X-Received: by 2002:a0c:9239:: with SMTP id a54mr21531273qva.17.1544678598851; Wed, 12 Dec 2018 21:23:18 -0800 (PST) Received: from ovpn-121-90.rdu2.redhat.com (pool-71-184-117-43.bstnma.fios.verizon.net. [71.184.117.43]) by smtp.gmail.com with ESMTPSA id u4sm460607qkk.51.2018.12.12.21.23.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 12 Dec 2018 21:23:18 -0800 (PST) From: Qian Cai To: catalin.marinas@arm.com, will.deacon@arm.com Cc: marc.zyngier@arm.com, james.morse@arm.com, takahiro.akashi@linaro.org, ard.biesheuvel@linaro.org, linux-arm-kernel@lists.infradead.org, kexec@lists.infradead.org, linux-kernel@vger.kernel.org, Qian Cai Subject: [PATCH] arm64: invalidate TLB before turning MMU on Date: Thu, 13 Dec 2018 00:22:59 -0500 Message-Id: <20181213052259.56352-1-cai@lca.pw> X-Mailer: git-send-email 2.17.2 (Apple Git-113) In-Reply-To: <1544654224.18411.11.camel@lca.pw> References: <1544654224.18411.11.camel@lca.pw> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On this HPE Apollo 70 arm64 server with 256 CPUs, triggering a crash dump just hung. It has 4 threads on each core. Each 2-core share a same L1 and L2 caches, so that is 8 CPUs shares those. All CPUs share a same L3 cache. It turned out that this was due to the TLB contained stale entries (or uninitialized junk which just happened to look valid) from the first kernel before turning the MMU on in the second kernel which caused this instruction hung, msr sctlr_el1, x0 Signed-off-by: Qian Cai --- arch/arm64/kernel/head.S | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/arm64/kernel/head.S b/arch/arm64/kernel/head.S index 4471f570a295..5196f3d729de 100644 --- a/arch/arm64/kernel/head.S +++ b/arch/arm64/kernel/head.S @@ -771,6 +771,10 @@ ENTRY(__enable_mmu) msr ttbr0_el1, x2 // load TTBR0 msr ttbr1_el1, x1 // load TTBR1 isb + dsb nshst + tlbi vmalle1 // invalidate TLB + dsb nsh + isb msr sctlr_el1, x0 isb /* -- 2.17.2 (Apple Git-113)