Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp4164591ybc; Tue, 26 Nov 2019 04:59:04 -0800 (PST) X-Google-Smtp-Source: APXvYqyPP5h6jYBbM2Ky9hFSUeqR7KuMFfxVVIfudGvsXxGBkdr3OPIwcIeEKGnAky99AiNFmpG/ X-Received: by 2002:a17:906:344c:: with SMTP id d12mr41511476ejb.227.1574773144124; Tue, 26 Nov 2019 04:59:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574773144; cv=none; d=google.com; s=arc-20160816; b=e8rfwypg6LFW8pUOPJ2UHohmnC3p4uRZEi+lRxtN++Cne2NPF26lCOZA5x4UQfmE7M OHIVkCQkpQOEHsJ6G4BAtMHwwaaem4D2U9ppxKX4ey5EP7VtmYh9ZEOdQLjhpggSZw6I vt9JFoZvDqQPqvo8lN17+J24SP1g8wZu5xU1ceFfXiI0x8bvje8WqzI6IfyEJ668erzF Mu2AwhxYqh5qDr3g9weN7DYvDDr+IImbrVEytCaDJaCnBmTwVrhCOVSJymvuqlt0UQ/i vLo5rgpzlWOLhBJgRJ+fMYxk5DmyvkwJriInqgG/lzYna/JMRey+/bRMQxLpOV2VFHWV zeqw== 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=qRvylrdY1eoWCvXWdblIuIfpjDppGXhuUd6oPfPcO7c=; b=jctxH/FmPPWlX3KTHCjL7/FGUYfsbsct+ZCCwhyagpCSzrktPyf76PhuKrGXKCc95i Wr+THvEwfAMP3Vyi0/7UJKMOFlp+Bkb+1yI685LLbTbVhSVIeRR07VB4iAVoWRb5G1nd ptdSYeVH5L1rzqx/l4h4QIKSww8LU1DIUXSRU0AvaAyRVMj4RCd4uNfGzxzIrGASsDbY s+ggsQ0Zs4zO1QiT2Xvg1PPuEmujCHfeXRG1K5C+3YsstMb/dMs95/nn7d0LAHgfjPXS J9JGUiaSgB2uDfwipy7wb1YE4wsxn0DzDpOEN84+Rri38mKO+RKEULAglK180wkiVzrD boyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=tQ0qhDKU; 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 q40si8227055eda.218.2019.11.26.04.58.39; Tue, 26 Nov 2019 04:59:04 -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=tQ0qhDKU; 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 S1728557AbfKZMgd (ORCPT + 99 others); Tue, 26 Nov 2019 07:36:33 -0500 Received: from pegase1.c-s.fr ([93.17.236.30]:44208 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728495AbfKZMgU (ORCPT ); Tue, 26 Nov 2019 07:36:20 -0500 Received: from localhost (mailhub1-ext [192.168.12.233]) by localhost (Postfix) with ESMTP id 47Mk0d3zr6z9v0GF; Tue, 26 Nov 2019 13:36:17 +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=tQ0qhDKU; 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 ESRVT72F2IAT; Tue, 26 Nov 2019 13:36:17 +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 47Mk0d2mFsz9v0G3; Tue, 26 Nov 2019 13:36:17 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=c-s.fr; s=mail; t=1574771777; bh=qRvylrdY1eoWCvXWdblIuIfpjDppGXhuUd6oPfPcO7c=; h=In-Reply-To:References:From:Subject:To:Cc:Date:From; b=tQ0qhDKUAmxnmr94/uWODgTkbZt7bx0AScwLnHdHLeiqeuGzHBwfqYHbzqlhVzfq5 6YZWi17oElvUHLHtlNaP2ncLyyQOjKSFIPu+itay0A+tQ+ZRvkD2SCybU53vZ2Tmcx ZSQh3Eiyy7lIaK+a1PfucgCf7jRf8KyZ9LPZRd4o= Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id AC40E8B7FF; Tue, 26 Nov 2019 13:36:18 +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 yks6Q9RGG00r; Tue, 26 Nov 2019 13:36:18 +0100 (CET) Received: from po16098vm.idsi0.si.c-s.fr (unknown [192.168.4.90]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 792638B771; Tue, 26 Nov 2019 13:36:18 +0100 (CET) Received: by po16098vm.idsi0.si.c-s.fr (Postfix, from userid 0) id 4CF7C6B76A; Tue, 26 Nov 2019 12:36:18 +0000 (UTC) Message-Id: In-Reply-To: References: From: Christophe Leroy Subject: [PATCH v4 14/16] powerpc/32s: reorganise DSI handler. To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-mm@kvack.org Date: Tue, 26 Nov 2019 12:36:18 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The part decidated to handling hash_page() is fully unneeded for processors not having real hash pages like the 603. Lets enlarge the content of the feature fixup, and provide an alternative which jumps directly instead of getting NIPs. Also, in preparation of VMAP stacks, the end of DSI handler has moved to later in the code as it won't fit anymore once VMAP stacks are there. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/head_32.S | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/arch/powerpc/kernel/head_32.S b/arch/powerpc/kernel/head_32.S index 449625b4ff03..7ec780858299 100644 --- a/arch/powerpc/kernel/head_32.S +++ b/arch/powerpc/kernel/head_32.S @@ -295,24 +295,20 @@ __secondary_hold_acknowledge: DO_KVM 0x300 DataAccess: EXCEPTION_PROLOG - mfspr r10,SPRN_DSISR - stw r10,_DSISR(r11) + get_and_save_dar_dsisr_on_stack r4, r5, r11 +BEGIN_MMU_FTR_SECTION #ifdef CONFIG_PPC_KUAP - andis. r0,r10,(DSISR_BAD_FAULT_32S | DSISR_DABRMATCH | DSISR_PROTFAULT)@h + andis. r0, r5, (DSISR_BAD_FAULT_32S | DSISR_DABRMATCH | DSISR_PROTFAULT)@h #else - andis. r0,r10,(DSISR_BAD_FAULT_32S|DSISR_DABRMATCH)@h + andis. r0, r5, (DSISR_BAD_FAULT_32S | DSISR_DABRMATCH)@h #endif - bne 1f /* if not, try to put a PTE */ - mfspr r4,SPRN_DAR /* into the hash table */ - rlwinm r3,r10,32-15,21,21 /* DSISR_STORE -> _PAGE_RW */ -BEGIN_MMU_FTR_SECTION + bne handle_page_fault_tramp_2 /* if not, try to put a PTE */ + rlwinm r3, r5, 32 - 15, 21, 21 /* DSISR_STORE -> _PAGE_RW */ bl hash_page -END_MMU_FTR_SECTION_IFSET(MMU_FTR_HPTE_TABLE) -1: lwz r5,_DSISR(r11) /* get DSISR value */ - mfspr r4,SPRN_DAR - stw r4, _DAR(r11) - EXC_XFER_LITE(0x300, handle_page_fault) - + b handle_page_fault_tramp_1 +FTR_SECTION_ELSE + b handle_page_fault_tramp_2 +ALT_MMU_FTR_SECTION_END_IFSET(MMU_FTR_HPTE_TABLE) /* Instruction access exception. */ . = 0x400 @@ -642,6 +638,13 @@ END_MMU_FTR_SECTION_IFSET(MMU_FTR_NEED_DTLB_SW_LRU) . = 0x3000 +handle_page_fault_tramp_1: + lwz r4, _DAR(r11) + lwz r5, _DSISR(r11) + /* fall through */ +handle_page_fault_tramp_2: + EXC_XFER_LITE(0x300, handle_page_fault) + AltiVecUnavailable: EXCEPTION_PROLOG #ifdef CONFIG_ALTIVEC -- 2.13.3