Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3342064imu; Mon, 28 Jan 2019 03:13:06 -0800 (PST) X-Google-Smtp-Source: ALg8bN5lfuny3lDEbcPo1GgoyeEzVgSiWt/pEUynyWLl9h0nFryaS0iFqFclqYgGO/cBHzLc92QZ X-Received: by 2002:a63:981:: with SMTP id 123mr19560020pgj.444.1548673986547; Mon, 28 Jan 2019 03:13:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548673986; cv=none; d=google.com; s=arc-20160816; b=DuvjlpWaWiaIIdTAZQK/1wfly23BpN448KOltvdNoIdlKfGdAoUteFsT0DzyfOc4UJ xjCKVeHnvNRlieYyHmf4i1wXoBs6J9Xf+SbbUU1A99KEiWBYcslQJfuH+fAvWAorKzMJ Gdw3EYYiRc0Z4iK5t3MeoiHpaTHj5q9bS1NiBhUCSvTRTQham1YorhrNg9oyt8cIl3uB eGmcKxLjyEwbWYOoYqrTdp9d6peKd21xyIUd7d5NVXndTcqrpQW1LYf2ZzfRZXah0u35 vE7Mg1eDYmRrz8+myEplhvY1X4+xxtCNazFw2AZL0qmUr98nfFO2LbjSBrQEv9zaqM7Q cYRA== 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:references :in-reply-to:message-id:dkim-signature; bh=V5Zs6OxuW6c1FUUrQ3/4deI2JBpQTqXJNy62hF+5F7E=; b=C1UcFOhVQ7YVRaHvUz+VQXVbj4550jRNeTP+eIwCZ/QCMEkpB6LeQnzFRHsgRJGpGg J3VY9YjPmZxLnAXd8+1FXFuGNDoFgayDU0PevgtZ/zloZF5zsm7W7/kgoYWHLU73RE0x 9U7T+mWVbXhZtEOPN1BV2f1nroFMoEWdARePE27q5uWeMPnCFWV9VLwUjtn8RClhEwzG 6pYNMwyLmiaC7pLGrCJjKwAkDFGvR4j0oSWeizPSL6qfJ3m7czjxzDHBpOmVFRhI3fia rM3yvXvQjvaB1zmGhqr7munpaTSmYJdaoQTSSooV3GC0I4ga6T4NKcm8Kp/d8TW6jE7f ySZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=OJ3FUpvC; 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 g34si16364319pld.15.2019.01.28.03.12.51; Mon, 28 Jan 2019 03:13:06 -0800 (PST) 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; dkim=pass header.i=@c-s.fr header.s=mail header.b=OJ3FUpvC; 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 S1727105AbfA1LLq (ORCPT + 99 others); Mon, 28 Jan 2019 06:11:46 -0500 Received: from pegase1.c-s.fr ([93.17.236.30]:40113 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727041AbfA1LLd (ORCPT ); Mon, 28 Jan 2019 06:11:33 -0500 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 43p6Q50LSKz9v1q7; Mon, 28 Jan 2019 12:11:25 +0100 (CET) Authentication-Results: localhost; dkim=pass reason="1024-bit key; insecure key" header.d=c-s.fr header.i=@c-s.fr header.b=OJ3FUpvC; dkim-adsp=pass; dkim-atps=neutral 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 lhJjYgCsHVxX; Mon, 28 Jan 2019 12:11:24 +0100 (CET) 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 43p6Q46RdMz9v1q3; Mon, 28 Jan 2019 12:11:24 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=c-s.fr; s=mail; t=1548673884; bh=V5Zs6OxuW6c1FUUrQ3/4deI2JBpQTqXJNy62hF+5F7E=; h=In-Reply-To:References:From:Subject:To:Cc:Date:From; b=OJ3FUpvCqmUYYvdPk/x4VXeXz908/3Lhd0NmTz8UFRaBHcgWxJWBYxPYiHiWemOqf ZLubxmrREyA3fNApsqCJiYN3yQRLRznqOIeo7kqghwZyHk+O+vHlwUgfmQoopmgAx6 JrhPC1bpJtCsJh/X0lqHvbr7yDuDdgdnMgSiYWmg= Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 5FF0D8B79D; Mon, 28 Jan 2019 12:11:31 +0100 (CET) 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 uEfJQUaUVeUc; Mon, 28 Jan 2019 12:11:31 +0100 (CET) Received: from po16846vm.idsi0.si.c-s.fr (po15451.idsi0.si.c-s.fr [172.25.231.2]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 469178B796; Mon, 28 Jan 2019 12:11:31 +0100 (CET) Received: by po16846vm.idsi0.si.c-s.fr (Postfix, from userid 0) id 32D1572DE6; Mon, 28 Jan 2019 11:11:31 +0000 (UTC) Message-Id: <1b0d65d644079e205901f198bfa9ac0fdbafb05b.1548673552.git.christophe.leroy@c-s.fr> In-Reply-To: References: From: Christophe Leroy Subject: [PATCH 10/11] powerpc/40x: Add EXC_XFER_TEMPLATE_CRITICAL() To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Date: Mon, 28 Jan 2019 11:11:31 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch adds EXC_XFER_TEMPLATE_CRITICAL() for handling transfer to critical exception handler. This will allow to move the normal exception to using the standard EXC_XFER_TEMPLATE() defined in head_32.h Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/head_40x.S | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/arch/powerpc/kernel/head_40x.S b/arch/powerpc/kernel/head_40x.S index 1203075c0c1a..d52e460ea85e 100644 --- a/arch/powerpc/kernel/head_40x.S +++ b/arch/powerpc/kernel/head_40x.S @@ -219,9 +219,7 @@ label: START_EXCEPTION(n, label); \ CRITICAL_EXCEPTION_PROLOG; \ addi r3,r1,STACK_FRAME_OVERHEAD; \ - EXC_XFER_TEMPLATE(hdlr, n+2, (MSR_KERNEL & ~(MSR_ME|MSR_DE|MSR_CE)), \ - NOCOPY, crit_transfer_to_handler, \ - ret_from_crit_exc) + EXC_XFER_TEMPLATE_CRITICAL(hdlr, n+2) #define EXC_XFER_TEMPLATE(hdlr, trap, msr, copyee, tfer, ret) \ li r10,trap; \ @@ -233,6 +231,14 @@ label: .long hdlr; \ .long ret +#define EXC_XFER_TEMPLATE_CRITICAL(hdlr, trap) \ + li r10,trap; \ + stw r10,_TRAP(r11); \ + li r10, MSR_KERNEL & ~(MSR_ME|MSR_DE|MSR_CE); \ + bl crit_transfer_to_handler; \ + .long hdlr; \ + .long ret_from_crit_exc + #define COPY_EE(d, s) rlwimi d,s,0,16,16 #define NOCOPY(d, s) @@ -733,9 +739,7 @@ label: /* continue normal handling for a critical exception... */ 2: mfspr r4,SPRN_DBSR addi r3,r1,STACK_FRAME_OVERHEAD - EXC_XFER_TEMPLATE(DebugException, 0x2002, \ - (MSR_KERNEL & ~(MSR_ME|MSR_DE|MSR_CE)), \ - NOCOPY, crit_transfer_to_handler, ret_from_crit_exc) + EXC_XFER_TEMPLATE_CRITICAL(DebugException, 0x2002) /* Programmable Interval Timer (PIT) Exception. (from 0x1000) */ Decrementer: @@ -755,10 +759,7 @@ FITException: WDTException: CRITICAL_EXCEPTION_PROLOG; addi r3,r1,STACK_FRAME_OVERHEAD; - EXC_XFER_TEMPLATE(WatchdogException, 0x1020+2, - (MSR_KERNEL & ~(MSR_ME|MSR_DE|MSR_CE)), - NOCOPY, crit_transfer_to_handler, - ret_from_crit_exc) + EXC_XFER_TEMPLATE_CRITICAL(WatchdogException, 0x1020+2) /* * The other Data TLB exceptions bail out to this point -- 2.13.3