Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp4533057ybi; Tue, 30 Jul 2019 03:45:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqz+An3UZWHFVfWC0/aG4zP9mbPzC6M6LvR1V8VgOix3CA9hxpgO/guiQX8zxlui3+p4fkAr X-Received: by 2002:a17:90a:8591:: with SMTP id m17mr118354666pjn.100.1564483553323; Tue, 30 Jul 2019 03:45:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564483553; cv=none; d=google.com; s=arc-20160816; b=kIi3p0xNreG+aGBrNFZGMGp1ntQ0Yg+tIgDYazg2zM6srueLGQrLOedSitf5s4yRQn lj4Pe3nHr2WMml20KPj9BWeZBrbHMYbmU0ciI6n0S9dUba6xRB45vkWJnm/NoJRGt9Up lV1td4hCOy9EaBcjxouGdtsJ541nGCDFo6GbkpM99YOHdmdS71X8yBO4JlE0Ig4CGGLI PV/MVx3HOowvJbUZDjtzZL/OLh0SXccn1QcSAIhDmOq0+TgL/eF8ocfZW/np3xgPiksR pZ328FWvO8lxGLCj6OMbDbbGMtg1JqBB4uqy/uhxlUtSa6AozqZQ42HNxNr70V9COPmy tpWg== 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=G+4SngQBFU2guhYVkVxfIbM8ASGjNS0+RWMVPMO3IX8=; b=opVDmqDdfpqCxbWfwiomjYw3HteJ+h6i1eRgGgPxHH6n+8YovB3nFir3InU1NO3lEO 9g+P8tND25Kmh0jaccX4zbBfaRX9tm1/vMmcaP5JlwbVpD5WveKactB/2MKCSwDJbMwu PgWJSxUlz0nt/bpek5t6tuB7dxzBVywtAMgMQ5BUbmVWByqMYFzeFX40nWs/hc9LxcKT vsC+vrBpHiC7bGd5uJeB1oisZjOcfyGi4y23CUr3dYkVKdAiNZrsv8rcNiT+Oj3IdRJ+ jD6pZT2mBy3xr+29F9mDA4DHfqELJsPCe9jjkTzLiJH2pZpVUPXLqtDh2UblvHVYZ9Kd aePw== 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 m42si27878106pje.31.2019.07.30.03.45.37; Tue, 30 Jul 2019 03:45:53 -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 S1729659AbfG3HZc (ORCPT + 99 others); Tue, 30 Jul 2019 03:25:32 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:3244 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729407AbfG3HZb (ORCPT ); Tue, 30 Jul 2019 03:25:31 -0400 Received: from DGGEMS413-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id EA7D461F1782D299E9AC; Tue, 30 Jul 2019 15:25:29 +0800 (CST) Received: from huawei.com (10.175.124.28) by DGGEMS413-HUB.china.huawei.com (10.3.19.213) with Microsoft SMTP Server id 14.3.439.0; Tue, 30 Jul 2019 15:25:23 +0800 From: Jason Yan To: , , , , , , , , CC: , , , , , , , Jason Yan Subject: [PATCH v2 01/10] powerpc: unify definition of M_IF_NEEDED Date: Tue, 30 Jul 2019 15:42:16 +0800 Message-ID: <20190730074225.39544-2-yanaijie@huawei.com> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20190730074225.39544-1-yanaijie@huawei.com> References: <20190730074225.39544-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 --- 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