Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp5060126ybh; Tue, 6 Aug 2019 23:41:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqwWuaPTKxsfWsrKjQu1b7qIljjAtVI6VzcTrRiBXtX9VW8fiL2S/Uhs8vuA+yPWPYXgSdsz X-Received: by 2002:a17:90a:33c4:: with SMTP id n62mr7129235pjb.28.1565160068216; Tue, 06 Aug 2019 23:41:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565160068; cv=none; d=google.com; s=arc-20160816; b=MAUUZqnFrW3061YedUoM3R+yOdJM6xMYWiiqed+jpq5zoRkpjDoxtWA0AriC4t5G2r C08+hPN740AOSc6I1M9d1892xqkrQI7mcIlneEwCV4EEay3O4PDIeWuX+PcyUC4Kg3WO zlXow+uO9zJp8tHshKn32mGmg0oEu27pGVSRuDd1vSOJ1dBqhGYOoOLdaJKgLgOp3fYJ fe4IOjY1cVCcX6sxRAHO95nwTvJmCZ0dnZ5mIcGvP2fkv2qX0gU48O4B87hPp7AcDKQD 74MEEKa3KALQWap3DGsaFkQS5/lIKSTOHGh8UrddwbxYnDE4bRUdruJ2uPqGT9EiR1PX 5QeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=coiLEkzFI5kvwcV+DnM4jfS9w+ZBaBdB7KWpiKKub50=; b=aSywrgSO1GJHOC7l1rvTw7ONX+8Bj5e6nazZWvQ5nJjw8FBu6O8t0cLB94LHp+eZp+ X8fdQ30PQqq/o1el5Gj4YuaxTwxkRRFKFsRiyFLkggoVASRCUszQLyxmN7TZfJn+IKtB OMxy/vOcSekN08ot/oqUfigFXbWpoQkujONpGQ854dH6Tu/4dbncMdR8SNZbHVvKN39O wk0NJRLgtYXgiuIC8oMEt5Fkl16TIn8KfZ6guFsXUSOt/sIgGwuVqwNNgf3WBuJrIZc9 whqOsGeVda3XqaJyt0oSL5kHLqKEyfX2S7sssK8EQJcJ76nAHHrpwBYBMVQpTCYTRuAb fIHw== ARC-Authentication-Results: i=1; mx.google.com; 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 k13si22600659pgt.285.2019.08.06.23.40.53; Tue, 06 Aug 2019 23:41: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; 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 S1727354AbfHGGkH (ORCPT + 99 others); Wed, 7 Aug 2019 02:40:07 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:47074 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727308AbfHGGkG (ORCPT ); Wed, 7 Aug 2019 02:40:06 -0400 Received: from DGGEMS412-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id D3079B50E1D9930A370C; Wed, 7 Aug 2019 14:40:02 +0800 (CST) Received: from huawei.com (10.175.124.28) by DGGEMS412-HUB.china.huawei.com (10.3.19.212) with Microsoft SMTP Server id 14.3.439.0; Wed, 7 Aug 2019 14:39:56 +0800 From: Jason Yan To: , , , , , , , , CC: , , , , , , , Jason Yan Subject: [PATCH v5 01/10] powerpc: unify definition of M_IF_NEEDED Date: Wed, 7 Aug 2019 14:56:57 +0800 Message-ID: <20190807065706.11411-2-yanaijie@huawei.com> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20190807065706.11411-1-yanaijie@huawei.com> References: <20190807065706.11411-1-yanaijie@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.124.28] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org M_IF_NEEDED is defined too many times. Move it to a common place. Signed-off-by: Jason Yan Cc: Diana Craciun Cc: Michael Ellerman Cc: Christophe Leroy Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Nicholas Piggin Cc: Kees Cook Reviewed-by: Christophe Leroy Reviewed-by: Diana Craciun Tested-by: Diana Craciun --- arch/powerpc/include/asm/nohash/mmu-book3e.h | 10 ++++++++++ arch/powerpc/kernel/exceptions-64e.S | 10 ---------- arch/powerpc/kernel/fsl_booke_entry_mapping.S | 10 ---------- arch/powerpc/kernel/misc_64.S | 5 ----- 4 files changed, 10 insertions(+), 25 deletions(-) diff --git a/arch/powerpc/include/asm/nohash/mmu-book3e.h b/arch/powerpc/include/asm/nohash/mmu-book3e.h index 4c9777d256fb..0877362e48fa 100644 --- a/arch/powerpc/include/asm/nohash/mmu-book3e.h +++ b/arch/powerpc/include/asm/nohash/mmu-book3e.h @@ -221,6 +221,16 @@ #define TLBILX_T_CLASS2 6 #define TLBILX_T_CLASS3 7 +/* + * The mapping only needs to be cache-coherent on SMP, except on + * Freescale e500mc derivatives where it's also needed for coherent DMA. + */ +#if defined(CONFIG_SMP) || defined(CONFIG_PPC_E500MC) +#define M_IF_NEEDED MAS2_M +#else +#define M_IF_NEEDED 0 +#endif + #ifndef __ASSEMBLY__ #include diff --git a/arch/powerpc/kernel/exceptions-64e.S b/arch/powerpc/kernel/exceptions-64e.S index 1cfb3da4a84a..fd49ec07ce4a 100644 --- a/arch/powerpc/kernel/exceptions-64e.S +++ b/arch/powerpc/kernel/exceptions-64e.S @@ -1342,16 +1342,6 @@ skpinv: addi r6,r6,1 /* Increment */ sync isync -/* - * The mapping only needs to be cache-coherent on SMP, except on - * Freescale e500mc derivatives where it's also needed for coherent DMA. - */ -#if defined(CONFIG_SMP) || defined(CONFIG_PPC_E500MC) -#define M_IF_NEEDED MAS2_M -#else -#define M_IF_NEEDED 0 -#endif - /* 6. Setup KERNELBASE mapping in TLB[0] * * r3 = MAS0 w/TLBSEL & ESEL for the entry we started in diff --git a/arch/powerpc/kernel/fsl_booke_entry_mapping.S b/arch/powerpc/kernel/fsl_booke_entry_mapping.S index ea065282b303..de0980945510 100644 --- a/arch/powerpc/kernel/fsl_booke_entry_mapping.S +++ b/arch/powerpc/kernel/fsl_booke_entry_mapping.S @@ -153,16 +153,6 @@ skpinv: addi r6,r6,1 /* Increment */ tlbivax 0,r9 TLBSYNC -/* - * The mapping only needs to be cache-coherent on SMP, except on - * Freescale e500mc derivatives where it's also needed for coherent DMA. - */ -#if defined(CONFIG_SMP) || defined(CONFIG_PPC_E500MC) -#define M_IF_NEEDED MAS2_M -#else -#define M_IF_NEEDED 0 -#endif - #if defined(ENTRY_MAPPING_BOOT_SETUP) /* 6. Setup KERNELBASE mapping in TLB1[0] */ diff --git a/arch/powerpc/kernel/misc_64.S b/arch/powerpc/kernel/misc_64.S index b55a7b4cb543..26074f92d4bc 100644 --- a/arch/powerpc/kernel/misc_64.S +++ b/arch/powerpc/kernel/misc_64.S @@ -432,11 +432,6 @@ kexec_create_tlb: rlwimi r9,r10,16,4,15 /* Setup MAS0 = TLBSEL | ESEL(r9) */ /* Set up a temp identity mapping v:0 to p:0 and return to it. */ -#if defined(CONFIG_SMP) || defined(CONFIG_PPC_E500MC) -#define M_IF_NEEDED MAS2_M -#else -#define M_IF_NEEDED 0 -#endif mtspr SPRN_MAS0,r9 lis r9,(MAS1_VALID|MAS1_IPROT)@h -- 2.17.2