Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp4553566imm; Mon, 30 Jul 2018 17:30:21 -0700 (PDT) X-Google-Smtp-Source: AAOMgpc4I7iCCBm4WVPLhLetAHyg4BxyzDXov+uNOa+jPZyUf7jvd42EhAYO+iZNAdDp5Uf6FQw1 X-Received: by 2002:a17:902:7d8f:: with SMTP id a15-v6mr18527341plm.332.1532997021364; Mon, 30 Jul 2018 17:30:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532997021; cv=none; d=google.com; s=arc-20160816; b=xOnZ5f3tDDFQWMU/jx4a+csJEXuDTClf1mKJ9Y2iF86q70T1KSvMc6OrBbcfUWFFYO HruurnMTiLJRPPlBQeo4MaC6P/TgZLONXjgWYJKKtRwyHV31eDjuIRN5pAlCerT3I5R4 c1/UII5Da2RocPt1TtqdK/okC2yo371MgM1JU64z++7l49iLGGsYtb+ORgZoIDPbeCjq WNK5oM66G5VkA6wvDnDcpwTAxyTjZs5v2CSbnRKOoEsPM/Vk46YxMCj9dSHEWvSGOKyy jjXUNmSOO2OkRm0z7BZ44Gyjqiamxrq8Kr39rYhxon53y0s7LdEhXUTfTHXS1K/uHkjY qb2Q== 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:mail-followup-to :message-id:subject:cc:to:from:date:dkim-signature :arc-authentication-results; bh=WOEEzw6l0oxuJRtKoHZWTGuWWPrgJkNGEW0hNGZO7EU=; b=qiUMf+LrOmxelId/86A7ZGS0MyB2/GIzeBp0IQ/LNQlz9fgS7oEzzOn9zlUGG5N8xU MP4dRzhKiIJknrDHCf4FjyIMq9bSybuKGYj4o5lQBLb0s9+Xo1iP+GoBM+KXBnIUOsfi hQUv9z7i7J/3wyWikLIJoX3+MKzBOGpbuZ5npQFYZ8mvmkqybaSWXI0kGtSva85NxfPn YUpHhIhbOtn9Bx0SLOG8cIzzBi0tkfbGGWSfj4EU87I27NwTFNmgCly3unWm0xut80AF gC4xzb7+UMWfU3a9BhkJIHOLUdmG5lpnSKzQs1thHKQnDnkP3DuyjWjKOPufc3SublzM 8NsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RUtvH8Ze; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h15-v6si12088034pgh.566.2018.07.30.17.30.07; Mon, 30 Jul 2018 17:30:21 -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; dkim=pass header.i=@linaro.org header.s=google header.b=RUtvH8Ze; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732200AbeGaCG3 (ORCPT + 99 others); Mon, 30 Jul 2018 22:06:29 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:42205 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732078AbeGaCG3 (ORCPT ); Mon, 30 Jul 2018 22:06:29 -0400 Received: by mail-pf1-f196.google.com with SMTP id l9-v6so5265457pff.9 for ; Mon, 30 Jul 2018 17:28:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to:user-agent; bh=WOEEzw6l0oxuJRtKoHZWTGuWWPrgJkNGEW0hNGZO7EU=; b=RUtvH8ZelUucGqhKCV5IInr/pxCtefoPGZYinY006SyBz//4HKfhr/jXcxNJRv+Hp+ 9z5osLajceLY87+1qali79Rx3llu1xb1S6ANYU5WXYPT9Sj4bYdZKC32/Ve8Hy86V+Oj OgpKZ+yzc1X29n802oD+CPmNFwPOZv6GWKgG4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to:user-agent; bh=WOEEzw6l0oxuJRtKoHZWTGuWWPrgJkNGEW0hNGZO7EU=; b=pFMUxZcdwYTiyrGfX7ogCW8zyXrNdcWmAl/8C2ngUzXPpiWpJJp6chtRP/T8+wBx7J FvMQwa/x+ek+KQVXZMc7xtOyfdtzEQ/UU4iG1k6R4qvvCNlE4lQXbiwy7i25EhNZqHqa pRvz63uF8Z2L9zPVeOFkRf0OJNvhkwXETmjHWu1uUFCJ6/lC3YrqtjF7Nkm2j25k50Po wnsc78hiPNKCz0SxNwTe6rdKUsgCEffpYlGiUCTQ0ZFSY5tgkyUZqF1dqR0Py1m4GbvO aMeatmA/yUYCy8EC3sG5sEY/3x8bKq9TzuY9PnQVVSruRTv2//28d1wjb9KFZI8dsmbM zQhQ== X-Gm-Message-State: AOUpUlGbBOJU1VNDY4ZBh+AMHMjnySP0jPtbSUiV+DgLn0jQ2sODEkdk nVxZsZ3QuMiCGqPFppHi19cB7g== X-Received: by 2002:a63:e116:: with SMTP id z22-v6mr17620246pgh.89.1532996937654; Mon, 30 Jul 2018 17:28:57 -0700 (PDT) Received: from linaro.org ([121.95.100.191]) by smtp.googlemail.com with ESMTPSA id v4-v6sm13709038pgr.36.2018.07.30.17.28.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 30 Jul 2018 17:28:57 -0700 (PDT) Date: Tue, 31 Jul 2018 09:28:31 +0900 From: AKASHI Takahiro To: Dave Kleikamp Cc: Will Deacon , Catalin Marinas , 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: <20180731002830.GJ11258@linaro.org> Mail-Followup-To: AKASHI Takahiro , Dave Kleikamp , Will Deacon , Catalin Marinas , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org References: <20180730161641.6zxxy3lxp27tznck@armageddon.cambridge.arm.com> <20180730162235.GC4276@arm.com> <2651847f-79ea-fe2a-c1d7-efe4d11702b4@oracle.com> <20180730165757.GF4276@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) 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 04:36:28PM -0500, Dave Kleikamp wrote: > On 07/30/2018 11:57 AM, Will Deacon wrote: > > 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. > > I see why it failed. ipi_cpu_crash_stop() does not call > set_cpu_online(cpu, false) the way ipi_cpu_stop() does. So > cpu_online_mask is still populated with the stopped cpus. > > Any reason why it isn't called there? Because I wanted that saved cpu-related state be as close to as it was at panic. If cpus go offline, the core dump would show that all the cores but a panicked one be offline whether or not they actually were. Thanks, -Takahiro AKASHI > Thanks, > Dave > > > > > Will > >