Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp2358503ybh; Sun, 4 Aug 2019 23:28:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqyZT3gWRhoLzpDADsC/4cy6RP8B+qWuPayxfTQL1jVahcK33PUDadAK3YO7voiffEZYERRy X-Received: by 2002:a63:2364:: with SMTP id u36mr130656989pgm.449.1564986524535; Sun, 04 Aug 2019 23:28:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564986524; cv=none; d=google.com; s=arc-20160816; b=V+cXvDs4MSelXSoXfO/iHWjQGxY+oQ6MlJCRzLjSeGZt/W1M/jh3qaf6N8t4mcDacl 3m8lA8WmxASYJ9m4GF0VX5C2FZSvfnDZAnVqQwsJ3QA9UR3JhMK+XHY3p7avfEeuW636 qD49VHUwW+a2E33a2knOdX6M/l1jVY+pcgjGbQSBda8NZXIUNcsVMgPfnSV9DmOVQ/E5 +w4NsxPwt1Z4bjql2HbTatm4W0PLXfelqGz7jfYtlLcWSyixxnsGm/kNHQT0NASdhybv H/d6sVqNMN1/KGnn8BR61hNbVoCVpH/A709CknMJlYaFQTB+bEWtMJ8QCw3SCRDukQc3 +0lQ== 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=xe57Ap9yhP9GtbPUgAOVM9F7vgaaW09xFh1AxyDQtrkJN7FEgt3zzTdjXGlyPZuSO2 U5l/4aXVtWVkHb3XdzBhUIdR3CzDAZHtoabjCkTElFASHJX42c+rF2fkKPpd9v09+Wzc FjXXLzJtxWBAtPUjCOrSigH6MZAdu93hHBtgcpnNbsmbNztkgYiVbp5JgbzjDuUkBkZa u2Q4u6TTRAd0FlokrMUxOLFAg7PhHV0mgU8S/TdXMbxsC5iB8iozT2c+9MdYzAmD3fJj 4KAocfX38Bg5vB4zj08+ovM1kG/xmY1JThUhC2DsHVXVVAVMgheldQn7WurZlpYI0mXY E3iw== 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 l71si44474809pgd.314.2019.08.04.23.28.29; Sun, 04 Aug 2019 23:28:44 -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 S1727581AbfHEG1J (ORCPT + 99 others); Mon, 5 Aug 2019 02:27:09 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:42310 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725976AbfHEG0i (ORCPT ); Mon, 5 Aug 2019 02:26:38 -0400 Received: from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 2260391AEF05ED8F6065; Mon, 5 Aug 2019 14:26:37 +0800 (CST) Received: from huawei.com (10.175.124.28) by DGGEMS414-HUB.china.huawei.com (10.3.19.214) with Microsoft SMTP Server id 14.3.439.0; Mon, 5 Aug 2019 14:26:26 +0800 From: Jason Yan To: , , , , , , , , CC: , , , , , , , Jason Yan Subject: [PATCH v4 01/10] powerpc: unify definition of M_IF_NEEDED Date: Mon, 5 Aug 2019 14:43:26 +0800 Message-ID: <20190805064335.19156-2-yanaijie@huawei.com> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20190805064335.19156-1-yanaijie@huawei.com> References: <20190805064335.19156-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