From patchwork Mon Dec 3 18:05:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Morse X-Patchwork-Id: 10710187 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 858A215A6 for ; Mon, 3 Dec 2018 18:06:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7BBF32B068 for ; Mon, 3 Dec 2018 18:06:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 702842B47E; Mon, 3 Dec 2018 18:06:42 +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 17C3D2B068 for ; Mon, 3 Dec 2018 18:06:42 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2B69C6B6A77; Mon, 3 Dec 2018 13:06:41 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 269886B6A78; Mon, 3 Dec 2018 13:06:41 -0500 (EST) 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 12FE36B6A79; Mon, 3 Dec 2018 13:06:41 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-oi1-f199.google.com (mail-oi1-f199.google.com [209.85.167.199]) by kanga.kvack.org (Postfix) with ESMTP id DC65B6B6A77 for ; Mon, 3 Dec 2018 13:06:40 -0500 (EST) Received: by mail-oi1-f199.google.com with SMTP id t83so8729032oie.16 for ; Mon, 03 Dec 2018 10:06:40 -0800 (PST) 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=aVEv9rbeYxezghts4bbhYTuuYiG4k1B5LfzjOaaIC4E=; b=of/hBhE5jHQWYokrs+1ZmrH+jhHJDpp4XeLU494TLOqfRvbyGGs34zOnXPigMbizLW 5bQmSiwOMeG/UC2RrUXI703hexVxLzYPZOJud1gz+pEzFb46aYWgUT29g9KIELvrhAnJ QNUoj6plg19M/yORgZpf19SY4PmRd+0DPzwcgU/KEKQ/JYKw5HzyFbz1qzJ2QlUoLVQS LJ2b0eEUZMVFhmICI0rkPRD9FrlPiaQt7VYaukXyzp30DnFfbDGcg7CIKTMlhqH9M7PK eseioiYQO0Pw/Bj+3pD+0MrR7bU+HDHUBTbYIBMAcGtlEw0yyjkpKGhDqk0ICMQwNkts 9YQQ== 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: AA+aEWbcr2bVGVS3hd/FKIi9FDRXuTSWcsXwOHoS84plm5UYMqJPvnyZ uGvgvj1aqjwOarhPvm3BCZICzjOEB/cO70qwUVMNbIalCjJVEDl9l+OceiM+l8NyWDMQhS9nKYu XhrHX4NxwiypTKp3hnMVrHf0lv/r7NX+ii55ebJPCwi7YwMM++vgqqIjnk0xnddxcCw== X-Received: by 2002:aca:c46:: with SMTP id i6mr10007911oiy.208.1543860400613; Mon, 03 Dec 2018 10:06:40 -0800 (PST) X-Google-Smtp-Source: AFSGD/XJejJTutRj1iaCmYIqfgEWwXeLfBRFKrH/01OFcwHLMaMf5ooaVt9RNAgNGANHQxN0fYUw X-Received: by 2002:aca:c46:: with SMTP id i6mr10007879oiy.208.1543860399938; Mon, 03 Dec 2018 10:06:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543860399; cv=none; d=google.com; s=arc-20160816; b=D4boZKmX8M/lxgJlOWMdUMJRPNCTKoHZef4bFTRR/UU21SeNt1hp5hui7nE7S9MT5s f9X8nNuSlbRkFVumUAHpf98UPRaFUCzrIq/TaaJVCInblWc1RpeXgpWSDkVEzn/gqzed i0dLOePglG5/6ZA+JW9V665gKbgJZIKmbgMTQBjXulDWi+KzVkSpoVI7IKi7SSkvACrJ flqJK42CayQ1Ek7HIDqXPGWe7YtZJ5sSK6chWVY3yf/mfRuxQ+ZV1aqB+Ba4GvbCh03u yIEYXCYkp+Vso89u/rf0XCR1hhfLPQZ2Uj4+EXPNhqqIdiwGMh7WFdaxxLdbkcokrpU5 Xv9w== 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=aVEv9rbeYxezghts4bbhYTuuYiG4k1B5LfzjOaaIC4E=; b=DhKly/n4TFICBNP2qXXG7AXIHG0YAJwVBdIWw966VOW1HjeHJmjx0mjNWlCoiCxh95 6DPGtwwos7/mJ5h3CAsLPSjgL4nz2dApijRS6/5MNmUgM6omMqQXr0DxRuRoG9UdAe6K cx+mLE5VcmbxeTyFPJXz6Qv/s54r5fV8eg7MqM66nJmwgx3qrLlECRxWGNDL22DX8/am U3uT+5aiZPfSxn0YCfgY9uxvXHaME+KbsyQn6Ac5+QfM9Nl35eDhKxUung9Tv/ZtPNeU l6wSnMmHbAB42+ViLnUMVT4fZHDYawJA96Si2NwfqinuOfMf6qv2XC2ZCExXRA3Pz9pP OSmg== 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 w81si6866609oie.88.2018.12.03.10.06.39 for ; Mon, 03 Dec 2018 10:06:39 -0800 (PST) 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 483B21682; Mon, 3 Dec 2018 10:06:39 -0800 (PST) Received: from eglon.cambridge.arm.com (eglon.cambridge.arm.com [10.1.196.105]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 78B303F59C; Mon, 3 Dec 2018 10:06:36 -0800 (PST) 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 , Dongjiu Geng , Xie XiuQi , Fan Wu , James Morse Subject: [PATCH v7 01/25] ACPI / APEI: Don't wait to serialise with oops messages when panic()ing Date: Mon, 3 Dec 2018 18:05:49 +0000 Message-Id: <20181203180613.228133-2-james.morse@arm.com> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181203180613.228133-1-james.morse@arm.com> References: <20181203180613.228133-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 panic()ing, our only goal is to print this fatal error and panic(). This code is always called in_nmi(), and since commit 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 --- Changes since v6: * Capitals in patch subject * Tinkered with the commit message. --- drivers/acpi/apei/ghes.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c index 02c6fd9caff7..ab2dae6fc7e4 100644 --- a/drivers/acpi/apei/ghes.c +++ b/drivers/acpi/apei/ghes.c @@ -33,7 +33,6 @@ #include #include #include -#include #include #include #include @@ -947,7 +946,6 @@ static int ghes_notify_nmi(unsigned int cmd, struct pt_regs *regs) sev = ghes_severity(ghes->estatus->error_severity); if (sev >= GHES_SEV_PANIC) { - oops_begin(); ghes_print_queued_estatus(); __ghes_panic(ghes); }