linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Christophe Leroy <christophe.leroy@c-s.fr>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Paul Mackerras <paulus@samba.org>,
	Michael Ellerman <mpe@ellerman.id.au>
Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org
Subject: [PATCH v3 03/16] powerpc/405: move PPC405_ERR77 in asm-405.h
Date: Thu,  5 Jul 2018 16:24:55 +0000 (UTC)	[thread overview]
Message-ID: <a22c869eab31ae38320f2e803833b0708b147d7c.1530807556.git.christophe.leroy@c-s.fr> (raw)
In-Reply-To: <cover.1530807556.git.christophe.leroy@c-s.fr>

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
---
 arch/powerpc/include/asm/asm-405.h           | 19 +++++++++++++++++++
 arch/powerpc/include/asm/asm-compat.h        | 13 -------------
 arch/powerpc/include/asm/atomic.h            |  1 +
 arch/powerpc/include/asm/bitops.h            |  1 +
 arch/powerpc/include/asm/book3s/32/pgtable.h |  2 --
 arch/powerpc/include/asm/cmpxchg.h           |  1 +
 arch/powerpc/include/asm/futex.h             |  1 +
 arch/powerpc/include/asm/nohash/32/pgtable.h |  1 +
 arch/powerpc/include/asm/spinlock.h          |  1 +
 arch/powerpc/kernel/entry_32.S               |  1 +
 arch/powerpc/kernel/head_40x.S               |  1 +
 11 files changed, 27 insertions(+), 15 deletions(-)
 create mode 100644 arch/powerpc/include/asm/asm-405.h

diff --git a/arch/powerpc/include/asm/asm-405.h b/arch/powerpc/include/asm/asm-405.h
new file mode 100644
index 000000000000..7270d3ae7c8e
--- /dev/null
+++ b/arch/powerpc/include/asm/asm-405.h
@@ -0,0 +1,19 @@
+#ifndef _ASM_POWERPC_ASM_405_H
+#define _ASM_POWERPC_ASM_405_H
+
+#include <asm/asm-const.h>
+
+#ifdef __KERNEL__
+#ifdef CONFIG_IBM405_ERR77
+/* Erratum #77 on the 405 means we need a sync or dcbt before every
+ * stwcx.  The old ATOMIC_SYNC_FIX covered some but not all of this.
+ */
+#define PPC405_ERR77(ra,rb)	stringify_in_c(dcbt	ra, rb;)
+#define	PPC405_ERR77_SYNC	stringify_in_c(sync;)
+#else
+#define PPC405_ERR77(ra,rb)
+#define PPC405_ERR77_SYNC
+#endif
+#endif
+
+#endif /* _ASM_POWERPC_ASM_405_H */
diff --git a/arch/powerpc/include/asm/asm-compat.h b/arch/powerpc/include/asm/asm-compat.h
index 7f2a7702596c..d2cf3593e987 100644
--- a/arch/powerpc/include/asm/asm-compat.h
+++ b/arch/powerpc/include/asm/asm-compat.h
@@ -70,17 +70,4 @@
 
 #endif
 
-#ifdef __KERNEL__
-#ifdef CONFIG_IBM405_ERR77
-/* Erratum #77 on the 405 means we need a sync or dcbt before every
- * stwcx.  The old ATOMIC_SYNC_FIX covered some but not all of this.
- */
-#define PPC405_ERR77(ra,rb)	stringify_in_c(dcbt	ra, rb;)
-#define	PPC405_ERR77_SYNC	stringify_in_c(sync;)
-#else
-#define PPC405_ERR77(ra,rb)
-#define PPC405_ERR77_SYNC
-#endif
-#endif
-
 #endif /* _ASM_POWERPC_ASM_COMPAT_H */
diff --git a/arch/powerpc/include/asm/atomic.h b/arch/powerpc/include/asm/atomic.h
index 682b3e6a1e21..cbdb0b7e60a3 100644
--- a/arch/powerpc/include/asm/atomic.h
+++ b/arch/powerpc/include/asm/atomic.h
@@ -10,6 +10,7 @@
 #include <linux/types.h>
 #include <asm/cmpxchg.h>
 #include <asm/barrier.h>
+#include <asm/asm-405.h>
 
 #define ATOMIC_INIT(i)		{ (i) }
 
diff --git a/arch/powerpc/include/asm/bitops.h b/arch/powerpc/include/asm/bitops.h
index b750ffef83c7..ff71566dadee 100644
--- a/arch/powerpc/include/asm/bitops.h
+++ b/arch/powerpc/include/asm/bitops.h
@@ -45,6 +45,7 @@
 #include <linux/compiler.h>
 #include <asm/asm-compat.h>
 #include <asm/synch.h>
