All of lore.kernel.org
 help / color / mirror / Atom feed
From: Will Deacon <will@kernel.org>
To: Pavel Tatashin <pasha.tatashin@soleen.com>
Cc: Huang Shijie <shijie@os.amperecomputing.com>,
	Catalin Marinas <catalin.marinas@arm.com>,
	tabba@google.com, Ard Biesheuvel <ardb@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Linux ARM <linux-arm-kernel@lists.infradead.org>,
	LKML <linux-kernel@vger.kernel.org>,
	patches@amperecomputing.com, zwang@amperecomputing.com
Subject: Re: [PATCH] arm64: kexec: flush log to console in nmi_panic()
Date: Thu, 17 Jun 2021 18:58:23 +0100	[thread overview]
Message-ID: <20210617175822.GG24813@willie-the-truck> (raw)
In-Reply-To: <CA+CK2bC5XW_AjnieWZ-ro8iqr0Jb7cz5Ss5549tJTq3Zm4GYiQ@mail.gmail.com>

On Thu, Jun 17, 2021 at 01:55:08PM -0400, Pavel Tatashin wrote:
> On Thu, Jun 17, 2021 at 1:52 PM Will Deacon <will@kernel.org> 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

WARNING: multiple messages have this Message-ID (diff)
From: Will Deacon <will@kernel.org>
To: Pavel Tatashin <pasha.tatashin@soleen.com>
Cc: Huang Shijie <shijie@os.amperecomputing.com>,
	Catalin Marinas <catalin.marinas@arm.com>,
	tabba@google.com, Ard Biesheuvel <ardb@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Linux ARM <linux-arm-kernel@lists.infradead.org>,
	LKML <linux-kernel@vger.kernel.org>,
	patches@amperecomputing.com, zwang@amperecomputing.com
Subject: Re: [PATCH] arm64: kexec: flush log to console in nmi_panic()
Date: Thu, 17 Jun 2021 18:58:23 +0100	[thread overview]
Message-ID: <20210617175822.GG24813@willie-the-truck> (raw)
In-Reply-To: <CA+CK2bC5XW_AjnieWZ-ro8iqr0Jb7cz5Ss5549tJTq3Zm4GYiQ@mail.gmail.com>

On Thu, Jun 17, 2021 at 01:55:08PM -0400, Pavel Tatashin wrote:
> On Thu, Jun 17, 2021 at 1:52 PM Will Deacon <will@kernel.org> 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

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2021-06-17 17:58 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-17 12:50 [PATCH] arm64: kexec: flush log to console in nmi_panic() Huang Shijie
2021-06-17 12:50 ` Huang Shijie
2021-06-17 17:52 ` Will Deacon
2021-06-17 17:52   ` Will Deacon
2021-06-17 17:55   ` Pavel Tatashin
2021-06-17 17:55     ` Pavel Tatashin
2021-06-17 17:58     ` Will Deacon [this message]
2021-06-17 17:58       ` Will Deacon
2021-06-18  9:03       ` Huang Shijie
2021-06-18  9:03         ` Huang Shijie
2021-06-21 10:08         ` Will Deacon
2021-06-21 10:08           ` Will Deacon
2021-06-22 10:14           ` Huang Shijie
2021-06-22 10:14             ` Huang Shijie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210617175822.GG24813@willie-the-truck \
    --to=will@kernel.org \
    --cc=ardb@kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=pasha.tatashin@soleen.com \
    --cc=patches@amperecomputing.com \
    --cc=shijie@os.amperecomputing.com \
    --cc=tabba@google.com \
    --cc=zwang@amperecomputing.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.