Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp2661413pxu; Sun, 18 Oct 2020 10:28:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwMlOVYDlWcmWqqSYPQpHJ3x5pwibtsADMIAm62pZy1D6k8lxAQ3NBtceapE76yDDa0li9J X-Received: by 2002:a17:906:745:: with SMTP id z5mr14234228ejb.408.1603042119061; Sun, 18 Oct 2020 10:28:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603042119; cv=none; d=google.com; s=arc-20160816; b=lp4WuxuLTgF4fp5hMnOKXXdgz4xHcDEtNKOoRLJ5Uxbn9Y0gOMpHhjFJPq+bTITH+1 7WIS9qrmdH2e0wfIH73+JzDRM58lZKQ3iKTKfMOmQLIcCwhdtrq+ZO6DcE/cNrLSLwlM j1cSIf4vTF5CBU68VbX4bcAVSpypLT6ivoZzpr/oBi7sQtD8zq0Fa9KaEYse2dQvdaH0 eO6p5z//NZlWQO2EjJOU5N3/B5kRjOBmb4n5UERFVOZOno2MHT2KWE06amFYT2e3Q5aS wMHg+t3IZcmkW+otTUVv0pYSVmhcpUiDZ1B6nsudfMCi3oWj4mWCD88WGztUM3KJd01O lLnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:date:cc:to:subject:from:references:in-reply-to :message-id; bh=bNxSGsMr1JypPtv8mDqQ4myqyt+ZcPQBhPF3GBEzHQo=; b=GYBBujJ6peNNSKeTsMd8aAMM4VlipZpfn70vXgk/GGzwKwDPgvv3x6c80+6Hmb2veb eCL2p4ZOerOj9kPtVrAiDvSBeJfM1nGqd29wtF0s5gaZ4BBnsmPDjAfKgqNChZnyw+Mi RfQY4ymbE0qswL0Bmj3nCqN1VLH/N07rY2zPG0L3ux2IaoNi3yGWOms2hTaR+hc6QVmd UzslJ7gSrnt+Ocu1swUmFBbVjSJN4vpMvP500Vx8cQRvxJ9kbTHAi3VTLu10NTJZWITz MmsCTYCqQl0OPzc3pzAKAQL/9EHPcJsl5WoHWkMg9bYOvVCx/zIf85EYBwyNcjrJwdAD TTKA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b29si6234616edn.354.2020.10.18.10.28.16; Sun, 18 Oct 2020 10:28:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727184AbgJRRZ3 (ORCPT + 99 others); Sun, 18 Oct 2020 13:25:29 -0400 Received: from pegase1.c-s.fr ([93.17.236.30]:36642 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725776AbgJRRZZ (ORCPT ); Sun, 18 Oct 2020 13:25:25 -0400 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 4CDmxB401vz9vCyc; Sun, 18 Oct 2020 19:25:18 +0200 (CEST) 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 GN-qKgBtLpLm; Sun, 18 Oct 2020 19:25:18 +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 4CDmxB36Cvz9ty3L; Sun, 18 Oct 2020 19:25:18 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 494D18B778; Sun, 18 Oct 2020 19:25:22 +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 EpJiRDk3HG-l; Sun, 18 Oct 2020 19:25:22 +0200 (CEST) Received: from po17688vm.idsi0.si.c-s.fr (unknown [192.168.4.90]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 034438B75E; Sun, 18 Oct 2020 19:25:22 +0200 (CEST) Received: by po17688vm.idsi0.si.c-s.fr (Postfix, from userid 0) id 1A34466488; Sun, 18 Oct 2020 17:25:18 +0000 (UTC) Message-Id: In-Reply-To: <822833ce3dc10634339818f7d1ab616edf63b0c6.1603041883.git.christophe.leroy@csgroup.eu> References: <822833ce3dc10634339818f7d1ab616edf63b0c6.1603041883.git.christophe.leroy@csgroup.eu> From: Christophe Leroy Subject: [PATCH v2 2/2] powerpc/44x: Don't support 47x code and non 47x code at the same time To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Date: Sun, 18 Oct 2020 17:25:18 +0000 (UTC) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 440/460 variants and 470 variants are not compatible, no need to make code supporting both and using MMU features. Just use CONFIG_PPC_47x to decide what to build. Signed-off-by: Christophe Leroy --- v2: Move outside #ifdef CONFIG_PPC_47x a label "1:" used by 44x --- arch/powerpc/kernel/entry_32.S | 11 +++-------- arch/powerpc/mm/nohash/tlb_low.S | 29 +++++++---------------------- 2 files changed, 10 insertions(+), 30 deletions(-) diff --git a/arch/powerpc/kernel/entry_32.S b/arch/powerpc/kernel/entry_32.S index 8cdc8bcde703..a425360deabb 100644 --- a/arch/powerpc/kernel/entry_32.S +++ b/arch/powerpc/kernel/entry_32.S @@ -439,15 +439,13 @@ syscall_exit_cont: andis. r10,r0,DBCR0_IDM@h bnel- load_dbcr0 #endif -#ifdef CONFIG_44x -BEGIN_MMU_FTR_SECTION +#ifdef CONFIG_PPC_47x lis r4,icache_44x_need_flush@ha lwz r5,icache_44x_need_flush@l(r4) cmplwi cr0,r5,0 bne- 2f +#endif /* CONFIG_PPC_47x */ 1: -END_MMU_FTR_SECTION_IFCLR(MMU_FTR_TYPE_47x) -#endif /* CONFIG_44x */ BEGIN_FTR_SECTION lwarx r7,0,r1 END_FTR_SECTION_IFSET(CPU_FTR_NEED_PAIRED_STWCX) @@ -948,10 +946,7 @@ restore_kuap: /* interrupts are hard-disabled at this point */ restore: -#ifdef CONFIG_44x -BEGIN_MMU_FTR_SECTION - b 1f -END_MMU_FTR_SECTION_IFSET(MMU_FTR_TYPE_47x) +#if defined(CONFIG_44x) && !defined(CONFIG_PPC_47x) lis r4,icache_44x_need_flush@ha lwz r5,icache_44x_need_flush@l(r4) cmplwi cr0,r5,0 diff --git a/arch/powerpc/mm/nohash/tlb_low.S b/arch/powerpc/mm/nohash/tlb_low.S index eaeee402f96e..68797e072f55 100644 --- a/arch/powerpc/mm/nohash/tlb_low.S +++ b/arch/powerpc/mm/nohash/tlb_low.S @@ -92,36 +92,25 @@ _GLOBAL(__tlbil_va) tlbsx. r6,0,r3 bne 10f sync -BEGIN_MMU_FTR_SECTION - b 2f -END_MMU_FTR_SECTION_IFSET(MMU_FTR_TYPE_47x) +#ifndef CONFIG_PPC_47x /* On 440 There are only 64 TLB entries, so r3 < 64, which means bit * 22, is clear. Since 22 is the V bit in the TLB_PAGEID, loading this * value will invalidate the TLB entry. */ tlbwe r6,r6,PPC44x_TLB_PAGEID - isync -10: wrtee r10 - blr -2: -#ifdef CONFIG_PPC_47x +#else oris r7,r6,0x8000 /* specify way explicitly */ clrrwi r4,r3,12 /* get an EPN for the hashing with V = 0 */ ori r4,r4,PPC47x_TLBE_SIZE tlbwe r4,r7,0 /* write it */ +#endif /* !CONFIG_PPC_47x */ isync - wrtee r10 +10: wrtee r10 blr -#else /* CONFIG_PPC_47x */ -1: trap - EMIT_BUG_ENTRY 1b,__FILE__,__LINE__,0; -#endif /* !CONFIG_PPC_47x */ _GLOBAL(_tlbil_all) _GLOBAL(_tlbil_pid) -BEGIN_MMU_FTR_SECTION - b 2f -END_MMU_FTR_SECTION_IFSET(MMU_FTR_TYPE_47x) +#ifndef CONFIG_PPC_47x li r3,0 sync @@ -136,8 +125,7 @@ END_MMU_FTR_SECTION_IFSET(MMU_FTR_TYPE_47x) isync blr -2: -#ifdef CONFIG_PPC_47x +#else /* 476 variant. There's not simple way to do this, hopefully we'll * try to limit the amount of such full invalidates */ @@ -179,11 +167,8 @@ END_MMU_FTR_SECTION_IFSET(MMU_FTR_TYPE_47x) b 1b /* Then loop */ 1: isync /* Sync shadows */ wrtee r11 -#else /* CONFIG_PPC_47x */ -1: trap - EMIT_BUG_ENTRY 1b,__FILE__,__LINE__,0; -#endif /* !CONFIG_PPC_47x */ blr +#endif /* !CONFIG_PPC_47x */ #ifdef CONFIG_PPC_47x -- 2.25.0