From patchwork Fri Sep 6 14:19:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 1159026 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) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46Q0D22VZQz9s7T for ; Sat, 7 Sep 2019 00:23:46 +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="QgW/NttT"; dkim-atps=neutral Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 46Q0D154T0zDrCF for ; Sat, 7 Sep 2019 00:23:45 +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="QgW/NttT"; 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 46Q09G3TdzzDq9D for ; Sat, 7 Sep 2019 00:21:22 +1000 (AEST) Received: by mail-pg1-x543.google.com with SMTP id d10so3591701pgo.5 for ; Fri, 06 Sep 2019 07:21:22 -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=OHdghr+pebDeDEVxB/WtvQTR9vNo0xCIOb8F5x0KimE=; b=QgW/NttTHKG8AA3f0p2M8Nfkd9JyO2pUHK2CCqImCpJZJ0gOU2ycVCu3CPR59UlsL+ lHZt6fZjyDHa9QZhML8KxK3mQNlip/5vAw78ieuWqVEL/bSJLheQmhToYPqoLLhDQt2r KW8WP1+Z8Nm/Aw4NIte93yLcuOCh6Xrz9YQplaa3uOmEUlLQe2YCDCYdke4F2u0bruvU 9HnS+etgLLpifMx9l6zVDfPaxzHr/YkE3uG2hN38fUB/0C71ApACal9yDCM0sJloBRjR 51S0Ypqq18HAtNoH4zAms1xCB6F8WNaIPK5JRW7qR2gVVEDjn8CPeWaNXyet2PQdKG4O 3F9w== 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=OHdghr+pebDeDEVxB/WtvQTR9vNo0xCIOb8F5x0KimE=; b=W5EF9z43+YZfFt5McsRY78OQ0dh0R426mRmzOwjTZD4ekZO9cAQGKe3yIWRO7CNzK/ Df0Ff8JNw190uKxEQAc58uB3hk0QdBYQDDSNGdNwh7rzvnj4WNtlx3M53FEl94Z8cM60 9IYeLv5Q0kehfANANbmC8CuGywDitnCdhJj+P319nOsyWW2AZ95x5HkJWhoR5TdXCzwa KUX66Ps68HMoUOfSfNAUStPWkbqLi2Osr6J2PROWtb5Adn9i5IcDS4GEBmLh9KjL411W NwSQicAp5fbPIgHQql668K1ayxSIH6K8CPMA277bda4TWahbMsjRVeguIwJCgo9TBZl1 uXAA== X-Gm-Message-State: APjAAAWwGiyNGzA5Ym6yAV8bMagjllUV3Ilf7EmbmphBWOcTgVIMnx/L PxN4ZoJVgT240Kl10NKS4F6dGKEe X-Google-Smtp-Source: APXvYqyRw97af0yDrrWnAi0y+T2ANS03/9FyaChBK/CQ+TWQFMGV/0fTj5Ea5y2D/yAqXQ/bzkTvCQ== X-Received: by 2002:aa7:854f:: with SMTP id y15mr11015558pfn.172.1567779678924; Fri, 06 Sep 2019 07:21:18 -0700 (PDT) Received: from bobo.local0.net ([203.63.189.78]) by smtp.gmail.com with ESMTPSA id n9sm5083895pjq.30.2019.09.06.07.21.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Sep 2019 07:21:18 -0700 (PDT) From: Nicholas Piggin To: skiboot@lists.ozlabs.org Date: Sat, 7 Sep 2019 00:19:57 +1000 Message-Id: <20190906141958.31626-2-npiggin@gmail.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190906141958.31626-1-npiggin@gmail.com> References: <20190906141958.31626-1-npiggin@gmail.com> MIME-Version: 1.0 Subject: [Skiboot] [PATCH 1/2] 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 90e412bfb..f85327873 100644 --- a/core/exceptions.c +++ b/core/exceptions.c @@ -69,9 +69,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); @@ -79,14 +80,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);