Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4144233ybl; Sat, 21 Dec 2019 00:33:18 -0800 (PST) X-Google-Smtp-Source: APXvYqy9Xa0qBtbBvI1txkWh1gIyjTau+ZGs7OGmiz1Os2EfBCmqk10+PpsvF8YEPe5XOWiXCBNf X-Received: by 2002:a9d:1d02:: with SMTP id m2mr18460363otm.45.1576917198884; Sat, 21 Dec 2019 00:33:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576917198; cv=none; d=google.com; s=arc-20160816; b=Ts1mrcXHUDddwSz9PrHdcO9evA1pvOog0TCQ+3tSxWcngBqHdDybNNhTYDIUD4Pfiv VIPBKTjhJ3IMsoC/RxWfN8VB1pnwUiS3IvmwS6sji3njy1W+bPheITnQneYCLij2xsp6 daIjY/7ku/gMvxpW7MXvxU6U4ApKS5JT5HBaO0is4zRjfib1ejdCBtwPJMW+pH9Fi47x EHCxL76KKnR1vw1xSbo8NP5qebGITTAzDl0hHxHt0/JNWT4LQSw4h4Gp7PTkm/ZBBhbZ IStdJNv0zkzN3EQkyv7YnKM5mu0567zTEESKcVdIXqHAPYbSByufFUTmXq3BXTkKFHzd T2EA== 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=EO9Qxk0hjLo3ieTea7LgHM8klTAmnyp7SMifgH/BhW0=; b=mz/Doa7r1L3LAM514rsyXjbIKOsNmAQ9Uug6l27zA/BOoSL9bZSV6osyGNYbu6X1qY sDXbMLZes0GxEP2oCfpaAXX6BFqMSEx+LRdgTryDLSjFX9SAhNuN4mEEbx5lHBDsaOo4 ij5t8qbxcyiA/TyZbWXQI50+hH4HHgs5pDHSuHFM5dZHyQk7bmfS4t1QepTiaIw11ftr HuzOhR2lVIVlzJ0d9htn5XeT7NdsJxO0zIialNGd9rP8A2fwRPREfPEB77djUY4zGAyj MN2Z/hsGzx/amJTeTYyPvI+nM5la88JZjvtH71ZRRmbxGN0fUt8bt+rH2GLXE8ZRUvvl gqNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b="lI8r3u/l"; 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 b6si6410719oiy.116.2019.12.21.00.33.07; Sat, 21 Dec 2019 00:33:18 -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="lI8r3u/l"; 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 S1726549AbfLUIc2 (ORCPT + 99 others); Sat, 21 Dec 2019 03:32:28 -0500 Received: from pegase1.c-s.fr ([93.17.236.30]:13034 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726086AbfLUIcZ (ORCPT ); Sat, 21 Dec 2019 03:32:25 -0500 Received: from localhost (mailhub1-ext [192.168.12.233]) by localhost (Postfix) with ESMTP id 47fzPg01CFz9v1Kx; Sat, 21 Dec 2019 09:32:23 +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=lI8r3u/l; 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 syU9U0k6KFJy; Sat, 21 Dec 2019 09:32:22 +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 47fzPf5wbRz9v1Ks; Sat, 21 Dec 2019 09:32:22 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=c-s.fr; s=mail; t=1576917142; bh=EO9Qxk0hjLo3ieTea7LgHM8klTAmnyp7SMifgH/BhW0=; h=In-Reply-To:References:From:Subject:To:Cc:Date:From; b=lI8r3u/lJlY9+wzp0sU8VTWjYCezpFEwsqUisYwci/7n+CMETOh5Sq4rOoou3c2OB fttMziM1EUe0UZ/1WZo/ozBMgxioDEz/bFkjOvYeCfnoyDF5CBW5ajDkx/FtUkbPSl AmIFbLLpoDW+qcvYPIgCcn006qaZDU707pSBLez0= Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id CA7888B77C; Sat, 21 Dec 2019 09:32:23 +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 iVjlbE3Yq_81; Sat, 21 Dec 2019 09:32:23 +0100 (CET) Received: from localhost.localdomain (unknown [192.168.4.90]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 950178B752; Sat, 21 Dec 2019 09:32:23 +0100 (CET) Received: by localhost.localdomain (Postfix, from userid 0) id 5D134637B6; Sat, 21 Dec 2019 08:32:23 +0000 (UTC) Message-Id: <2249fe62f481121a180e9655ad2b998093f318f3.1576916812.git.christophe.leroy@c-s.fr> In-Reply-To: References: From: Christophe Leroy Subject: [PATCH v5 02/17] powerpc/32: Add EXCEPTION_PROLOG_0 in head_32.h To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , dja@axtens.net Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-mm@kvack.org Date: Sat, 21 Dec 2019 08:32:23 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch creates a macro for the very first part of exception prolog, this will help when implementing CONFIG_VMAP_STACK Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/head_32.S | 4 +--- arch/powerpc/kernel/head_32.h | 9 ++++++--- arch/powerpc/kernel/head_8xx.S | 9 ++------- 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/arch/powerpc/kernel/head_32.S b/arch/powerpc/kernel/head_32.S index 4a24f8f026c7..9e868567b716 100644 --- a/arch/powerpc/kernel/head_32.S +++ b/arch/powerpc/kernel/head_32.S @@ -272,9 +272,7 @@ __secondary_hold_acknowledge: */ . = 0x200 DO_KVM 0x200 - mtspr SPRN_SPRG_SCRATCH0,r10 - mtspr SPRN_SPRG_SCRATCH1,r11 - mfcr r10 + EXCEPTION_PROLOG_0 #ifdef CONFIG_PPC_CHRP mfspr r11, SPRN_SPRG_THREAD lwz r11, RTAS_SP(r11) diff --git a/arch/powerpc/kernel/head_32.h b/arch/powerpc/kernel/head_32.h index b2ca8c9ffd8b..8e345f8d4b0e 100644 --- a/arch/powerpc/kernel/head_32.h +++ b/arch/powerpc/kernel/head_32.h @@ -10,13 +10,16 @@ * We assume sprg3 has the physical address of the current * task's thread_struct. */ - .macro EXCEPTION_PROLOG + EXCEPTION_PROLOG_0 + EXCEPTION_PROLOG_1 + EXCEPTION_PROLOG_2 +.endm + +.macro EXCEPTION_PROLOG_0 mtspr SPRN_SPRG_SCRATCH0,r10 mtspr SPRN_SPRG_SCRATCH1,r11 mfcr r10 - EXCEPTION_PROLOG_1 - EXCEPTION_PROLOG_2 .endm .macro EXCEPTION_PROLOG_1 diff --git a/arch/powerpc/kernel/head_8xx.S b/arch/powerpc/kernel/head_8xx.S index 19f583e18402..dac7c0a34eea 100644 --- a/arch/powerpc/kernel/head_8xx.S +++ b/arch/powerpc/kernel/head_8xx.S @@ -494,10 +494,7 @@ InstructionTLBError: */ . = 0x1400 DataTLBError: - mtspr SPRN_SPRG_SCRATCH0, r10 - mtspr SPRN_SPRG_SCRATCH1, r11 - mfcr r10 - + EXCEPTION_PROLOG_0 mfspr r11, SPRN_DAR cmpwi cr0, r11, RPN_PATTERN beq- FixupDAR /* must be a buggy dcbX, icbi insn. */ @@ -530,9 +527,7 @@ DARFixed:/* Return from dcbx instruction bug workaround */ */ . = 0x1c00 DataBreakpoint: - mtspr SPRN_SPRG_SCRATCH0, r10 - mtspr SPRN_SPRG_SCRATCH1, r11 - mfcr r10 + EXCEPTION_PROLOG_0 mfspr r11, SPRN_SRR0 cmplwi cr0, r11, (.Ldtlbie - PAGE_OFFSET)@l cmplwi cr7, r11, (.Litlbie - PAGE_OFFSET)@l -- 2.13.3