Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp4179169imm; Mon, 30 Jul 2018 09:58:57 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdO2wyKkmrxM5qpQuJ7e7dq03o5CP4tWaee3sw8ve74oZqOGRe5EH2kV3Mjxh2Ua7ob7+E5 X-Received: by 2002:a17:902:7482:: with SMTP id h2-v6mr17435985pll.185.1532969937745; Mon, 30 Jul 2018 09:58:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532969937; cv=none; d=google.com; s=arc-20160816; b=gD8BTHbVa7kOJOfu2B8FULwSqFy/q4PLpGf1Zy/jZccoesFUtF3aCIj41zVqijTJXB pSeBs08KLMwuTSwenyuKcZ5zev+xzgDnLSgNOw87pQYb3BFzX+Nw2wHwCbyKTePmb4OD J2i5yPrR5ZIFV/t6Em/jzRBAvYl17Xqzb1iXB/XrqKbJVs3ih5+YsexBksoPAGQMklzC p76KjH3gvuTL1gX/zPURxWD40rffln1MbchUnU7y5qohn28bPG0gh8qfrdRQ+HfvjryE r3hLBSf0RJJPbaOUQxen7cObuJdDKOHCi1q0/EeyRjlXzXUwdTCXA01CM+hqN0TWfKim 1xUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=A1D396pMRjJQ/86/4LDKbOFXzZ8sXCLy3XK4jEzpPDE=; b=D4b3rE/0yJ6Rypj8gOWDI/RLwT00PzlM7uA49iHrnl1pQqdbdDExW4bGw2s/coQcov YfZl9V+N1OGgrDMPaNs+8Sggm/Sq8wCCKxcyIUfmL7760AKtbr8oqF3CJJ1SpyBv0y1g xDgtFFZ2H9WntHMl2AuQQA9PwERPJVqMr/oYT4eMeFFcUcNrBcxFRtDhVro5T8ctayFt QKwkCsACs372wA/c19mYYsw9WkbFOzpaWxsmpUcaNoKiipZgHKkS7FOoCRDRKP6OLdDA CXPcExaFZmFRZ2z7RT7f7oRMocACAD9j3MCITXAQYBNUppzamYxjtEALRu0oAbjih5bi LGcA== ARC-Authentication-Results: i=1; mx.google.com; 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 35-v6si10369632pla.453.2018.07.30.09.58.43; Mon, 30 Jul 2018 09:58:57 -0700 (PDT) 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; 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 S1728801AbeG3Sdu (ORCPT + 99 others); Mon, 30 Jul 2018 14:33:50 -0400 Received: from foss.arm.com ([217.140.101.70]:42694 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726668AbeG3Sdt (ORCPT ); Mon, 30 Jul 2018 14:33:49 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 8A6907A9; Mon, 30 Jul 2018 09:57:56 -0700 (PDT) Received: from edgewater-inn.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 5B7903F5D0; Mon, 30 Jul 2018 09:57:56 -0700 (PDT) Received: by edgewater-inn.cambridge.arm.com (Postfix, from userid 1000) id F0B261AE2F47; Mon, 30 Jul 2018 17:57:57 +0100 (BST) Date: Mon, 30 Jul 2018 17:57:57 +0100 From: Will Deacon To: Dave Kleikamp Cc: Catalin Marinas , AKASHI Takahiro , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH 1/1] arm64: kexec: machine_kexec should call __flush_icache_range Message-ID: <20180730165757.GF4276@arm.com> References: <20180730161641.6zxxy3lxp27tznck@armageddon.cambridge.arm.com> <20180730162235.GC4276@arm.com> <2651847f-79ea-fe2a-c1d7-efe4d11702b4@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2651847f-79ea-fe2a-c1d7-efe4d11702b4@oracle.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 30, 2018 at 11:46:24AM -0500, Dave Kleikamp wrote: > On 07/30/2018 11:22 AM, Will Deacon wrote: > > On Mon, Jul 30, 2018 at 05:16:42PM +0100, Catalin Marinas wrote: > >> On Mon, Jul 30, 2018 at 10:29:21AM -0500, Dave Kleikamp wrote: > >>> machine_kexec flushes the reboot_code_buffer from the icache > >>> after stopping the other cpus. > >>> > >>> Commit 3b8c9f1cdfc5 ("arm64: IPI each CPU after invalidating the I-cache > >>> for kernel mappings") added an IPI call to flush_icache_range, which > >>> causes a hang here, so replace the call with __flush_icache_range > >> > >> While machine_kexec() may be called with interrupts disabled (IIUC) and > >> we shouldn't IPI other CPUs, I don't understand why it hangs here. Are > >> there any other CPUs online at this point? > > > > The BUG_ON and WARN_ON at the start of machine_kexec() suggest to me that > > this should only happen if we're kexec'ing a crash kernel and > > smp_crash_stop_failed(). Is that something we need to care about? > > I observed the hang trying to kexec a crash kernel and I did not see the > warning that smp_crash_stop_failed(). I'm not exactly sure why > flush_icache_range() hung (but it did), but I think that > __flush_icache_range() makes more sense here anyway. Yeah, I'll pick the patch up, but it would be nice to understand the failure case you observed. Will