Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp5451503ybh; Wed, 7 Aug 2019 06:16:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqxY43FxPo2Ca1Gu1aQCjU0SJykRABQXmZtRLdfHkEbSubRfHOhm3W6UF+zN1o9uXVZvLkc0 X-Received: by 2002:a63:1743:: with SMTP id 3mr7478062pgx.435.1565183775652; Wed, 07 Aug 2019 06:16:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565183775; cv=none; d=google.com; s=arc-20160816; b=pFAusaTvpXFl4n/lEkywoRvhQEgxcsiDhQ7RSkdwPOzRYkM4jacowrOAlAw93rNq50 6CvEIwi3u/+DRFNnnOVvGxczoVp1mu0YA1bjAhlWts7m6h0IhjHbiwiIY6OoZhiKX2gj LeDhAxeK+bm2H4CW9BNfUVonw2rymPxSKu9vKGa5GXwDM6/H452roT/cmrmquhhTlbEJ 1CIF0LYzbdCXcnwxzOQ4n1jq2VNaa666qHm5XVcUaal2jYhbSerbhpB46DDNrcPVx3qU 7/64vhs4uYpT7TzwMfAmMdJfamoq8wLKplYtLXFB2pr3B9ibxeK7V8kVly/HZ607CM2+ CqPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from; bh=zxXWcBwUZZBp3eSfrG/bQDPULOncVrQN5mZBa8d0UK4=; b=gCFcigYfLtnn8DsfMZNj8Si6933vq+WhTi29j4xvKtftq12FuKL0wONhnLv/fjmZBL kR4n9qt9zzCEmMhtmbdGZCIDsUHdJOUAjqwUSGyfXn2CE6pBANX6IpMhqtDu2RdsQwOx OePqrBAmXuZwJBibH+IHMaTYbrmBGf/bGKXDz0jGxQOvCWQULn+bN/jxbx90Oh/tYBUK 2ccnHRASgP9r/2zzvTABJvgwvdXQlutW5YEG2XEA7oJwAxQzmGiPA81mARmZMX5M28OB SCFWW+v7DS2meVvUt3iu+qN2BLft1i7qP+xZNBmgH80nLZn1UoSVfv2IoPEU+5GX9/zt /XlA== 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 f21si48638750pgj.263.2019.08.07.06.15.59; Wed, 07 Aug 2019 06:16:15 -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 S2388148AbfHGNNX (ORCPT + 99 others); Wed, 7 Aug 2019 09:13:23 -0400 Received: from bilbo.ozlabs.org ([203.11.71.1]:57947 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388085AbfHGNNW (ORCPT ); Wed, 7 Aug 2019 09:13:22 -0400 Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 463X4b1wbfz9sNm; Wed, 7 Aug 2019 23:13:19 +1000 (AEST) From: Michael Ellerman To: Jason Yan , linuxppc-dev@lists.ozlabs.org, diana.craciun@nxp.com, christophe.leroy@c-s.fr, benh@kernel.crashing.org, paulus@samba.org, npiggin@gmail.com, keescook@chromium.org, kernel-hardening@lists.openwall.com Cc: linux-kernel@vger.kernel.org, wangkefeng.wang@huawei.com, yebin10@huawei.com, thunder.leizhen@huawei.com, jingxiangfeng@huawei.com, fanchengyang@huawei.com, zhaohongjiang@huawei.com, Jason Yan Subject: Re: [PATCH v5 01/10] powerpc: unify definition of M_IF_NEEDED In-Reply-To: <20190807065706.11411-2-yanaijie@huawei.com> References: <20190807065706.11411-1-yanaijie@huawei.com> <20190807065706.11411-2-yanaijie@huawei.com> Date: Wed, 07 Aug 2019 23:13:15 +1000 Message-ID: <87sgqdt8yc.fsf@concordia.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Jason Yan writes: > M_IF_NEEDED is defined too many times. Move it to a common place. The name is not great, can you call it MAS2_M_IF_NEEDED, which at least gives a clue what it's for? cheers > 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