+#include <asm/asm-405.h>
 
 /* PPC bit number conversion */
 #define PPC_BITLSHIFT(be)	(BITS_PER_LONG - 1 - (be))
diff --git a/arch/powerpc/include/asm/book3s/32/pgtable.h b/arch/powerpc/include/asm/book3s/32/pgtable.h
index 02f5acd7ccc4..3c3e34240628 100644
--- a/arch/powerpc/include/asm/book3s/32/pgtable.h
+++ b/arch/powerpc/include/asm/book3s/32/pgtable.h
@@ -164,7 +164,6 @@ static inline unsigned long pte_update(pte_t *p,
 1:	lwarx	%0,0,%3\n\
 	andc	%1,%0,%4\n\
 	or	%1,%1,%5\n"
-	PPC405_ERR77(0,%3)
 "	stwcx.	%1,0,%3\n\
 	bne-	1b"
 	: "=&r" (old), "=&r" (tmp), "=m" (*p)
@@ -186,7 +185,6 @@ static inline unsigned long long pte_update(pte_t *p,
 	lwzx	%0,0,%3\n\
 	andc	%1,%L0,%5\n\
 	or	%1,%1,%6\n"
-	PPC405_ERR77(0,%3)
 "	stwcx.	%1,0,%4\n\
 	bne-	1b"
 	: "=&r" (old), "=&r" (tmp), "=m" (*p)
diff --git a/arch/powerpc/include/asm/cmpxchg.h b/arch/powerpc/include/asm/cmpxchg.h
index 9b001f1f6b32..67ec1073ac97 100644
--- a/arch/powerpc/include/asm/cmpxchg.h
+++ b/arch/powerpc/include/asm/cmpxchg.h
@@ -7,6 +7,7 @@
 #include <asm/synch.h>
 #include <asm/asm-compat.h>
 #include <linux/bug.h>
+#include <asm/asm-405.h>
 
 #ifdef __BIG_ENDIAN
 #define BITOFF_CAL(size, off)	((sizeof(u32) - size - off) * BITS_PER_BYTE)
diff --git a/arch/powerpc/include/asm/futex.h b/arch/powerpc/include/asm/futex.h
index 1a944c18c539..76c8648d0fa8 100644
--- a/arch/powerpc/include/asm/futex.h
+++ b/arch/powerpc/include/asm/futex.h
@@ -9,6 +9,7 @@
 #include <asm/errno.h>
 #include <asm/synch.h>
 #include <asm/asm-compat.h>
+#include <asm/asm-405.h>
 
 #define __futex_atomic_op(insn, ret, oldval, uaddr, oparg) \
   __asm__ __volatile ( \
diff --git a/arch/powerpc/include/asm/nohash/32/pgtable.h b/arch/powerpc/include/asm/nohash/32/pgtable.h
index 7c46a98cc7f4..7df2f3a66cc5 100644
--- a/arch/powerpc/include/asm/nohash/32/pgtable.h
+++ b/arch/powerpc/include/asm/nohash/32/pgtable.h
@@ -9,6 +9,7 @@
 #include <linux/sched.h>
 #include <linux/threads.h>
 #include <asm/io.h>			/* For sub-arch specific PPC_PIN_SIZE */
+#include <asm/asm-405.h>
 
 extern unsigned long ioremap_bot;
 
diff --git a/arch/powerpc/include/asm/spinlock.h b/arch/powerpc/include/asm/spinlock.h
index 72dc4ddc2972..7ec38f4ee927 100644
--- a/arch/powerpc/include/asm/spinlock.h
+++ b/arch/powerpc/include/asm/spinlock.h
@@ -27,6 +27,7 @@
 #include <asm/asm-compat.h>
 #include <asm/synch.h>
 #include <asm/ppc-opcode.h>
+#include <asm/asm-405.h>
 
 #ifdef CONFIG_PPC64
 /* use 0x800000yy when locked, where yy == CPU number */
diff --git a/arch/powerpc/kernel/entry_32.S b/arch/powerpc/kernel/entry_32.S
index 973577f2141c..7642cb984d3a 100644
--- a/arch/powerpc/kernel/entry_32.S
+++ b/arch/powerpc/kernel/entry_32.S
@@ -33,6 +33,7 @@
 #include <asm/unistd.h>
 #include <asm/ptrace.h>
 #include <asm/export.h>
+#include <asm/asm-405.h>
 
 /*
  * MSR_KERNEL is > 0x10000 on 4xx/Book-E since it include MSR_CE.
diff --git a/arch/powerpc/kernel/head_40x.S b/arch/powerpc/kernel/head_40x.S
index 41374a468d1c..b19d78410511 100644
--- a/arch/powerpc/kernel/head_40x.S
+++ b/arch/powerpc/kernel/head_40x.S
@@ -42,6 +42,7 @@
 #include <asm/asm-offsets.h>
 #include <asm/ptrace.h>
 #include <asm/export.h>
+#include <asm/asm-405.h>
 
 /* As with the other PowerPC ports, it is expected that when code
  * execution begins here, the following registers contain valid, yet
-- 
2.13.3

  parent reply	other threads:[~2018-07-05 16:24 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-05 16:24 [PATCH v3 00/16] Remove unneccessary included headers Christophe Leroy
2018-07-05 16:24 ` [PATCH v3 01/16] powerpc: remove kdump.h from page.h Christophe Leroy
2018-08-01  5:24   ` [v3,01/16] " Michael Ellerman
2018-07-05 16:24 ` [PATCH v3 02/16] powerpc: remove unneeded inclusions of cpu_has_feature.h Christophe Leroy
2018-08-01  5:24   ` [v3, " Michael Ellerman
2018-07-05 16:24 ` Christophe Leroy [this message]
2018-08-01  5:24   ` [v3,03/16] powerpc/405: move PPC405_ERR77 in asm-405.h Michael Ellerman
2018-07-05 16:24 ` [PATCH v3 04/16] powerpc: move ASM_CONST and stringify_in_c() into asm-const.h Christophe Leroy
2018-08-01  5:24   ` [v3, " Michael Ellerman
2018-07-05 16:24 ` [PATCH v3 05/16] powerpc: clean the inclusion of stringify.h Christophe Leroy
2018-08-01  5:24   ` [v3,05/16] " Michael Ellerman
2018-07-05 16:25 ` [PATCH v3 06/16] powerpc: clean inclusions of asm/feature-fixups.h Christophe Leroy
2018-08-01  5:24   ` [v3,06/16] " Michael Ellerman
2018-07-05 16:25 ` [PATCH v3 07/16] powerpc: remove superflous inclusions of asm/fixmap.h Christophe Leroy
2018-08-01  5:24   ` [v3,07/16] " Michael Ellerman
2018-07-05 16:25 ` [PATCH v3 08/16] powerpc: declare set_breakpoint() static Christophe Leroy
2018-08-01  5:24   ` [v3,08/16] " Michael Ellerman
2018-07-05 16:25 ` [PATCH v3 09/16] powerpc/book3s: Remove PPC_PIN_SIZE Christophe Leroy
2018-08-01  5:24   ` [v3,09/16] " Michael Ellerman
2018-07-05 16:25 ` [PATCH v3 10/16] powerpc: fix includes in asm/processor.h Christophe Leroy
2018-08-01  5:24   ` [v3,10/16] " Michael Ellerman
2018-07-05 16:25 ` [PATCH v3 11/16] powerpc/nohash: fix hash related comments in pgtable.h Christophe Leroy
2018-08-01  5:24   ` [v3, " Michael Ellerman
2018-07-05 16:25 ` [PATCH v3 12/16] powerpc/44x: remove page.h from mmu-44x.h Christophe Leroy
2018-08-01  5:24   ` [v3,12/16] " Michael Ellerman
2018-07-05 16:25 ` [PATCH v3 13/16] powerpc: split reg.h in two parts Christophe Leroy
2018-07-05 16:25 ` [PATCH v3 14/16] powerpc: Split synch.h " Christophe Leroy
2018-07-05 16:25 ` [PATCH v3 15/16] powerpc: remove unnecessary inclusion of asm/tlbflush.h Christophe Leroy
2018-08-01  5:24   ` [v3, " Michael Ellerman
2018-07-05 16:25 ` [PATCH v3 16/16] powerpc: split asm/tlbflush.h Christophe Leroy
2018-08-01  5:24   ` [v3,16/16] " Michael Ellerman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a22c869eab31ae38320f2e803833b0708b147d7c.1530807556.git.christophe.leroy@c-s.fr \
    --to=christophe.leroy@c-s.fr \
    --cc=benh@kernel.crashing.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mpe@ellerman.id.au \
    --cc=paulus@samba.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).