From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS, T_DKIMWL_WL_HIGH autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4FC6DC43142 for ; Mon, 30 Jul 2018 21:36:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EE78920857 for ; Mon, 30 Jul 2018 21:36:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="CPq+lt1G" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EE78920857 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=oracle.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731984AbeG3XNq (ORCPT ); Mon, 30 Jul 2018 19:13:46 -0400 Received: from aserp2130.oracle.com ([141.146.126.79]:40690 "EHLO aserp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727113AbeG3XNq (ORCPT ); Mon, 30 Jul 2018 19:13:46 -0400 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w6ULY50m162812; Mon, 30 Jul 2018 21:36:30 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=corp-2018-07-02; bh=xqUFKXptLR9gCHoyeIA/hvZEThKMbFSQQSTJ0Y8P7QM=; b=CPq+lt1Gea0xA4lQpaQV9rDAUzn2toldlSeWZopElFTvvvtInYmJB4gIycoZEiHwkvwx o37/iPwOhhpPFKqzMcjtAtxW+cIJwrtN4xRadgxwMcqqcmtHPrQfdC2PMrch5F+gtCyF 6khfI9lwSt6wuZu6JRc8ECHitv7Efh4su8IsXy9iu7XuMMiQFg38r9wFrsEJvVT6Vm7w dYv4QRNufEZgj4G310Howdf0J+0w+yz6pVtOMCzr7cCc+f28rkx3QiHZ80t64zCdinIa VrdndDhoKxi6bVmAGejOHUomXAnFTKebSffBJTalwe4vp4gg582vaTn8LHkqhbZgODSH cg== Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by aserp2130.oracle.com with ESMTP id 2kge0cxhrq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 30 Jul 2018 21:36:30 +0000 Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w6ULaT1o021921 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 30 Jul 2018 21:36:29 GMT Received: from abhmp0013.oracle.com (abhmp0013.oracle.com [141.146.116.19]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w6ULaSBj026177; Mon, 30 Jul 2018 21:36:29 GMT Received: from [192.168.1.93] (/99.156.91.244) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 30 Jul 2018 14:36:28 -0700 Subject: Re: [PATCH 1/1] arm64: kexec: machine_kexec should call __flush_icache_range To: Will Deacon Cc: Catalin Marinas , AKASHI Takahiro , 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> From: Dave Kleikamp Openpgp: preference=signencrypt Message-ID: Date: Mon, 30 Jul 2018 16:36:28 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20180730165757.GF4276@arm.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8970 signatures=668706 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1806210000 definitions=main-1807300227 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? Thanks, Dave > > Will >