From patchwork Fri Mar 27 09:22:55 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Borislav Petkov X-Patchwork-Id: 6104541 Return-Path: X-Original-To: patchwork-linux-acpi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id EC8679F2A9 for ; Fri, 27 Mar 2015 09:25:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CEC6E200E1 for ; Fri, 27 Mar 2015 09:25:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E0B38203F3 for ; Fri, 27 Mar 2015 09:25:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964811AbbC0JYy (ORCPT ); Fri, 27 Mar 2015 05:24:54 -0400 Received: from mail.skyhub.de ([78.46.96.112]:58651 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753202AbbC0JYv (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=ubvOw4i59r8SanSfNuRRZo2rmt7CSunpnno+e+QEPIg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=RjRe q6RoMzQUHToRrGV2/9rglEQdOpWobVylIQ7BQtyPiQgEYHTDKgsua+XyEhjGsz2c8n0 xHhiuIaLdVtQh5hCFuK6I7kMxbHh4wQTfbOgzWzIEW3SmXVPv0JjBT5sS5BMuCpXBHk brhljGolSoip4Vs3vvz5/eAkdNJb9xrdU= 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 pDqGYdEqntFS; 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 899B41D996C; 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=ubvOw4i59r8SanSfNuRRZo2rmt7CSunpnno+e+QEPIg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=RjRe q6RoMzQUHToRrGV2/9rglEQdOpWobVylIQ7BQtyPiQgEYHTDKgsua+XyEhjGsz2c8n0 xHhiuIaLdVtQh5hCFuK6I7kMxbHh4wQTfbOgzWzIEW3SmXVPv0JjBT5sS5BMuCpXBHk brhljGolSoip4Vs3vvz5/eAkdNJb9xrdU= Received: by pd.tnic (Postfix, from userid 1000) id 2B60C1617C3; 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 2/5] GHES: Carve out the panic functionality Date: Fri, 27 Mar 2015 10:22:55 +0100 Message-Id: <1427448178-20689-3-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 ... into another function for more clarity. No functionality change. Signed-off-by: Borislav Petkov --- drivers/acpi/apei/ghes.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c index fe1e41bf5609..712ed95b1dca 100644 --- a/drivers/acpi/apei/ghes.c +++ b/drivers/acpi/apei/ghes.c @@ -823,6 +823,18 @@ static void __process_error(struct ghes *ghes) #endif } +static void __ghes_panic(struct ghes *ghes) +{ + oops_begin(); + ghes_print_queued_estatus(); + __ghes_print_estatus(KERN_EMERG, ghes->generic, ghes->estatus); + + /* reboot to log the error! */ + if (panic_timeout == 0) + panic_timeout = ghes_panic_timeout; + panic("Fatal hardware error!"); +} + static int ghes_notify_nmi(unsigned int cmd, struct pt_regs *regs) { struct ghes *ghes, *ghes_global = NULL; @@ -846,16 +858,8 @@ static int ghes_notify_nmi(unsigned int cmd, struct pt_regs *regs) if (ret == NMI_DONE) goto out; - if (sev_global >= GHES_SEV_PANIC) { - oops_begin(); - ghes_print_queued_estatus(); - __ghes_print_estatus(KERN_EMERG, ghes_global->generic, - ghes_global->estatus); - /* reboot to log the error! */ - if (panic_timeout == 0) - panic_timeout = ghes_panic_timeout; - panic("Fatal hardware error!"); - } + 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))