Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp1631085imj; Fri, 8 Feb 2019 04:54:25 -0800 (PST) X-Google-Smtp-Source: AHgI3IZ/K/YZ7OdJitJm3pRTXQPHP9vf8newN8uuKwQQ0d2igGBRn1Lo1gf2mML4rpoBpF/nU/tR X-Received: by 2002:a63:e715:: with SMTP id b21mr20214588pgi.305.1549630465160; Fri, 08 Feb 2019 04:54:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549630465; cv=none; d=google.com; s=arc-20160816; b=bPrvb2nKnUufGFobGeva0chZoGznFbvlLQr1DXHrvJfN1Ujv70NKCzCYNf+aEfDEGD K264ZF7+9f+J2JSZdu3yPShHzPYTWTEIBsObZTd1cPK3Lq8d6L7IP5HBX1bO38I1BwMz plzMEt8jbFUDxGHwitADO5+xTAkQbCaFwnUNrE9R68TJ1gbpCnHlZk26yU5+ZFLE6hkP 8RV5aRNq2iBjXRlWyEtnA4zhVUl08fzJz8mXZpve/hBld1Y2Hz9piy4ffMb6uAZZPqNE Z1MIi//jzZ+UT7VjkLWnPz8V5x3FIDYQ4rcgPGbhBNhxLtyTX1CsAqM3GbSFKSuOCaVG Hjkg== 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=20GCv/fiQPoQFx7rP9aeZEnvfwQXA/ISPhMiEPkNe6E=; b=RPxaBNaSRoT4Yv49X6ziGW1F9lzclXx7TqFgR6oQN11tejiMhwIcMbSqZRtHnHxXG8 kb45nwQHoGnazgDErb7JmPxgumuAjq8vfnqOcCOEt2BeSmGFXB9Ibg8ysYZuLb/b8J/H thtSiJs0FnQv9UleI3WWsjr+DgmYVRWkyk9eSlJexa7KNzASGd9QEILxEWPcXYmpsmVN dYY/g91vbIyeVhi4LNQHONRiEnShNj/pwZjW7rSW1HkTn0XxwNXX+DVCwm28wmF9RNfP PcDjXARyJJ6EuqigdC0P+mHIdsCznxHaJKnFJ93Oi1lJrLTF437/mCY8Wzy1zg0X/qvs 48nQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=ILNT8Jel; 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 g22si2608451pfj.222.2019.02.08.04.54.09; Fri, 08 Feb 2019 04:54:25 -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=ILNT8Jel; 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 S1727912AbfBHMx3 (ORCPT + 99 others); Fri, 8 Feb 2019 07:53:29 -0500 Received: from pegase1.c-s.fr ([93.17.236.30]:52276 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727448AbfBHMwd (ORCPT ); Fri, 8 Feb 2019 07:52:33 -0500 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 43ww7f10g0z9v0dJ; Fri, 8 Feb 2019 13:52:30 +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=ILNT8Jel; 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 S8JwDQahEa_o; Fri, 8 Feb 2019 13:52:30 +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 43ww7d756bz9v0dH; Fri, 8 Feb 2019 13:52:29 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=c-s.fr; s=mail; t=1549630350; bh=20GCv/fiQPoQFx7rP9aeZEnvfwQXA/ISPhMiEPkNe6E=; h=In-Reply-To:References:From:Subject:To:Cc:Date:From; b=ILNT8JelP59dCAPGCmdyCGaLj+Lu2SzGlhPi59kLOETR9Kfhe4bVD0GBjeG+5HrHo s3i4M07DmKXxtn6wKj6RbLWjyaw5Tm1V6clg/tRQX80UiVlOvEVwF/vnTjVNi/dOxR bCw5AyhWLnQHTE7oFBgnMB4N3sbmGiEyFwMPWF24= Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 4F9C48B8D7; Fri, 8 Feb 2019 13:52: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 XlkxHtQ0LuPp; Fri, 8 Feb 2019 13:52: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 2CD288B756; Fri, 8 Feb 2019 13:52:31 +0100 (CET) Received: by po16846vm.idsi0.si.c-s.fr (Postfix, from userid 0) id 16C28653E8; Fri, 8 Feb 2019 12:52:31 +0000 (UTC) Message-Id: <9d62f57416746490d8553efa38c9cebd6db336eb.1549630193.git.christophe.leroy@c-s.fr> In-Reply-To: References: From: Christophe Leroy Subject: [PATCH v1 07/16] powerpc/40x: Split and rename NORMAL_EXCEPTION_PROLOG To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Nicholas Piggin Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Date: Fri, 8 Feb 2019 12:52:31 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch splits NORMAL_EXCEPTION_PROLOG in the same way as in head_8xx.S and head_32.S and renames it EXCEPTION_PROLOG() as well to match head_32.h Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/head_40x.S | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/arch/powerpc/kernel/head_40x.S b/arch/powerpc/kernel/head_40x.S index f3bfb695f952..2961e2aa1d18 100644 --- a/arch/powerpc/kernel/head_40x.S +++ b/arch/powerpc/kernel/head_40x.S @@ -103,10 +103,14 @@ _ENTRY(saved_ksp_limit) * turned off (i.e. using physical addresses). We assume SPRG_THREAD has * the physical address of the current task thread_struct. */ -#define NORMAL_EXCEPTION_PROLOG \ +#define EXCEPTION_PROLOG \ mtspr SPRN_SPRG_SCRATCH0,r10; /* save two registers to work with */\ mtspr SPRN_SPRG_SCRATCH1,r11; \ mfcr r10; /* save CR in r10 for now */\ + EXCEPTION_PROLOG_1; \ + EXCEPTION_PROLOG_2 + +#define EXCEPTION_PROLOG_1 \ mfspr r11,SPRN_SRR1; /* check whether user or kernel */\ andi. r11,r11,MSR_PR; \ tophys(r11,r1); \ @@ -115,7 +119,9 @@ _ENTRY(saved_ksp_limit) lwz r11,TASK_STACK-THREAD(r11); /* this thread's kernel stack */\ addi r11,r11,THREAD_SIZE; \ tophys(r11,r11); \ -1: subi r11,r11,INT_FRAME_SIZE; /* Allocate an exception frame */\ +1: subi r11,r11,INT_FRAME_SIZE /* Allocate an exception frame */ + +#define EXCEPTION_PROLOG_2 \ stw r10,_CCR(r11); /* save various registers */\ stw r12,GPR12(r11); \ stw r9,GPR9(r11); \ @@ -205,7 +211,7 @@ label: #define EXCEPTION(n, label, hdlr, xfer) \ START_EXCEPTION(n, label); \ - NORMAL_EXCEPTION_PROLOG; \ + EXCEPTION_PROLOG; \ addi r3,r1,STACK_FRAME_OVERHEAD; \ xfer(n, hdlr) @@ -396,7 +402,7 @@ label: * This is caused by a fetch from non-execute or guarded pages. */ START_EXCEPTION(0x0400, InstructionAccess) - NORMAL_EXCEPTION_PROLOG + EXCEPTION_PROLOG mr r4,r12 /* Pass SRR0 as arg2 */ li r5,0 /* Pass zero as arg3 */ EXC_XFER_LITE(0x400, handle_page_fault) @@ -406,7 +412,7 @@ label: /* 0x0600 - Alignment Exception */ START_EXCEPTION(0x0600, Alignment) - NORMAL_EXCEPTION_PROLOG + EXCEPTION_PROLOG mfspr r4,SPRN_DEAR /* Grab the DEAR and save it */ stw r4,_DEAR(r11) addi r3,r1,STACK_FRAME_OVERHEAD @@ -414,7 +420,7 @@ label: /* 0x0700 - Program Exception */ START_EXCEPTION(0x0700, ProgramCheck) - NORMAL_EXCEPTION_PROLOG + EXCEPTION_PROLOG mfspr r4,SPRN_ESR /* Grab the ESR and save it */ stw r4,_ESR(r11) addi r3,r1,STACK_FRAME_OVERHEAD @@ -427,7 +433,7 @@ label: /* 0x0C00 - System Call Exception */ START_EXCEPTION(0x0C00, SystemCall) - NORMAL_EXCEPTION_PROLOG + EXCEPTION_PROLOG EXC_XFER_EE_LITE(0xc00, DoSyscall) EXCEPTION(0x0D00, Trap_0D, unknown_exception, EXC_XFER_EE) @@ -733,7 +739,7 @@ label: /* Programmable Interval Timer (PIT) Exception. (from 0x1000) */ Decrementer: - NORMAL_EXCEPTION_PROLOG + EXCEPTION_PROLOG lis r0,TSR_PIS@h mtspr SPRN_TSR,r0 /* Clear the PIT exception */ addi r3,r1,STACK_FRAME_OVERHEAD @@ -741,7 +747,7 @@ Decrementer: /* Fixed Interval Timer (FIT) Exception. (from 0x1010) */ FITException: - NORMAL_EXCEPTION_PROLOG + EXCEPTION_PROLOG addi r3,r1,STACK_FRAME_OVERHEAD; EXC_XFER_EE(0x1010, unknown_exception) @@ -759,7 +765,7 @@ WDTException: * if they can't resolve the lightweight TLB fault. */ DataAccess: - NORMAL_EXCEPTION_PROLOG + EXCEPTION_PROLOG mfspr r5,SPRN_ESR /* Grab the ESR, save it, pass arg3 */ stw r5,_ESR(r11) mfspr r4,SPRN_DEAR /* Grab the DEAR, save it, pass arg2 */ -- 2.13.3