From patchwork Fri Mar 27 09:22:56 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Borislav Petkov X-Patchwork-Id: 6104591 Return-Path: X-Original-To: patchwork-linux-acpi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 5A719BF90F for ; Fri, 27 Mar 2015 09:26:10 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 346452041B for ; Fri, 27 Mar 2015 09:26:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4123E20411 for ; Fri, 27 Mar 2015 09:26:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753892AbbC0J0D (ORCPT ); Fri, 27 Mar 2015 05:26:03 -0400 Received: from mail.skyhub.de ([78.46.96.112]:58665 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753441AbbC0JYv (ORCPT ); Fri, 27 Mar 2015 05:24:51 -0400 X-Virus-Scanned: Nedap ESD1 at mail.skyhub.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alien8.de; s=alien8; t=1427448289; bh=PtGRRVD/+lKiSpTlUMBjIEPA1uy/1nJ8VXWdE93tXd8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=nzt6 X+/+IQT4Rf/mqp4MO5GxPy4t8NHokTf4zWE9rMo6IyQoa0xPhCHhbDOIxi5INmiWI91 taQGLYsN/ZO84GA1fOg0HVySM39X00PTKOZhsuf/ixD5yCYZp1/yScqgJsYcaXtCcsd pZzFVrx6mP/YdyM/zLIUgkUbwtC5jtDzc= Received: from mail.skyhub.de ([127.0.0.1]) by localhost (door.skyhub.de [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id C5ZJ81sAkwFz; Fri, 27 Mar 2015 10:24:49 +0100 (CET) Received: from pd.tnic (p5DDC6BAA.dip0.t-ipconnect.de [93.220.107.170]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 929D41D9973; Fri, 27 Mar 2015 10:24:48 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alien8.de; s=alien8; t=1427448289; bh=PtGRRVD/+lKiSpTlUMBjIEPA1uy/1nJ8VXWdE93tXd8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=nzt6 X+/+IQT4Rf/mqp4MO5GxPy4t8NHokTf4zWE9rMo6IyQoa0xPhCHhbDOIxi5INmiWI91 taQGLYsN/ZO84GA1fOg0HVySM39X00PTKOZhsuf/ixD5yCYZp1/yScqgJsYcaXtCcsd pZzFVrx6mP/YdyM/zLIUgkUbwtC5jtDzc= Received: by pd.tnic (Postfix, from userid 1000) id 31EF81617C4; Fri, 27 Mar 2015 10:23:01 +0100 (CET) From: Borislav Petkov To: linux-edac Cc: Borislav Petkov , "Rafael J. Wysocki" , Len Brown , Tony Luck , Tomasz Nowicki , "Chen, Gong" , Wolfram Sang , Lv Zheng , Naoya Horiguchi , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH 3/5] GHES: Panic right after detection Date: Fri, 27 Mar 2015 10:22:56 +0100 Message-Id: <1427448178-20689-4-git-send-email-bp@alien8.de> X-Mailer: git-send-email 2.3.3 In-Reply-To: <1427448178-20689-1-git-send-email-bp@alien8.de> References: <1427448178-20689-1-git-send-email-bp@alien8.de> Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Borislav Petkov The moment we log an error of panic severity, there's no need to noodle through the ghes_nmi list anymore. So panic instead right then and there. Signed-off-by: Borislav Petkov --- drivers/acpi/apei/ghes.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c index 712ed95b1dca..0de3adcca03e 100644 --- a/drivers/acpi/apei/ghes.c +++ b/drivers/acpi/apei/ghes.c @@ -837,9 +837,8 @@ static void __ghes_panic(struct ghes *ghes) static int ghes_notify_nmi(unsigned int cmd, struct pt_regs *regs) { - struct ghes *ghes, *ghes_global = NULL; - int sev, sev_global = -1; - int ret = NMI_DONE; + struct ghes *ghes; + int sev, ret = NMI_DONE; raw_spin_lock(&ghes_nmi_lock); list_for_each_entry_rcu(ghes, &ghes_nmi, list) { @@ -847,20 +846,17 @@ static int ghes_notify_nmi(unsigned int cmd, struct pt_regs *regs) ghes_clear_estatus(ghes); continue; } + sev = ghes_severity(ghes->estatus->error_severity); - if (sev > sev_global) { - sev_global = sev; - ghes_global = ghes; - } + if (sev >= GHES_SEV_PANIC) + __ghes_panic(ghes); + ret = NMI_HANDLED; } if (ret == NMI_DONE) goto out; - if (sev_global >= GHES_SEV_PANIC) - __ghes_panic(ghes_global); - list_for_each_entry_rcu(ghes, &ghes_nmi, list) { if (!(ghes->flags & GHES_TO_CLEAR)) continue;