From patchwork Wed Jun 5 02:36:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 1110282 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45JXxs6WPTz9s7h for ; Wed, 5 Jun 2019 12:37:21 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="KzDuoggu"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 45JXxs5Wk9zDqTZ for ; Wed, 5 Jun 2019 12:37:21 +1000 (AEST) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:4864:20::543; helo=mail-pg1-x543.google.com; envelope-from=npiggin@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="KzDuoggu"; dkim-atps=neutral Received: from mail-pg1-x543.google.com (mail-pg1-x543.google.com [IPv6:2607:f8b0:4864:20::543]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 45JXxS6YPwzDqT4 for ; Wed, 5 Jun 2019 12:37:00 +1000 (AEST) Received: by mail-pg1-x543.google.com with SMTP id w34so11492219pga.12 for ; Tue, 04 Jun 2019 19:37:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=o/MpvziBQzvrPI3BzyJO2SKnDZEI6IhsRtd0JrNUgpc=; b=KzDuogguU6O+5+6sIe7y9qOh18rZcdEd0/wR+mnf/JT8tNZPtYLEyigXH16FI+pbE+ vdzoziaNvLxJ52bQimqcgtFbMEK0FTRpQc/49OKBdhntYwJeAD2qnRKRVIhD/m5ZG/zG 8hEnd3+Z+NkPn6ljDo+118UiB/+paOHnXmmRnJ8DWLpWcBDklcm/FGgJSZ9P/4crRJYr gjbgu4N0YWE1cbRZzAR8zbvdo+LH9IxbwmArVTKHN0HW8SSbEBrabO9kuKdI2eSaRNbA W9PAlKDaNl8nPG9Qzy93nlDgg4fKEA5V0d3lFI7mPyyUtJRpLNUiWyiFfpb9FRht9fTE Wptw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=o/MpvziBQzvrPI3BzyJO2SKnDZEI6IhsRtd0JrNUgpc=; b=Qdy37DpAZC4DhWOjZU6juHxv4ir380uz4rnDKZw56uiT0PbXp6jof7TSlzkj7ZY7nF DYfJ0vo7ycu/sUdGu+GUQ96bHRq/3f4Ts306cO0fPbimeTo1NbJRzpdXweaIXSadjT0v PtHchs0BDB1CqiAy39M4TEpw3IBQMnYa2or3ASjOcxBrmin22ygM2VNIQeMzbLNuc3ut FQ0lHv0MiKRQuoGqUGssJuxc/B8CQwt+HNfcxc6tkER3f3q/qd9y9QmmiAZIEJP70VL3 zsHC3omVujOjQqwOItLB6QCw49I/4Pb+WzUhFH3fThQWAt/IOfpnBxlwcINcFQO29oJZ E2kg== X-Gm-Message-State: APjAAAVqwCvht/NH6jU+2Wft3+Lan3zYr6ZPfyNqwNsTlRd7xVnLy1ct 3Dk7eBvLhA6RyBvmYDndgJxSP3gW X-Google-Smtp-Source: APXvYqzYxi6fEDsLK15Vau07iiwQiqG0M0rtN6PArEJstNkGSkOvrpSo7WFI5heMtOtTw/iRzGSPGA== X-Received: by 2002:a63:5ca:: with SMTP id 193mr1034067pgf.232.1559702218259; Tue, 04 Jun 2019 19:36:58 -0700 (PDT) Received: from bobo.local0.net ([61.68.71.55]) by smtp.gmail.com with ESMTPSA id c9sm9077122pfn.3.2019.06.04.19.36.56 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 04 Jun 2019 19:36:57 -0700 (PDT) From: Nicholas Piggin To: skiboot@lists.ozlabs.org Date: Wed, 5 Jun 2019 12:36:14 +1000 Message-Id: <20190605023616.26893-2-npiggin@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190605023616.26893-1-npiggin@gmail.com> References: <20190605023616.26893-1-npiggin@gmail.com> MIME-Version: 1.0 Subject: [Skiboot] [RFC PATCH 1/3] core/exceptions.c: rearrange code to allow more interrupt types X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" Signed-off-by: Nicholas Piggin --- core/exceptions.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/core/exceptions.c b/core/exceptions.c index 4e5c0819e..5e453264e 100644 --- a/core/exceptions.c +++ b/core/exceptions.c @@ -78,9 +78,10 @@ void exception_entry(struct stack_frame *stack) if (!(msr & MSR_RI)) fatal = true; - prerror("***********************************************\n"); l = 0; - if (stack->type == 0x100) { + switch (stack->type) { + case 0x100: + prerror("***********************************************\n"); if (fatal) { l += snprintf(buf + l, EXCEPTION_MAX_STR - l, "Fatal System Reset at "REG" ", nip); @@ -88,14 +89,21 @@ void exception_entry(struct stack_frame *stack) l += snprintf(buf + l, EXCEPTION_MAX_STR - l, "System Reset at "REG" ", nip); } - } else if (stack->type == 0x200) { + break; + + case 0x200: fatal = true; + prerror("***********************************************\n"); l += snprintf(buf + l, EXCEPTION_MAX_STR - l, "Fatal MCE at "REG" ", nip); - } else { + break; + + default: fatal = true; + prerror("***********************************************\n"); l += snprintf(buf + l, EXCEPTION_MAX_STR - l, "Fatal Exception 0x%llx at "REG" ", stack->type, nip); + break; } l += snprintf_symbol(buf + l, EXCEPTION_MAX_STR - l, nip); l += snprintf(buf + l, EXCEPTION_MAX_STR - l, " MSR "REG, msr);