Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp851653pxj; Thu, 17 Jun 2021 15:39:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzHYO5aarrChVNubHUYaakXPdZxgxjg3ytcr0Odv7QAZ9+mdJ+SchaB9VEpCDxlM7KzqyDD X-Received: by 2002:a05:6402:2378:: with SMTP id a24mr806301eda.161.1623969560204; Thu, 17 Jun 2021 15:39:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623969560; cv=none; d=google.com; s=arc-20160816; b=yBuv7QP6iji88R2sTILY4bR8QVhWnx8kTfs89mgmsoKaaKRUTF/qHmDnxFYNizrqfN XNdENpl37COJIsvjG4+857+vZwTrrOEjs6itpNTnmJBrzQeMvrGZBiXLImE88FkSZ00f AQca0QBzOD/mg4Xgm5Qw5mV4AUSlFlcuAvbg1ZJeDdjZNhMkp6AfPXFWGQWZXt400DxT xp/5+xS5mG9pfs1tSZhr5Gq6dN4B1EkltAMBptypO68UCkZsjMBEoivaoAjdtFRCXZPE IpYlgCcg010g3oRWLkpwI+uOcaM9RKBseGnXMp79p4vbJCxYqAJYFlWDuxLXPPGnoWTI bisg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=NcBbJNmHj9m0f8TQUJmHTOZiC/GGoqpGpd0ONxvEm2o=; b=LIPTqy6ivB4ufWlYRb3N25O8Tdub0Z/OaHeL8Cxbyo9EOkkvcQmtY+yQE2UhUrrw/Z E76ZO7MY3krWX8uMCaltiNrvgaJLvNpgscPU9ZWWu7ra+u4bZ3Zfui6Ctz1dJFFDFm9m oZAsCjO49FRMm+3WGcnF+7/uzqplOHeJRgcixYI9hF28OuXoD9J2JzVLpah2VV0wufPp xzm0pZqf5vQf/MOtHNpNoA92vgayrQsFEzTYqqeaCIVZRJEWPdabojqniOOkM7R1HuB8 /i83veTMslQlqxodtax38qGvgleXWwMnjO7OZN9mo2mJxrxEZYXpjABHbgOZsQrQQOO0 wz/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=M0QIfx4j; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id jg15si434215ejc.143.2021.06.17.15.38.57; Thu, 17 Jun 2021 15:39:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=M0QIfx4j; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231911AbhFQSAh (ORCPT + 99 others); Thu, 17 Jun 2021 14:00:37 -0400 Received: from mail.kernel.org ([198.145.29.99]:39270 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231408AbhFQSAg (ORCPT ); Thu, 17 Jun 2021 14:00:36 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 4F490613CE; Thu, 17 Jun 2021 17:58:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1623952709; bh=rUjI764QttB/GaYGInrf4Tbe3/WWS/GT+QlHLDq6rwc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=M0QIfx4jt+jacagR6M6LJC3xQiHe796rittntIFM1prryAJ+TaikDFLq84l6AzUdj pPIWyoKbMjXeDPlFRUVp+UQJOu7j7qgpJZcNbYvetfWCbstYxKyH9h1+Q4Wf6NG9Js xQFMQyGqfWUpMsdR0NsHkwnJThihlAWqSCMDQ07svg8cAMAez0TdRLfSCnSTwMW+KR Cw8aTUE9Ckqqgxy8LsfC83kp2WnFZkPGQ5k2LsNESurM9VAKROrqF7TYwbGGNcdPft cfK1aoBJDgZ1I6eQBqCZfDjw9/RRTNUmTKWUu5VO9W4wrCaOZ+hlnPjFTbty5E2SdB 0ZSkF2y/loFiQ== Date: Thu, 17 Jun 2021 18:58:23 +0100 From: Will Deacon To: Pavel Tatashin Cc: Huang Shijie , Catalin Marinas , tabba@google.com, Ard Biesheuvel , Mark Rutland , Linux ARM , LKML , patches@amperecomputing.com, zwang@amperecomputing.com Subject: Re: [PATCH] arm64: kexec: flush log to console in nmi_panic() Message-ID: <20210617175822.GG24813@willie-the-truck> References: <20210617125023.7288-1-shijie@os.amperecomputing.com> <20210617175211.GE24813@willie-the-truck> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 17, 2021 at 01:55:08PM -0400, Pavel Tatashin wrote: > On Thu, Jun 17, 2021 at 1:52 PM Will Deacon wrote: > > > > On Thu, Jun 17, 2021 at 12:50:23PM +0000, Huang Shijie wrote: > > > If kdump is configured, nmi_panic() may run to machine_kexec(). > > > > > > But in NMI context, the log is put in PER-CPU nmi_print_seq. > > > So we can not see any log on the console since we entered the NMI context, > > > such as the "Bye!" in previous line. > > > > > > This patch fixes this issue by two steps: > > > 1) Uses printk_safe_flush_on_panic() to flush the log from > > > nmi_print_seq to global printk ring buffer, > > > 2) Then uses console_flush_on_panic() to flush to console. > > > > > > After this patch, we can see the "Bye!" log in the panic console. > > > > Does it matter? I'd be more inclined to remove the print altogether... > > I agree, the print could be removed entirely. But, my assumption was > that this patch meant to flush other buffered prints beside this last > "Bye" one. That sounds like something which should be done in the core code, rather than the in the architecture backend (and looks like panic() might do this already?) Will