Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4144715ybl; Sat, 21 Dec 2019 00:34:01 -0800 (PST) X-Google-Smtp-Source: APXvYqyPUk76kEjJuRdbjXMjRAY7JvzwidBeQP9ore/Ujdqb3fpNyKg710hhsyg07Zzo7Zb37B4I X-Received: by 2002:a9d:bcb:: with SMTP id 69mr20224091oth.290.1576917241796; Sat, 21 Dec 2019 00:34:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576917241; cv=none; d=google.com; s=arc-20160816; b=lbqrHAeVd5s77yRk/n+V2sfCsZ8PMEIL/LgjlpTRGXh8P/OYkygXb4AahMafeMCez0 XwEdJloLF/Va7KSRdf1ztU3WFzkJZiKiXL3t8WFxoELPI5fI8YTgK2K8tyOayuPxoC/Y d6XFpn8pkaYUXQC/PcQiYHt3J/6+2nnUjJWlxQP5IR/WjSYyqCgOug+nktyFt8AKFFd+ UWeK/QOkgKj6Jf03MEbmRYZ1sw3/UMaXpxYe0DQFR7X3IWLigcPMZk8U5eaPFjiaigI5 KZgKGNsBKBh3m/YITCL9CChMTrMNfN2WeKOUpVkQWj3UxdiRJcxRCYw2lLiW8nvtTVhC gN3Q== 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=Q4Vx9mFRM3Dm0sKn4NIYCu+631fsCCe01JIUdOdFckHdjrweDU+ZpBLekP2Lvyx9ju uo2sQtQCxZvJGiQkSo4Qe4OUTMBN9P70tDb16YTFJEaGqt8wcPj7d7i9w5KrsQFhwqVP sp7JrHCb2BMQs//Cwlwdf5b40/tBzmrJccMku7GPq9cUfTZMepCP3jNgpHJSP3q37vfZ XbCunSkqvcfNBf9HSxmvoGbMaaLyJKEKVZrqgeWxX2W49pI2yqwvsvkWo1vSbLPFxCV2 FnssJdsBMSpmJIjnVj/TrSqpFcB/KMIfJucOrZpBAQimWfmDrEkPYdiIHvhUah6gYJFX eNYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=voLX+54V; 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 i6si6459807otp.5.2019.12.21.00.33.50; Sat, 21 Dec 2019 00:34:01 -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=voLX+54V; 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 S1726982AbfLUIcu (ORCPT + 99 others); Sat, 21 Dec 2019 03:32:50 -0500 Received: from pegase1.c-s.fr ([93.17.236.30]:12498 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726877AbfLUIcj (ORCPT ); Sat, 21 Dec 2019 03:32:39 -0500 Received: from localhost (mailhub1-ext [192.168.12.233]) by localhost (Postfix) with ESMTP id 47fzPw39M6z9txhB; Sat, 21 Dec 2019 09:32:36 +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=voLX+54V; 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 lwtBirtmg44i; Sat, 21 Dec 2019 09:32:36 +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 47fzPw27z3z9txh9; Sat, 21 Dec 2019 09:32:36 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=c-s.fr; s=mail; t=1576917156; bh=qRvylrdY1eoWCvXWdblIuIfpjDppGXhuUd6oPfPcO7c=; h=In-Reply-To:References:From:Subject:To:Cc:Date:From; b=voLX+54Vrt97Fo56OOvKP83eF5GMTOOyrb4wqK0AYlOQZdsad5EjhDfpagvA68S/T xmHIrnH43MNiaObbqYRCv1oTMMTDOWy/gmMX4kvQQ2kf8yxcFPZmPcjiQyj4xcyk++ 77Pri7R6P/l2MqJbHNGxtDYAfOMps11b+pkqbwE4= Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 5329B8B77C; Sat, 21 Dec 2019 09:32:37 +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 9I06fE6QEyIy; Sat, 21 Dec 2019 09:32:37 +0100 (CET) Received: from localhost.localdomain (unknown [192.168.4.90]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 0EC178B752; Sat, 21 Dec 2019 09:32:37 +0100 (CET) Received: by localhost.localdomain (Postfix, from userid 0) id CBD3F637B6; Sat, 21 Dec 2019 08:32:36 +0000 (UTC) Message-Id: In-Reply-To: References: From: Christophe Leroy Subject: [PATCH v5 15/17] powerpc/32s: reorganise DSI handler. 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:36 +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