Received: by 2002:a4a:301c:0:0:0:0:0 with SMTP id q28-v6csp1001909oof; Tue, 25 Sep 2018 07:10:40 -0700 (PDT) X-Google-Smtp-Source: ACcGV60o4PHqgbugzp7qxDmrZXpc4ceMCL1BnA6XAp8/+dN/iydad0cAcsLLoCiVMLd6hm20HQhk X-Received: by 2002:a62:f610:: with SMTP id x16-v6mr1323532pfh.169.1537884640711; Tue, 25 Sep 2018 07:10:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537884640; cv=none; d=google.com; s=arc-20160816; b=eHWbf1iAbqjCLIDwpB+bpmp8Uj5NsoO43ql13DOSnaR05eZxRwobKBztAHYkOGXKez W9ljQe7YyFG3qiBdb0x7c49qlIkyze4i3YsB4uNfggiY/yRKheez7piNZvkb6oSf2nnk fLKy3bJou57exRAL6S1QKaMlzkVdOD23HfC0BjwX4CfWR+tjjfjy16P7trA4ylsIIu/E zmAX/crOb3eTkXuRCAylvkrkG1NXYUgLEEr+XPIo3MFgTQ2qR/OX4p8Nx53VoA3nKztT lxY+cWLjQMPnB9dUjQU3Diz6xp4vPqeXEt/WvEZ4K5Pg+B9vdF9T9ZU7A9zrtOGGSJ0c UUjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:cc:to:subject:from:message-id; bh=8fW1QE9hmw7vzCaVbfOnbzbMG+RNiX5QbnIz4y7myz0=; b=j53FxSzbvUlDrIhuYjXPxQ+ru/1evNbPUG0kGmOWh5Rsq2R8bK3mCWYLfQvQevScc+ GCOctJfHeFtkua2L3Y/ohelI6CXiQu/FKeGaO1I+9eaksKdkL217N36kc6YByiXDFhYh IPEKFNIHKNqWHcgN+vGmTUg/HpevW5I0QR6Nb9wNLUeEBoW6wyvAzewye3bVjLUuSut7 DVgxbAEWBtNS0+w4AikmwCGfOcZEuQuFIAcla7RpeqkxTng4QE//SHK5UL2bTdlJDSdG GBXRXUOW4udWBQIThZGKtAe8Jpe7kPwtc8n+amHDWzHk3xIYRaobOopyUCdlJdkwHd5K MsYw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y63-v6si2317691pgd.435.2018.09.25.07.10.22; Tue, 25 Sep 2018 07:10:40 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729207AbeIYURt (ORCPT + 99 others); Tue, 25 Sep 2018 16:17:49 -0400 Received: from pegase1.c-s.fr ([93.17.236.30]:60295 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729124AbeIYURt (ORCPT ); Tue, 25 Sep 2018 16:17:49 -0400 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 42KNHx4Jvmz9ttSF; Tue, 25 Sep 2018 16:10:05 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024) with ESMTP id ExvdpCBl377d; Tue, 25 Sep 2018 16:10:05 +0200 (CEST) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 42KNHx3XkLz9ttCN; Tue, 25 Sep 2018 16:10:05 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 6D01F8B7DF; Tue, 25 Sep 2018 16:10:05 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id 0OWO1Ukp0TUv; Tue, 25 Sep 2018 16:10:05 +0200 (CEST) Received: from pc16082vm.idsi0.si.c-s.fr (unknown [192.168.232.3]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 33AB68B7C8; Tue, 25 Sep 2018 16:10:05 +0200 (CEST) Received: by pc16082vm.idsi0.si.c-s.fr (Postfix, from userid 0) id 0699670AB8; Tue, 25 Sep 2018 14:10:04 +0000 (UTC) Message-Id: <86e85efc4b5a90523de6e964c5cef8858eb1177d.1537884465.git.christophe.leroy@c-s.fr> From: Christophe Leroy Subject: [PATCH v2] powerpc/traps: merge unrecoverable_exception() and nonrecoverable_exception() To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Date: Tue, 25 Sep 2018 14:10:04 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org PPC32 uses nonrecoverable_exception() while PPC64 uses unrecoverable_exception(). Both functions are doing almost the same thing. This patch removes nonrecoverable_exception() Signed-off-by: Christophe Leroy --- v2: Removed call to debugger() as die() already calls debugger() arch/powerpc/include/asm/asm-prototypes.h | 1 - arch/powerpc/kernel/entry_32.S | 4 ++-- arch/powerpc/kernel/traps.c | 12 ++---------- 3 files changed, 4 insertions(+), 13 deletions(-) diff --git a/arch/powerpc/include/asm/asm-prototypes.h b/arch/powerpc/include/asm/asm-prototypes.h index 78ed3c3f879a..2741831482f4 100644 --- a/arch/powerpc/include/asm/asm-prototypes.h +++ b/arch/powerpc/include/asm/asm-prototypes.h @@ -63,7 +63,6 @@ void program_check_exception(struct pt_regs *regs); void alignment_exception(struct pt_regs *regs); void slb_miss_bad_addr(struct pt_regs *regs); void StackOverflow(struct pt_regs *regs); -void nonrecoverable_exception(struct pt_regs *regs); void kernel_fp_unavailable_exception(struct pt_regs *regs); void altivec_unavailable_exception(struct pt_regs *regs); void vsx_unavailable_exception(struct pt_regs *regs); diff --git a/arch/powerpc/kernel/entry_32.S b/arch/powerpc/kernel/entry_32.S index e58c3f467db5..77decded1175 100644 --- a/arch/powerpc/kernel/entry_32.S +++ b/arch/powerpc/kernel/entry_32.S @@ -794,7 +794,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_601) lis r10,MSR_KERNEL@h ori r10,r10,MSR_KERNEL@l bl transfer_to_handler_full - .long nonrecoverable_exception + .long unrecoverable_exception .long ret_from_except #endif @@ -1297,7 +1297,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_601) rlwinm r3,r3,0,0,30 stw r3,_TRAP(r1) 4: addi r3,r1,STACK_FRAME_OVERHEAD - bl nonrecoverable_exception + bl unrecoverable_exception /* shouldn't return */ b 4b diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c index 6ab66a88db14..a29575215198 100644 --- a/arch/powerpc/kernel/traps.c +++ b/arch/powerpc/kernel/traps.c @@ -1547,14 +1547,6 @@ void StackOverflow(struct pt_regs *regs) panic("kernel stack overflow"); } -void nonrecoverable_exception(struct pt_regs *regs) -{ - printk(KERN_ERR "Non-recoverable exception at PC=%lx MSR=%lx\n", - regs->nip, regs->msr); - debugger(regs); - die("nonrecoverable exception", regs, SIGKILL); -} - void kernel_fp_unavailable_exception(struct pt_regs *regs) { enum ctx_state prev_state = exception_enter(); @@ -2090,8 +2082,8 @@ void SPEFloatingPointRoundException(struct pt_regs *regs) */ void unrecoverable_exception(struct pt_regs *regs) { - printk(KERN_EMERG "Unrecoverable exception %lx at %lx\n", - regs->trap, regs->nip); + pr_emerg("Unrecoverable exception %lx at %lx (msr=%lx)\n", + regs->trap, regs->nip, regs->msr); die("Unrecoverable exception", regs, SIGABRT); } NOKPROBE_SYMBOL(unrecoverable_exception); -- 2.13.3