Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp738118pxj; Thu, 17 Jun 2021 12:39:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzbnLzegb8CLdc4fOuOK76pdcASA90FX7f67rQS3VUYhsmJF27UDDZ7E3aPUDuMBYid18EZ X-Received: by 2002:a05:6602:1234:: with SMTP id z20mr5271601iot.167.1623958742273; Thu, 17 Jun 2021 12:39:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623958742; cv=none; d=google.com; s=arc-20160816; b=z9OMD4G93IJ8q4eyViRjE0YmJIuK44iejzV9jF34BY8tEUrrIkNeTcIfKtZj+SVR/Z DzV/J9pswLIt7bMY88eDcT069eNUIlfOfwdXh4wfG6Z0vyQz/iiFesIXpkqfjpgwwsjZ hb8as1P/g4u1u8BAtdYI866nsFIhQ7/bL00k/dx5sGpKOHYjMv41XLUlVB+hbIAbeaYW pe3bRe31RdniTggdqPipF0/67OykMUr6pBERek8myb3up+ZibhOziebIeQlfiaUl1FLT GogGm4xvU6HfrO9n97C0wUvK1RTjt8iCVzQJuWmvc+PahnvsuGj/x96BhkDKi3JIWVJk VSlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=kHu5Ahvm2uB8SGRZwVpZNQgeW8VrebWqIEGoVFu7Q1M=; b=Uge4rAZnXW7iYfk6cYxsxCglY9c0UBdteJJivFS/BPi1e1jhiWE5bhNiBZAE4tWTnH RzbJvXAUnwAYIxSE+cqt+miVzXhV5we+enoQ/bENfeFdS/mfMWw2vF8qkGa48bYkxCzG ti3AepXuR1jL7m6ZykhOeJ4LlOsX7tzS1M+PejkHF2akwVTKOjkdQ55SkJpm5wFMOebQ W7/vmGZFMcXJpLQ3Ci4CW5i66RwbJc/JPDgRnRs8nPmz7TUXmkWg9hjVy8VxxO5Bz8Se 6Ks7vpr0Q6Mzo4p8pS8E3roU+EZi/VlJbb7SC6rZEMAO6SBB8nxHHlq+9ECcbU4PlDBg X93Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@soleen.com header.s=google header.b=OVLgJXxU; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y15si893940jai.35.2021.06.17.12.38.49; Thu, 17 Jun 2021 12:39:02 -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=@soleen.com header.s=google header.b=OVLgJXxU; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232707AbhFQR5y (ORCPT + 99 others); Thu, 17 Jun 2021 13:57:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54436 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231243AbhFQR5y (ORCPT ); Thu, 17 Jun 2021 13:57:54 -0400 Received: from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com [IPv6:2a00:1450:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 25866C061574 for ; Thu, 17 Jun 2021 10:55:46 -0700 (PDT) Received: by mail-ej1-x62f.google.com with SMTP id ji1so5193531ejc.4 for ; Thu, 17 Jun 2021 10:55:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=soleen.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=kHu5Ahvm2uB8SGRZwVpZNQgeW8VrebWqIEGoVFu7Q1M=; b=OVLgJXxUYJSrzHC9qdffaG5ci3Y5z5DGNfdrMuVRW54CDY7mQKOU62hMMiZWKVxOiP 3ZDIdwQdNB90jvwPCxldI3KiSFWXg2vAHlwo7q7zlNwGElN5HHqG5U4iM7b8+j9vlrJo xQDLRLj1VhLMxIBx5H6Br38QDQk7wN+PEoD69InlDgIhW53TorL4pd900woA6ENeGQUC yNd5A8tBGxa/0BOJzLAzSz2gdZhRVea7CkAGvM38Ydxe7hS3phPBrmDqbxQarHOqR2Fz 1c9fCcUHm//WZbtr8ZtqUYrXL9xtPJmXOCWaq9EcGATLGFlamz7YOezT1DjSEbriMiWl KIVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=kHu5Ahvm2uB8SGRZwVpZNQgeW8VrebWqIEGoVFu7Q1M=; b=A8wuo2asP/UB9Wr41IQbyzocjP/asDx5gBvPOnzeeQyU3+TPQO6ZHPR6+PHzf0jfub RIwd4HLUStfykR9Xqej+lasvH3bKNvLs8MKgOmAg5bnPd9ldEor/7dkNBmKwHGQUeGIW zEu0gu969cNqQDMNZ7CiapFktlZBub/VibGIRKE1Mh+7x57Ydop/LRP+FGoWihwQZOlE 3CY5hfaSATOxzO8YFajXmAegWzOlLJO5Xlido/nMJ6DrhxwTWE7h7y5s+4yzYUN+iB65 qPrrux38ShdziTjUM/4+ncpW0dLJ2BF7NvZ8XVkg/9ow2DaVXiMPUh/F7wqbMXqy4Ioa arxA== X-Gm-Message-State: AOAM533Hi3B0eYM7EbSjShmDw8euKR8h66q+yll2VtHnUIX9nVyI9f2L jnw5C9n2X01emGFKqLcKYROZTiaOZyEdN5rMFCaSjw== X-Received: by 2002:a17:907:270c:: with SMTP id w12mr6647326ejk.175.1623952544562; Thu, 17 Jun 2021 10:55:44 -0700 (PDT) MIME-Version: 1.0 References: <20210617125023.7288-1-shijie@os.amperecomputing.com> <20210617175211.GE24813@willie-the-truck> In-Reply-To: <20210617175211.GE24813@willie-the-truck> From: Pavel Tatashin Date: Thu, 17 Jun 2021 13:55:08 -0400 Message-ID: Subject: Re: [PATCH] arm64: kexec: flush log to console in nmi_panic() To: Will Deacon Cc: Huang Shijie , Catalin Marinas , tabba@google.com, Ard Biesheuvel , Mark Rutland , Linux ARM , LKML , patches@amperecomputing.com, zwang@amperecomputing.com Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. > > Will