From patchwork Fri Sep 21 22:16:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Morse X-Patchwork-Id: 10611017 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B97AC14BD for ; Fri, 21 Sep 2018 22:17:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AC5E32E6DC for ; Fri, 21 Sep 2018 22:17:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A0B2F2E6E3; Fri, 21 Sep 2018 22:17:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=unavailable version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 49AD22E6DC for ; Fri, 21 Sep 2018 22:17:59 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 50B468E0014; Fri, 21 Sep 2018 18:17:58 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 4E1758E0001; Fri, 21 Sep 2018 18:17:58 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3A8A58E0014; Fri, 21 Sep 2018 18:17:58 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-ot1-f72.google.com (mail-ot1-f72.google.com [209.85.210.72]) by kanga.kvack.org (Postfix) with ESMTP id 128688E0001 for ; Fri, 21 Sep 2018 18:17:58 -0400 (EDT) Received: by mail-ot1-f72.google.com with SMTP id q3-v6so13806908otl.14 for ; Fri, 21 Sep 2018 15:17:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:from:to:cc :subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=tLY63TKE4myS/mWyo9MZfSxBAOmWW4ke/duPxwghuiA=; b=bNaq6du1JNM4gC8Ol5nBl41+6WuhTdx3SbBYV9BQtX7zXFdp3uks+v+jkXkz/fi/wO heSt8cXT3Zhf+VJSMk+9Sx0K00E0odcFmFVj6IlP7X8ygsrL0GtlYhGDYf4yAWyp21fA ceOnqFrRT5Epk0q7EAWr4EgI9ZwnDOP7XcKleg/t0E4SlK+KnTq6N0QcVV0MeuiNXt+N I7v705LWNNoaVYMXiQOjgrU5Of+MJj4GliKyoOt3Tn8hwHiu39NqY6AW84FehPNri6Fx Pq0KCaK2K/4+q2AksbVynhILdTPQZRv/HpoSOG3jv4t38Z+C6m50ista2I2J53oZd3Di 4Bng== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of james.morse@arm.com designates 217.140.101.70 as permitted sender) smtp.mailfrom=james.morse@arm.com X-Gm-Message-State: APzg51CfBltBJWxw5tUqL/K+yfBnYmJuX+R6SXMy627OXzP+/BHevBsr l+bUHWGyTRG5ugv/kFfJx6XfZYONB32jPd1+Ob7Bjxtob1AWcAyM/eG9sXYNabWYyCQ3xU/pl0U EPjqg+d0ehbWJPovwY+ZgA3CW32zFRMggDfymO0CZnudvqr9TCNrjwqQf3rjqDYI3eg== X-Received: by 2002:a9d:9a1:: with SMTP id q30-v6mr25169223otd.351.1537568277830; Fri, 21 Sep 2018 15:17:57 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdbw9hHwXOVfRLIPXCRPaXIz2e0DmaVBD1Tgs7CxEe1fccW1w5OTW5gA+e82L+mQ4Ua+GqZ0 X-Received: by 2002:a9d:9a1:: with SMTP id q30-v6mr25169195otd.351.1537568276945; Fri, 21 Sep 2018 15:17:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537568276; cv=none; d=google.com; s=arc-20160816; b=Hxmb9M5MPSFsbOPxpst5RnuhPwFYGKf5qPUTqketre4bhD4hXu0J47Lc1QqJRFQMM+ 7A3YLgo3MOum3oxMGqbWOhNM27sI/H5Khuf3Ejtl3jLrXJLvLIV7vWVWER29vT+NeCBO M7uWAwcBxXbwdxwuccQvRFgZxBqBYt0qyrEgEfZu9OByrcTx2kldJSQ9bLkRZBjQYlWE 4uQlXWAATAWhEBQ3X+0yCTcpDkkOfTEOYV3q1mf6jHtz+FJhHjo0noHBmIPI+eNBbR+n wmSoNXrpdHQEVzxrhijQ/9x5mMwvpjb2pnF3YfTBgFlfKxireJR7Etkb+OCF0YoRJCtA MBUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=tLY63TKE4myS/mWyo9MZfSxBAOmWW4ke/duPxwghuiA=; b=ddfMoZltrIKeAOQK66cRVHP3jZNQq6PaRUXfoabo7+Ueh3db4U7k1yegdU1czD9B5W zYvNcFYmHF7GF+DQsaKIkkKfepZb0P4v0VKMwqmendK9A+w6YE4RjlbTLV8IveuUOSgk wlsMJIO+f4x8o52ScOSCPaxJlOll2xSPhqlAXzduqdiuIPYU21AKhxs1BUMQuAyXZ8rs r5zeK79n5Ye6bwCTm6reT2AV95dZpacqcdTWg0PrpMLX5iQyM9J+kvRGaXutkrMK5y4t jy5zwB0fRvj/e8KOAf8kQ4c3/+2luzkk+J+5j/HD+VIsSuphqCymE0fY+rKSrYxUEFbM P/nA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of james.morse@arm.com designates 217.140.101.70 as permitted sender) smtp.mailfrom=james.morse@arm.com Received: from foss.arm.com (usa-sjc-mx-foss1.foss.arm.com. [217.140.101.70]) by mx.google.com with ESMTP id x19-v6si11961739oix.68.2018.09.21.15.17.56 for ; Fri, 21 Sep 2018 15:17:56 -0700 (PDT) Received-SPF: pass (google.com: domain of james.morse@arm.com designates 217.140.101.70 as permitted sender) client-ip=217.140.101.70; Authentication-Results: mx.google.com; spf=pass (google.com: domain of james.morse@arm.com designates 217.140.101.70 as permitted sender) smtp.mailfrom=james.morse@arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 525E31596; Fri, 21 Sep 2018 15:17:56 -0700 (PDT) Received: from melchizedek.Emea.Arm.com (melchizedek.emea.arm.com [10.4.12.81]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 3DFC83F557; Fri, 21 Sep 2018 15:17:53 -0700 (PDT) From: James Morse To: linux-acpi@vger.kernel.org Cc: kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org, linux-mm@kvack.org, Borislav Petkov , Marc Zyngier , Christoffer Dall , Will Deacon , Catalin Marinas , Naoya Horiguchi , Rafael Wysocki , Len Brown , Tony Luck , Tyler Baicar , Dongjiu Geng , Xie XiuQi , Punit Agrawal , jonathan.zhang@cavium.com, James Morse Subject: [PATCH v6 03/18] ACPI / APEI: don't wait to serialise with oops messages when panic()ing Date: Fri, 21 Sep 2018 23:16:50 +0100 Message-Id: <20180921221705.6478-4-james.morse@arm.com> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20180921221705.6478-1-james.morse@arm.com> References: <20180921221705.6478-1-james.morse@arm.com> MIME-Version: 1.0 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP oops_begin() exists to group printk() messages with the oops message printed by die(). To reach this caller we know that platform firmware took this error first, then notified the OS via NMI with a 'panic' severity. Don't wait for another CPU to release the die-lock before we can panic(), our only goal is to print this fatal error and panic(). This code is always called in_nmi(), and since 42a0bb3f7138 ("printk/nmi: generic solution for safe printk in NMI"), it has been safe to call printk() from this context. Messages are batched in a per-cpu buffer and printed via irq-work, or a call back from panic(). Link: https://patchwork.kernel.org/patch/10313555/ Acked-by: Borislav Petkov Signed-off-by: James Morse --- drivers/acpi/apei/ghes.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c index 29d863ff2f87..d7c46236b353 100644 --- a/drivers/acpi/apei/ghes.c +++ b/drivers/acpi/apei/ghes.c @@ -33,7 +33,6 @@ #include #include #include -#include #include #include #include @@ -758,9 +757,6 @@ static int _in_nmi_notify_one(struct ghes *ghes) sev = ghes_severity(ghes->estatus->error_severity); if (sev >= GHES_SEV_PANIC) { -#ifdef CONFIG_X86 - oops_begin(); -#endif ghes_print_queued_estatus(); __ghes_panic(ghes); }