Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1844898ybl; Sat, 31 Aug 2019 03:21:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqxVuGrpnfXZpyvzaiZVV/q0LCLZcbiG8IZyOATPj3Kdrj96GPCKjOpLv+hSk810fztmEq+N X-Received: by 2002:a17:902:ab86:: with SMTP id f6mr1470302plr.15.1567246868031; Sat, 31 Aug 2019 03:21:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567246868; cv=none; d=google.com; s=arc-20160816; b=PrVG/KzA06h8d/6oGDwu6yppvdo29ZY9blHydiFLgpSrRej/e5ReMnV20n5d2W0+Qi jA4fzI90LgqLo8dfqebP1JoKaC9UXz39zg8NUXzrHMQqHgX7U7lEpBMKTgg2luTldCTY lJQiismXWH5HmNog2YZfim6ZRPLLuCrJX/g0Q7neZ2WSpkdaK8Kvy9XdJ+m4gQ7fvSAU HLo9PIHeWgw4lv7x9g8k6biZAsqfTS4DDU90EoC674bkKInanBKQmXw8/S4prc2J4Ue5 n/Wnfr9h9EUyMOkdfkkgKmdq8w5SOEi2goLdSNwaRbnLf+W/a0mtNnr8GUBIChABTyab GumQ== 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=E4aomYJpSb8XUJSjcLreHvSqPpw/Uuaudfxhpwkoawk=; b=Om1D2JU7vt1J+1og2HrvFyoKxXy2SewzFEObKkbfdh6TV7HgD/mBaidQqGBc8KeAxQ RGrsvHYxT+EpXPTt+eP4jTG+hFXkwXUvztAlJvIxF8icBAgFRDPvisXz87Rdtuh5ZEju 5fLQqW8+2NzkILZpxB8OsDtYX8tRvj3n7/T++Ar5egR48oBKHSDLq1XNjd0Ax9LeW8T9 qGtmTe7isWGwuApV8N0RzZfvAcsRYxA5AdJt8mKvKKd04Etjli1FIt9YEJop+ILy4kwP vn32oEWw3itIjTZUBDGeTT0TrZVJh8LQzhcsJED2exYk3ynO7DBNo4yRmNMjwK71Ky2D l07g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=WlJ0A9OK; 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 97si6992846pld.245.2019.08.31.03.20.52; Sat, 31 Aug 2019 03:21:08 -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; dkim=pass header.i=@c-s.fr header.s=mail header.b=WlJ0A9OK; 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 S1728465AbfHaKTE (ORCPT + 99 others); Sat, 31 Aug 2019 06:19:04 -0400 Received: from pegase1.c-s.fr ([93.17.236.30]:34472 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726296AbfHaKS3 (ORCPT ); Sat, 31 Aug 2019 06:18:29 -0400 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 46LC3j6LMjz9v4gS; Sat, 31 Aug 2019 12:18:25 +0200 (CEST) Authentication-Results: localhost; dkim=pass reason="1024-bit key; insecure key" header.d=c-s.fr header.i=@c-s.fr header.b=WlJ0A9OK; 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 5GgF6y7icjAm; Sat, 31 Aug 2019 12:18:25 +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 46LC3j5BY1z9v4gL; Sat, 31 Aug 2019 12:18:25 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=c-s.fr; s=mail; t=1567246705; bh=E4aomYJpSb8XUJSjcLreHvSqPpw/Uuaudfxhpwkoawk=; h=In-Reply-To:References:From:Subject:To:Cc:Date:From; b=WlJ0A9OKYOkt8dqW8taTTLmi+762lWI8idZEoqrXxzy/Xb/ZGgAh84wLCd7uH9ufV CSAaTvlTu2DM9hwtrVIWXT+bV9t9L3/58BTvCnF4KcECXt4X33WC19gQsZuf/XL3gb 4Lw59/XYJP/S2l/QJv5GqOIt5BJYWfTQECMvAIz8= Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 15A938B7B9; Sat, 31 Aug 2019 12:18:27 +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 VMENq3P3FZVC; Sat, 31 Aug 2019 12:18:27 +0200 (CEST) Received: from pc16032vm.idsi0.si.c-s.fr (unknown [192.168.4.90]) by messagerie.si.c-s.fr (Postfix) with ESMTP id B793D8B789; Sat, 31 Aug 2019 12:18:26 +0200 (CEST) Received: by pc16032vm.idsi0.si.c-s.fr (Postfix, from userid 0) id 7D4436985C; Sat, 31 Aug 2019 10:18:26 +0000 (UTC) Message-Id: In-Reply-To: References: From: Christophe Leroy Subject: [RFC PATCH v2 02/10] powerpc/32: Add EXCEPTION_PROLOG_0 in head_32.h To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , npiggin@gmail.com, dja@axtens.net Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Date: Sat, 31 Aug 2019 10:18:26 +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 9e6f01abb31e..53a9dab024c7 100644 --- a/arch/powerpc/kernel/head_32.S +++ b/arch/powerpc/kernel/head_32.S @@ -264,9 +264,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 5ab9178c2347..16d68c8575ca 100644 --- a/arch/powerpc/kernel/head_8xx.S +++ b/arch/powerpc/kernel/head_8xx.S @@ -493,10 +493,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. */ @@ -529,9 +526,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