Skip to contentSkip to conversation

Remove unneccessary included headers

PATCH Applied Christophe Leroy 2 participants 31 messages Jul 5, 2018 – Aug 1, 2018

Subsystems (14)
PowerPC BPF Crypto API ptrace support +10 more subsystems
lore
Share & tools
lore
#0 lore raw

v3 cover Remove unneccessary included headers

The purpose of this serie is to limit the number of includes to only the necessary ones in order to reduce the number of files recompiled everytime a header file is modified.

Compilation test: see http://kisskb.ellerman.id.au/kisskb/head/14261/
Among the 4 failures, one is compiler bug that I don't have with GCC 8, the 3 others are pre-existing failures

Christophe Leroy (16):
powerpc: remove kdump.h from page.h
powerpc: remove unneeded inclusions of cpu_has_feature.h powerpc/405: move PPC405_ERR77 in asm-405.h
powerpc: move ASM_CONST and stringify_in_c() into asm-const.h
powerpc: clean the inclusion of stringify.h
powerpc: clean inclusions of asm/feature-fixups.h
powerpc: remove superflous inclusions of asm/fixmap.h
powerpc: declare set_breakpoint() static powerpc/book3s: Remove PPC_PIN_SIZE
powerpc: fix includes in asm/processor.h powerpc/nohash: fix hash related comments in pgtable.h powerpc/44x: remove page.h from mmu-44x.h
powerpc: split reg.h in two parts
powerpc: Split synch.h in two parts
powerpc: remove unnecessary inclusion of asm/tlbflush.h
powerpc: split asm/tlbflush.h

 arch/powerpc/crypto/md5-asm.S                     |  1 +
 arch/powerpc/crypto/sha1-powerpc-asm.S            |  1 +
 arch/powerpc/include/asm/asm-405.h                | 19 +++++
 arch/powerpc/include/asm/asm-compat.h             | 26 +------
 arch/powerpc/include/asm/asm-const.h              | 14 ++++
 arch/powerpc/include/asm/atomic.h                 |  2 +
 arch/powerpc/include/asm/barrier.h                |  3 +
 arch/powerpc/include/asm/bitops.h                 |  2 +
 arch/powerpc/include/asm/book3s/32/pgtable.h      |  7 --
 arch/powerpc/include/asm/book3s/32/tlbflush.h     | 25 +++++++
 arch/powerpc/include/asm/book3s/64/hash.h         |  2 +
 arch/powerpc/include/asm/book3s/64/mmu-hash.h     |  2 +-
 arch/powerpc/include/asm/book3s/64/radix.h        |  2 +
 arch/powerpc/include/asm/book3s/tlbflush.h        | 11 +++
 arch/powerpc/include/asm/cacheflush.h             |  1 -
 arch/powerpc/include/asm/cmpxchg.h                |  3 +-
 arch/powerpc/include/asm/code-patching.h          |  1 +
 arch/powerpc/include/asm/cputable.h               |  3 +-
 arch/powerpc/include/asm/cputime.h                |  1 -
 arch/powerpc/include/asm/dbell.h                  |  2 +-
 arch/powerpc/include/asm/dcr-native.h             |  1 +
 arch/powerpc/include/asm/debug.h                  |  1 -
 arch/powerpc/include/asm/dt_cpu_ftrs.h            |  2 -
 arch/powerpc/include/asm/exception-64s.h          |  2 +
 arch/powerpc/include/asm/feature-fixups.h         |  2 +
 arch/powerpc/include/asm/firmware.h               |  3 +-
 arch/powerpc/include/asm/fixmap.h                 |  2 -
 arch/powerpc/include/asm/futex.h                  |  2 +-
 arch/powerpc/include/asm/highmem.h                |  2 +-
 arch/powerpc/include/asm/hw_breakpoint.h          |  1 +
 arch/powerpc/include/asm/iommu.h                  |  1 +
 arch/powerpc/include/asm/jump_label.h             |  2 +-
 arch/powerpc/include/asm/kvm_booke_hv_asm.h       |  2 +
 arch/powerpc/include/asm/mmu-44x.h                | 10 +--
 arch/powerpc/include/asm/mmu.h                    |  3 +-
 arch/powerpc/include/asm/nohash/32/pgtable.h      |  7 +-
 arch/powerpc/include/asm/nohash/64/pgtable.h      | 19 ++---
 arch/powerpc/include/asm/{ => nohash}/tlbflush.h  | 42 ++---------
 arch/powerpc/include/asm/page.h                   |  3 +-
 arch/powerpc/include/asm/page_64.h                |  2 +
 arch/powerpc/include/asm/ppc-opcode.h             |  3 +-
 arch/powerpc/include/asm/ppc_asm.h                |  1 +
 arch/powerpc/include/asm/processor.h              |  5 +-
 arch/powerpc/include/asm/ptrace.h                 |  1 +
 arch/powerpc/include/asm/reg-ftr.h                | 71 +++++++++++++++++++
 arch/powerpc/include/asm/reg.h                    | 42 +----------
 arch/powerpc/include/asm/reg_a2.h                 |  2 +
 arch/powerpc/include/asm/reg_fsl_emb.h            |  2 +
 arch/powerpc/include/asm/spinlock.h               |  3 +-
 arch/powerpc/include/asm/{synch.h => synch-ftr.h} | 24 ++-----
 arch/powerpc/include/asm/synch.h                  | 30 --------
 arch/powerpc/include/asm/thread_info.h            |  3 +-
 arch/powerpc/include/asm/tlb.h                    |  1 -
 arch/powerpc/include/asm/tlbflush.h               | 86 ++---------------------
 arch/powerpc/include/asm/uaccess.h                |  1 -
 arch/powerpc/kernel/cpu_setup_6xx.S               |  1 +
 arch/powerpc/kernel/crash.c                       |  1 -
 arch/powerpc/kernel/entry_32.S                    |  2 +
 arch/powerpc/kernel/entry_64.S                    |  3 +
 arch/powerpc/kernel/exceptions-64e.S              |  1 +
 arch/powerpc/kernel/exceptions-64s.S              |  2 +
 arch/powerpc/kernel/fpu.S                         |  2 +
 arch/powerpc/kernel/head_32.S                     |  1 +
 arch/powerpc/kernel/head_40x.S                    |  1 +
 arch/powerpc/kernel/head_64.S                     |  2 +
 arch/powerpc/kernel/head_8xx.S                    |  1 -
 arch/powerpc/kernel/head_fsl_booke.S              |  1 +
 arch/powerpc/kernel/idle_6xx.S                    |  1 +
 arch/powerpc/kernel/idle_book3s.S                 |  3 +
 arch/powerpc/kernel/idle_e500.S                   |  1 +
 arch/powerpc/kernel/idle_power4.S                 |  1 +
 arch/powerpc/kernel/kvm_emul.S                    |  1 +
 arch/powerpc/kernel/l2cr_6xx.S                    |  1 +
 arch/powerpc/kernel/machine_kexec.c               |  1 +
 arch/powerpc/kernel/misc_32.S                     |  1 +
 arch/powerpc/kernel/misc_64.S                     |  1 +
 arch/powerpc/kernel/paca.c                        |  1 +
 arch/powerpc/kernel/ppc_save_regs.S               |  1 +
 arch/powerpc/kernel/process.c                     | 15 ++--
 arch/powerpc/kernel/prom.c                        |  1 -
 arch/powerpc/kernel/prom_init.c                   |  1 -
 arch/powerpc/kernel/setup_32.c                    |  2 +
 arch/powerpc/kernel/setup_64.c                    |  1 +
 arch/powerpc/kernel/swsusp_32.S                   |  1 +
 arch/powerpc/kernel/swsusp_asm64.S                |  1 +
 arch/powerpc/kernel/tm.S                          |  2 +
 arch/powerpc/kernel/vdso.c                        |  1 -
 arch/powerpc/kernel/vector.S                      |  1 +
 arch/powerpc/kvm/book3s.c                         |  1 -
 arch/powerpc/kvm/book3s_32_mmu.c                  |  1 -
 arch/powerpc/kvm/book3s_64_mmu.c                  |  1 -
 arch/powerpc/kvm/book3s_64_mmu_hv.c               |  1 -
 arch/powerpc/kvm/book3s_64_slb.S                  |  3 +
 arch/powerpc/kvm/book3s_64_vio.c                  |  1 -
 arch/powerpc/kvm/book3s_64_vio_hv.c               |  2 +-
 arch/powerpc/kvm/book3s_hv.c                      |  1 -
 arch/powerpc/kvm/book3s_hv_interrupts.S           |  2 +
 arch/powerpc/kvm/book3s_hv_rm_mmu.c               |  1 -
 arch/powerpc/kvm/book3s_hv_rmhandlers.S           |  3 +
 arch/powerpc/kvm/book3s_interrupts.S              |  1 +
 arch/powerpc/kvm/book3s_pr.c                      |  1 -
 arch/powerpc/kvm/book3s_rmhandlers.S              |  2 +
 arch/powerpc/kvm/book3s_segment.S                 |  4 ++
 arch/powerpc/kvm/e500.c                           |  1 -
 arch/powerpc/kvm/e500mc.c                         |  1 -
 arch/powerpc/kvm/powerpc.c                        |  1 -
 arch/powerpc/kvm/tm.S                             |  1 +
 arch/powerpc/lib/copypage_64.S                    |  1 +
 arch/powerpc/lib/copyuser_64.S                    |  2 +
 arch/powerpc/lib/feature-fixups-test.S            |  2 +
 arch/powerpc/lib/hweight_64.S                     |  1 +
 arch/powerpc/lib/ldstfp.S                         |  1 +
 arch/powerpc/lib/locks.c                          |  1 -
 arch/powerpc/lib/memcpy_64.S                      |  2 +
 arch/powerpc/mm/dump_hashpagetable.c              |  1 -
 arch/powerpc/mm/fault.c                           |  1 -
 arch/powerpc/mm/hash_low_32.S                     |  1 +
 arch/powerpc/mm/hash_native_64.c                  |  2 +-
 arch/powerpc/mm/hash_utils_64.c                   |  1 -
 arch/powerpc/mm/mmu_context_hash32.c              |  1 -
 arch/powerpc/mm/mmu_decl.h                        |  1 -
 arch/powerpc/mm/slb_low.S                         |  1 +
 arch/powerpc/mm/subpage-prot.c                    |  1 -
 arch/powerpc/mm/tlb_low_64e.S                     |  1 +
 arch/powerpc/mm/tlb_nohash_low.S                  |  2 +
 arch/powerpc/net/bpf_jit32.h                      |  1 +
 arch/powerpc/net/bpf_jit_asm.S                    |  1 +
 arch/powerpc/net/bpf_jit_comp.c                   |  1 +
 arch/powerpc/net/bpf_jit_comp64.c                 |  1 +
 arch/powerpc/perf/req-gen/_begin.h                |  2 +
 arch/powerpc/perf/req-gen/perf.h                  |  1 +
 arch/powerpc/platforms/cell/cbe_thermal.c         |  1 +
 arch/powerpc/platforms/cell/spufs/sputrace.h      |  1 +
 arch/powerpc/platforms/powermac/cache.S           |  1 +
 arch/powerpc/platforms/powermac/sleep.S           |  1 +
 arch/powerpc/platforms/powernv/opal-wrappers.S    |  2 +
 arch/powerpc/platforms/powernv/vas.h              |  1 +
 arch/powerpc/platforms/pseries/hvCall.S           |  1 +
 arch/powerpc/platforms/pseries/lpar.c             |  1 -
 arch/powerpc/platforms/pseries/mobility.c         |  1 +
 arch/powerpc/platforms/pseries/setup.c            |  1 +
 arch/powerpc/purgatory/trampoline.S               | 10 +--
 arch/powerpc/sysdev/cpm1.c                        |  1 -
 arch/powerpc/sysdev/cpm_common.c                  |  1 -
 arch/powerpc/xmon/spr_access.S                    |  1 +
 145 files changed, 312 insertions(+), 340 deletions(-)
 create mode 100644 arch/powerpc/include/asm/asm-405.h
 create mode 100644 arch/powerpc/include/asm/asm-const.h
 create mode 100644 arch/powerpc/include/asm/book3s/32/tlbflush.h
 create mode 100644 arch/powerpc/include/asm/book3s/tlbflush.h
 copy arch/powerpc/include/asm/{ => nohash}/tlbflush.h (57%)
 create mode 100644 arch/powerpc/include/asm/reg-ftr.h
 copy arch/powerpc/include/asm/{synch.h => synch-ftr.h} (63%)
Signature · 1 line
2.13.3
#1 lore raw

PATCH v3 1/16 powerpc: remove kdump.h from page.h

page.h doesn't need kdump.h

---
 arch/powerpc/include/asm/page.h     | 1 -
 arch/powerpc/kernel/crash.c         | 1 -
 arch/powerpc/kernel/machine_kexec.c | 1 +
 arch/powerpc/kernel/setup_32.c      | 1 +
 4 files changed, 2 insertions(+), 2 deletions(-)
arch/powerpc/include/asm/page.h +0 -1
index db7be0779d55..a9fbefaacf10 100644
@@ -17,7 +17,6 @@
 #include <asm/types.h>
 #endif
 #include <asm/asm-compat.h>
-#include <asm/kdump.h>
 
 /*
  * On regular PPC32 page size is 4K (but we support 4K/16K/64K/256K pages
arch/powerpc/kernel/crash.c +0 -1
index 17c8b99680f2..43a3ce2301e8 100644
@@ -23,7 +23,6 @@
 #include <asm/processor.h>
 #include <asm/machdep.h>
 #include <asm/kexec.h>
-#include <asm/kdump.h>
 #include <asm/prom.h>
 #include <asm/smp.h>
 #include <asm/setjmp.h>
arch/powerpc/kernel/machine_kexec.c +1 -0
index 936c7e2d421e..e530cbd48995 100644
@@ -17,6 +17,7 @@
 #include <linux/irq.h>
 #include <linux/ftrace.h>
 
+#include <asm/kdump.h>
 #include <asm/machdep.h>
 #include <asm/pgalloc.h>
 #include <asm/prom.h>
arch/powerpc/kernel/setup_32.c +1 -0
index 74457485574b..ef747a5a30b9 100644
@@ -40,6 +40,7 @@
 #include <asm/code-patching.h>
 #include <asm/cpu_has_feature.h>
 #include <asm/asm-prototypes.h>
+#include <asm/kdump.h>
 
 #define DBG(fmt...)
 
Signature · 1 line
2.13.3
#3 lore raw

PATCH v3 2/16 powerpc: remove unneeded inclusions of cpu_has_feature.h

In reply to Christophe Leroy

Files not using cpu_has_feature() don't need cpu_has_feature.h

---
 arch/powerpc/include/asm/cacheflush.h | 1 -
 arch/powerpc/include/asm/cputime.h    | 1 -
 arch/powerpc/include/asm/dbell.h      | 1 -
 arch/powerpc/kernel/vdso.c            | 1 -
 4 files changed, 4 deletions(-)
arch/powerpc/include/asm/cacheflush.h +0 -1
index 0d72ec75da63..d5a8d7bf0759 100644
@@ -11,7 +11,6 @@
 
 #include <linux/mm.h>
 #include <asm/cputable.h>
-#include <asm/cpu_has_feature.h>
 
 /*
  * No cache flushing is required when address mappings are changed,
arch/powerpc/include/asm/cputime.h +0 -1
index bc4903badb3f..133672744b2e 100644
@@ -23,7 +23,6 @@
 #include <asm/div64.h>
 #include <asm/time.h>
 #include <asm/param.h>
-#include <asm/cpu_has_feature.h>
 
 typedef u64 __nocast cputime_t;
 typedef u64 __nocast cputime64_t;
arch/powerpc/include/asm/dbell.h +0 -1
index 9f2ae0d25e15..998c42ff1caa 100644
@@ -16,7 +16,6 @@
 #include <linux/threads.h>
 
 #include <asm/ppc-opcode.h>
-#include <asm/cpu_has_feature.h>
 
 #define PPC_DBELL_MSG_BRDCAST	(0x04000000)
 #define PPC_DBELL_TYPE(x)	(((x) & 0xf) << (63-36))
arch/powerpc/kernel/vdso.c +0 -1
index d2205b97628c..65b3bdb99f0b 100644
@@ -22,7 +22,6 @@
 #include <linux/security.h>
 #include <linux/memblock.h>
 
-#include <asm/cpu_has_feature.h>
 #include <asm/pgtable.h>
 #include <asm/processor.h>
 #include <asm/mmu.h>
Signature · 1 line
2.13.3
#5 lore raw

PATCH v3 3/16 powerpc/405: move PPC405_ERR77 in asm-405.h

In reply to Christophe Leroy
---
 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
arch/powerpc/include/asm/asm-405.h new file +19 -0
new file mode 100644
index 000000000000..7270d3ae7c8e
@@ -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 */
arch/powerpc/include/asm/asm-compat.h +0 -13
index 7f2a7702596c..d2cf3593e987 100644
@@ -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 */
arch/powerpc/include/asm/atomic.h +1 -0
index 682b3e6a1e21..cbdb0b7e60a3 100644
@@ -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) }
 
arch/powerpc/include/asm/bitops.h +1 -0
index b750ffef83c7..ff71566dadee 100644
@@ -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))
arch/powerpc/include/asm/book3s/32/pgtable.h +0 -2
index 02f5acd7ccc4..3c3e34240628 100644
@@ -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)
arch/powerpc/include/asm/cmpxchg.h +1 -0
index 9b001f1f6b32..67ec1073ac97 100644
@@ -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)
arch/powerpc/include/asm/futex.h +1 -0
index 1a944c18c539..76c8648d0fa8 100644
@@ -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 ( \
arch/powerpc/include/asm/nohash/32/pgtable.h +1 -0
index 7c46a98cc7f4..7df2f3a66cc5 100644
@@ -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;
 
arch/powerpc/include/asm/spinlock.h +1 -0
index 72dc4ddc2972..7ec38f4ee927 100644
@@ -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 */
arch/powerpc/kernel/entry_32.S +1 -0
index 973577f2141c..7642cb984d3a 100644
@@ -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.
arch/powerpc/kernel/head_40x.S +1 -0
index 41374a468d1c..b19d78410511 100644
@@ -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
Signature · 1 line
2.13.3
#7 lore raw

PATCH v3 4/16 powerpc: move ASM_CONST and stringify_in_c() into asm-const.h

In reply to Christophe Leroy

This patch moves ASM_CONST() and stringify_in_c() into dedicated asm-const.h, then cleans all related inclusions.

---
 arch/powerpc/crypto/md5-asm.S                  |  1 +
 arch/powerpc/crypto/sha1-powerpc-asm.S         |  1 +
 arch/powerpc/include/asm/asm-compat.h          | 13 +------------
 arch/powerpc/include/asm/asm-const.h           | 14 ++++++++++++++
 arch/powerpc/include/asm/barrier.h             |  2 ++
 arch/powerpc/include/asm/book3s/64/hash.h      |  2 ++
 arch/powerpc/include/asm/book3s/64/mmu-hash.h  |  2 +-
 arch/powerpc/include/asm/book3s/64/radix.h     |  2 ++
 arch/powerpc/include/asm/cmpxchg.h             |  1 -
 arch/powerpc/include/asm/code-patching.h       |  1 +
 arch/powerpc/include/asm/cputable.h            |  2 +-
 arch/powerpc/include/asm/dt_cpu_ftrs.h         |  1 -
 arch/powerpc/include/asm/feature-fixups.h      |  2 ++
 arch/powerpc/include/asm/firmware.h            |  2 +-
 arch/powerpc/include/asm/futex.h               |  1 -
 arch/powerpc/include/asm/iommu.h               |  1 +
 arch/powerpc/include/asm/jump_label.h          |  2 +-
 arch/powerpc/include/asm/mmu-44x.h             |  1 +
 arch/powerpc/include/asm/mmu.h                 |  2 +-
 arch/powerpc/include/asm/nohash/64/pgtable.h   |  1 +
 arch/powerpc/include/asm/page.h                |  2 +-
 arch/powerpc/include/asm/page_64.h             |  2 ++
 arch/powerpc/include/asm/ppc-opcode.h          |  2 +-
 arch/powerpc/include/asm/ptrace.h              |  1 +
 arch/powerpc/include/asm/reg.h                 |  1 +
 arch/powerpc/include/asm/reg_a2.h              |  2 ++
 arch/powerpc/include/asm/spinlock.h            |  1 -
 arch/powerpc/include/asm/synch.h               |  1 +
 arch/powerpc/include/asm/thread_info.h         |  2 ++
 arch/powerpc/include/asm/uaccess.h             |  1 -
 arch/powerpc/kernel/entry_64.S                 |  1 +
 arch/powerpc/kernel/fpu.S                      |  1 +
 arch/powerpc/kernel/idle_book3s.S              |  1 +
 arch/powerpc/kernel/kvm_emul.S                 |  1 +
 arch/powerpc/kernel/ppc_save_regs.S            |  1 +
 arch/powerpc/kernel/vector.S                   |  1 +
 arch/powerpc/kvm/book3s_64_slb.S               |  2 ++
 arch/powerpc/kvm/book3s_hv_interrupts.S        |  1 +
 arch/powerpc/kvm/book3s_hv_rmhandlers.S        |  1 +
 arch/powerpc/kvm/book3s_interrupts.S           |  1 +
 arch/powerpc/kvm/book3s_rmhandlers.S           |  1 +
 arch/powerpc/kvm/book3s_segment.S              |  2 ++
 arch/powerpc/lib/copyuser_64.S                 |  1 +
 arch/powerpc/lib/feature-fixups-test.S         |  1 +
 arch/powerpc/lib/ldstfp.S                      |  1 +
 arch/powerpc/lib/memcpy_64.S                   |  1 +
 arch/powerpc/mm/tlb_nohash_low.S               |  1 +
 arch/powerpc/net/bpf_jit32.h                   |  1 +
 arch/powerpc/net/bpf_jit_asm.S                 |  1 +
 arch/powerpc/net/bpf_jit_comp.c                |  1 +
 arch/powerpc/net/bpf_jit_comp64.c              |  1 +
 arch/powerpc/platforms/powernv/opal-wrappers.S |  1 +
 arch/powerpc/platforms/pseries/setup.c         |  1 +
 arch/powerpc/purgatory/trampoline.S            | 10 +---------
 arch/powerpc/xmon/spr_access.S                 |  1 +
 55 files changed, 72 insertions(+), 33 deletions(-)
 create mode 100644 arch/powerpc/include/asm/asm-const.h
arch/powerpc/crypto/md5-asm.S +1 -0
index 10cdf5bceebb..1834065362c7 100644
@@ -11,6 +11,7 @@
  */
 #include <asm/ppc_asm.h>
 #include <asm/asm-offsets.h>
+#include <asm/asm-compat.h>
 
 #define rHP	r3
 #define rWP	r4
arch/powerpc/crypto/sha1-powerpc-asm.S +1 -0
index c8951ce0dcc4..23e248beff71 100644
@@ -7,6 +7,7 @@
 
 #include <asm/ppc_asm.h>
 #include <asm/asm-offsets.h>
+#include <asm/asm-compat.h>
 
 #ifdef __BIG_ENDIAN__
 #define LWZ(rt, d, ra)	\
arch/powerpc/include/asm/asm-compat.h +1 -12
index d2cf3593e987..09f8dd4da883 100644
@@ -1,21 +1,10 @@
 #ifndef _ASM_POWERPC_ASM_COMPAT_H
 #define _ASM_POWERPC_ASM_COMPAT_H
 
+#include <asm/asm-compat.h>
 #include <asm/types.h>
 #include <asm/ppc-opcode.h>
 
-#ifdef __ASSEMBLY__
-#  define stringify_in_c(...)	__VA_ARGS__
-#  define ASM_CONST(x)		x
-#else
-/* This version of stringify will deal with commas... */
-#  define __stringify_in_c(...)	#__VA_ARGS__
-#  define stringify_in_c(...)	__stringify_in_c(__VA_ARGS__) " "
-#  define __ASM_CONST(x)	x##UL
-#  define ASM_CONST(x)		__ASM_CONST(x)
-#endif
-
-
 #ifdef __powerpc64__
 
 /* operations for longs and pointers */
arch/powerpc/include/asm/asm-const.h new file +14 -0
new file mode 100644
index 000000000000..082c1538c562
@@ -0,0 +1,14 @@
+#ifndef _ASM_POWERPC_ASM_CONST_H
+#define _ASM_POWERPC_ASM_CONST_H
+
+#ifdef __ASSEMBLY__
+#  define stringify_in_c(...)	__VA_ARGS__
+#  define ASM_CONST(x)		x
+#else
+/* This version of stringify will deal with commas... */
+#  define __stringify_in_c(...)	#__VA_ARGS__
+#  define stringify_in_c(...)	__stringify_in_c(__VA_ARGS__) " "
+#  define __ASM_CONST(x)	x##UL
+#  define ASM_CONST(x)		__ASM_CONST(x)
+#endif
+#endif /* _ASM_POWERPC_ASM_CONST_H */
arch/powerpc/include/asm/barrier.h +2 -0
index f67b3f6e36be..de1316874e45 100644
@@ -5,6 +5,8 @@
 #ifndef _ASM_POWERPC_BARRIER_H
 #define _ASM_POWERPC_BARRIER_H
 
+#include <asm/asm-const.h>
+
 /*
  * Memory barrier.
  * The sync instruction guarantees that all memory accesses initiated
arch/powerpc/include/asm/book3s/64/hash.h +2 -0
index 0387b155f13d..d52a51b2ce7b 100644
@@ -3,6 +3,8 @@
 #define _ASM_POWERPC_BOOK3S_64_HASH_H
 #ifdef __KERNEL__
 
+#include <asm/asm-const.h>
+
 /*
  * Common bits between 4K and 64K pages in a linux-style PTE.
  * Additional bits may be defined in pgtable-hash64-*.h
arch/powerpc/include/asm/book3s/64/mmu-hash.h +1 -1
index 50ed64fba4ae..a2b384545bce 100644
@@ -12,9 +12,9 @@
  * 2 of the License, or (at your option) any later version.
  */
 
-#include <asm/asm-compat.h>
 #include <asm/page.h>
 #include <asm/bug.h>
+#include <asm/asm-const.h>
 
 /*
  * This is necessary to get the definition of PGTABLE_RANGE which we
arch/powerpc/include/asm/book3s/64/radix.h +2 -0
index ef9f96742ce1..e2bc11a35216 100644
@@ -2,6 +2,8 @@
 #ifndef _ASM_POWERPC_PGTABLE_RADIX_H
 #define _ASM_POWERPC_PGTABLE_RADIX_H
 
+#include <asm/asm-const.h>
+
 #ifndef __ASSEMBLY__
 #include <asm/cmpxchg.h>
 #endif
arch/powerpc/include/asm/cmpxchg.h +0 -1
index 67ec1073ac97..27183871eb3b 100644
@@ -5,7 +5,6 @@
 #ifdef __KERNEL__
 #include <linux/compiler.h>
 #include <asm/synch.h>
-#include <asm/asm-compat.h>
 #include <linux/bug.h>
 #include <asm/asm-405.h>
 
arch/powerpc/include/asm/code-patching.h +1 -0
index 812535f40124..9ecc7bfc8ae7 100644
@@ -14,6 +14,7 @@
 #include <asm/ppc-opcode.h>
 #include <linux/string.h>
 #include <linux/kallsyms.h>
+#include <asm/asm-compat.h>
 
 /* Flags for create_branch:
  * "b"   == create_branch(addr, target, 0);
arch/powerpc/include/asm/cputable.h +1 -1
index 9c0a3083571b..badcb36cb253 100644
@@ -4,9 +4,9 @@
 
 
 #include <linux/types.h>
-#include <asm/asm-compat.h>
 #include <asm/feature-fixups.h>
 #include <uapi/asm/cputable.h>
+#include <asm/asm-const.h>
 
 #ifndef __ASSEMBLY__
 
arch/powerpc/include/asm/dt_cpu_ftrs.h +0 -1
index 71515d909ed1..55113432fc91 100644
@@ -10,7 +10,6 @@
  */
 
 #include <linux/types.h>
-#include <asm/asm-compat.h>
 #include <asm/feature-fixups.h>
 #include <uapi/asm/cputable.h>
 
arch/powerpc/include/asm/feature-fixups.h +2 -0
index fcfd05672b1b..33b6f9c892c8 100644
@@ -1,6 +1,8 @@
 #ifndef __ASM_POWERPC_FEATURE_FIXUPS_H
 #define __ASM_POWERPC_FEATURE_FIXUPS_H
 
+#include <asm/asm-const.h>
+
 /*
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
arch/powerpc/include/asm/firmware.h +1 -1
index 535add3f7791..ce8aab72c21b 100644
@@ -14,8 +14,8 @@
 
 #ifdef __KERNEL__
 
-#include <asm/asm-compat.h>
 #include <asm/feature-fixups.h>
+#include <asm/asm-const.h>
 
 /* firmware feature bitmask values */
 
arch/powerpc/include/asm/futex.h +0 -1
index 76c8648d0fa8..94542776a62d 100644
@@ -8,7 +8,6 @@
 #include <linux/uaccess.h>
 #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) \
arch/powerpc/include/asm/iommu.h +1 -0
index 20febe0b7f32..880a8a19d20d 100644
@@ -30,6 +30,7 @@
 #include <asm/machdep.h>
 #include <asm/types.h>
 #include <asm/pci-bridge.h>
+#include <asm/asm-const.h>
 
 #define IOMMU_PAGE_SHIFT_4K      12
 #define IOMMU_PAGE_SIZE_4K       (ASM_CONST(1) << IOMMU_PAGE_SHIFT_4K)
arch/powerpc/include/asm/jump_label.h +1 -1
index 9a287e0ac8b1..a3b2cf940b4e 100644
@@ -14,7 +14,7 @@
 #include <linux/types.h>
 
 #include <asm/feature-fixups.h>
-#include <asm/asm-compat.h>
+#include <asm/asm-const.h>
 
 #define JUMP_ENTRY_TYPE		stringify_in_c(FTR_ENTRY_LONG)
 #define JUMP_LABEL_NOP_SIZE	4
arch/powerpc/include/asm/mmu-44x.h +1 -0
index cb57f29f531d..9bdbe1d1c9b9 100644
@@ -6,6 +6,7 @@
  */
 
 #include <asm/page.h>
+#include <asm/asm-const.h>
 
 #define PPC44x_MMUCR_TID	0x000000ff
 #define PPC44x_MMUCR_STS	0x00010000
arch/powerpc/include/asm/mmu.h +1 -1
index 61d15ce92278..8418d83b5eb0 100644
@@ -5,8 +5,8 @@
 
 #include <linux/types.h>
 
-#include <asm/asm-compat.h>
 #include <asm/feature-fixups.h>
+#include <asm/asm-const.h>
 
 /*
  * MMU features bit definitions
arch/powerpc/include/asm/nohash/64/pgtable.h +1 -0
index dd0c7236208f..fe05b3e03cf1 100644
@@ -8,6 +8,7 @@
 
 #include <asm/nohash/64/pgtable-4k.h>
 #include <asm/barrier.h>
+#include <asm/asm-const.h>
 
 #ifdef CONFIG_PPC_64K_PAGES
 #error "Page size not supported"
arch/powerpc/include/asm/page.h +1 -1
index a9fbefaacf10..f6a1265face2 100644
@@ -16,7 +16,7 @@
 #else
 #include <asm/types.h>
 #endif
-#include <asm/asm-compat.h>
+#include <asm/asm-const.h>
 
 /*
  * On regular PPC32 page size is 4K (but we support 4K/16K/64K/256K pages
arch/powerpc/include/asm/page_64.h +2 -0
index af04acdb873f..c0ce17e909ef 100644
@@ -10,6 +10,8 @@
  * 2 of the License, or (at your option) any later version.
  */
 
+#include <asm/asm-const.h>
+
 /*
  * We always define HW_PAGE_SHIFT to 12 as use of 64K pages remains Linux
  * specific, every notion of page number shared with the firmware, TCEs,
arch/powerpc/include/asm/ppc-opcode.h +1 -1
index 4436887bc415..68d916ae1986 100644
@@ -13,7 +13,7 @@
 #define _ASM_POWERPC_PPC_OPCODE_H
 
 #include <linux/stringify.h>
-#include <asm/asm-compat.h>
+#include <asm/asm-const.h>
 
 #define	__REG_R0	0
 #define	__REG_R1	1
arch/powerpc/include/asm/ptrace.h +1 -0
index e4923686e43a..447cbd1bee99 100644
@@ -24,6 +24,7 @@
 #define _ASM_POWERPC_PTRACE_H
 
 #include <uapi/asm/ptrace.h>
+#include <asm/asm-const.h>
 
 
 #ifdef __powerpc64__
arch/powerpc/include/asm/reg.h +1 -0
index 562568414cf4..d4a8dc71a057 100644
@@ -13,6 +13,7 @@
 
 #include <linux/stringify.h>
 #include <asm/cputable.h>
+#include <asm/asm-const.h>
 
 /* Pickup Book E specific registers. */
 #if defined(CONFIG_BOOKE) || defined(CONFIG_40x)
arch/powerpc/include/asm/reg_a2.h +2 -0
index 3ba9c6f096fc..74c2c57c492a 100644
@@ -12,6 +12,8 @@
 #ifndef __ASM_POWERPC_REG_A2_H__
 #define __ASM_POWERPC_REG_A2_H__
 
+#include <asm/asm-const.h>
+
 #define SPRN_TENSR	0x1b5
 #define SPRN_TENS	0x1b6	/* Thread ENable Set */
 #define SPRN_TENC	0x1b7	/* Thread ENable Clear */
arch/powerpc/include/asm/spinlock.h +0 -1
index 7ec38f4ee927..685c72310f5d 100644
@@ -24,7 +24,6 @@
 #include <asm/paca.h>
 #include <asm/hvcall.h>
 #endif
-#include <asm/asm-compat.h>
 #include <asm/synch.h>
 #include <asm/ppc-opcode.h>
 #include <asm/asm-405.h>
arch/powerpc/include/asm/synch.h +1 -0
index 6ec546090ba1..f6f8c75bbb24 100644
@@ -5,6 +5,7 @@
 
 #include <linux/stringify.h>
 #include <asm/feature-fixups.h>
+#include <asm/asm-const.h>
 
 #ifndef __ASSEMBLY__
 extern unsigned int __start___lwsync_fixup, __stop___lwsync_fixup;
arch/powerpc/include/asm/thread_info.h +2 -0
index f308dfeb2746..ae554b6fe6b9 100644
@@ -9,6 +9,8 @@
 #ifndef _ASM_POWERPC_THREAD_INFO_H
 #define _ASM_POWERPC_THREAD_INFO_H
 
+#include <asm/asm-const.h>
+
 #ifdef __KERNEL__
 
 #define THREAD_SHIFT		CONFIG_THREAD_SHIFT
arch/powerpc/include/asm/uaccess.h +0 -1
index 468653ce844c..643cfbd5bcb5 100644
@@ -2,7 +2,6 @@
 #ifndef _ARCH_POWERPC_UACCESS_H
 #define _ARCH_POWERPC_UACCESS_H
 
-#include <asm/asm-compat.h>
 #include <asm/ppc_asm.h>
 #include <asm/processor.h>
 #include <asm/page.h>
arch/powerpc/kernel/entry_64.S +1 -0
index 729e9ef4d3bb..fc4b4c69ce40 100644
@@ -38,6 +38,7 @@
 #include <asm/ppc-opcode.h>
 #include <asm/barrier.h>
 #include <asm/export.h>
+#include <asm/asm-compat.h>
 #ifdef CONFIG_PPC_BOOK3S
 #include <asm/exception-64s.h>
 #else
arch/powerpc/kernel/fpu.S +1 -0
index 6c509f39bbde..07c913fd5aba 100644
@@ -25,6 +25,7 @@
 #include <asm/asm-offsets.h>
 #include <asm/ptrace.h>
 #include <asm/export.h>
+#include <asm/asm-compat.h>
 
 #ifdef CONFIG_VSX
 #define __REST_32FPVSRS(n,c,base)					\
arch/powerpc/kernel/idle_book3s.S +1 -0
index e734f6e45abc..3db0513d8442 100644
@@ -23,6 +23,7 @@
 #include <asm/exception-64s.h>
 #include <asm/book3s/64/mmu-hash.h>
 #include <asm/mmu.h>
+#include <asm/asm-compat.h>
 
 #undef DEBUG
 
arch/powerpc/kernel/kvm_emul.S +1 -0
index e100ff324a85..c005088f6c9c 100644
@@ -23,6 +23,7 @@
 #include <asm/reg.h>
 #include <asm/page.h>
 #include <asm/asm-offsets.h>
+#include <asm/asm-compat.h>
 
 #define KVM_MAGIC_PAGE		(-4096)
 
arch/powerpc/kernel/ppc_save_regs.S +1 -0
index 8afbe213d729..6d1b42ee797c 100644
@@ -12,6 +12,7 @@
 #include <asm/ppc_asm.h>
 #include <asm/asm-offsets.h>
 #include <asm/ptrace.h>
+#include <asm/asm-compat.h>
 
 /*
  * Grab the register values as they are now.
arch/powerpc/kernel/vector.S +1 -0
index f314fd475491..21165da0052d 100644
@@ -8,6 +8,7 @@
 #include <asm/page.h>
 #include <asm/ptrace.h>
 #include <asm/export.h>
+#include <asm/asm-compat.h>
 
 /*
  * Load state from memory into VMX registers including VSCR.
arch/powerpc/kvm/book3s_64_slb.S +2 -0
index 688722acd692..d293485c1a60 100644
@@ -17,6 +17,8 @@
  * Authors: Alexander Graf <[email protected]>
  */
 
+#include <asm/asm-compat.h>
+
 #define SHADOW_SLB_ENTRY_LEN	0x10
 #define OFFSET_ESID(x)		(SHADOW_SLB_ENTRY_LEN * x)
 #define OFFSET_VSID(x)		((SHADOW_SLB_ENTRY_LEN * x) + 8)
arch/powerpc/kvm/book3s_hv_interrupts.S +1 -0
index 82f2ff9410b6..4218073eea1f 100644
@@ -27,6 +27,7 @@
 #include <asm/asm-offsets.h>
 #include <asm/exception-64s.h>
 #include <asm/ppc-opcode.h>
+#include <asm/asm-compat.h>
 
 /*****************************************************************************
  *                                                                           *
arch/powerpc/kvm/book3s_hv_rmhandlers.S +1 -0
index 153988d878e8..e24a1e7279fd 100644
@@ -32,6 +32,7 @@
 #include <asm/opal.h>
 #include <asm/xive-regs.h>
 #include <asm/thread_info.h>
+#include <asm/asm-compat.h>
 
 /* Sign-extend HDEC if not on POWER9 */
 #define EXTEND_HDEC(reg)			\
arch/powerpc/kvm/book3s_interrupts.S +1 -0
index c18e845019ec..d71dab16dc6f 100644
@@ -23,6 +23,7 @@
 #include <asm/page.h>
 #include <asm/asm-offsets.h>
 #include <asm/exception-64s.h>
+#include <asm/asm-compat.h>
 
 #if defined(CONFIG_PPC_BOOK3S_64)
 #ifdef PPC64_ELF_ABI_v2
arch/powerpc/kvm/book3s_rmhandlers.S +1 -0
index 34a5adeff084..b0089e04c8c8 100644
@@ -23,6 +23,7 @@
 #include <asm/mmu.h>
 #include <asm/page.h>
 #include <asm/asm-offsets.h>
+#include <asm/asm-compat.h>
 
 #ifdef CONFIG_PPC_BOOK3S_64
 #include <asm/exception-64s.h>
arch/powerpc/kvm/book3s_segment.S +2 -0
index 98ccc7ec5d48..7fec258bb072 100644
@@ -19,6 +19,8 @@
 
 /* Real mode helpers */
 
+#include <asm/asm-compat.h>
+
 #if defined(CONFIG_PPC_BOOK3S_64)
 
 #define GET_SHADOW_VCPU(reg)    \
arch/powerpc/lib/copyuser_64.S +1 -0
index 506677395681..65244263b6a3 100644
@@ -9,6 +9,7 @@
 #include <asm/processor.h>
 #include <asm/ppc_asm.h>
 #include <asm/export.h>
+#include <asm/asm-compat.h>
 
 #ifdef __BIG_ENDIAN__
 #define sLd sld		/* Shift towards low-numbered address. */
arch/powerpc/lib/feature-fixups-test.S +1 -0
index f16cec989506..ee7c5fd5fc64 100644
@@ -11,6 +11,7 @@
 #include <asm/feature-fixups.h>
 #include <asm/ppc_asm.h>
 #include <asm/synch.h>
+#include <asm/asm-compat.h>
 
 	.text
 
arch/powerpc/lib/ldstfp.S +1 -0
index ae15eba49c1f..32e91994b6b2 100644
@@ -15,6 +15,7 @@
 #include <asm/ppc-opcode.h>
 #include <asm/reg.h>
 #include <asm/asm-offsets.h>
+#include <asm/asm-compat.h>
 #include <linux/errno.h>
 
 #ifdef CONFIG_PPC_FPU
arch/powerpc/lib/memcpy_64.S +1 -0
index 8d8265be1a59..26ea02b7311f 100644
@@ -9,6 +9,7 @@
 #include <asm/processor.h>
 #include <asm/ppc_asm.h>
 #include <asm/export.h>
+#include <asm/asm-compat.h>
 
 	.align	7
 _GLOBAL_TOC(memcpy)
arch/powerpc/mm/tlb_nohash_low.S +1 -0
index 048b8e9f4492..505a3d010c47 100644
@@ -34,6 +34,7 @@
 #include <asm/asm-offsets.h>
 #include <asm/processor.h>
 #include <asm/bug.h>
+#include <asm/asm-compat.h>
 
 #if defined(CONFIG_40x)
 
arch/powerpc/net/bpf_jit32.h +1 -0
index a8cd7e289ecd..6f4daacad296 100644
@@ -13,6 +13,7 @@
 #ifndef _BPF_JIT32_H
 #define _BPF_JIT32_H
 
+#include <asm/asm-compat.h>
 #include "bpf_jit.h"
 
 #ifdef CONFIG_PPC64
arch/powerpc/net/bpf_jit_asm.S +1 -0
index 3dd9c43d40c9..c80280dc2e04 100644
@@ -10,6 +10,7 @@
  */
 
 #include <asm/ppc_asm.h>
+#include <asm/asm-compat.h>
 #include "bpf_jit32.h"
 
 /*
arch/powerpc/net/bpf_jit_comp.c +1 -0
index 5b061fc81df3..d5bfe24bb3b5 100644
@@ -12,6 +12,7 @@
  */
 #include <linux/moduleloader.h>
 #include <asm/cacheflush.h>
+#include <asm/asm-compat.h>
 #include <linux/netdevice.h>
 #include <linux/filter.h>
 #include <linux/if_vlan.h>
arch/powerpc/net/bpf_jit_comp64.c +1 -0
index 380cbf9a40d9..b8de5244a58c 100644
@@ -13,6 +13,7 @@
  */
 #include <linux/moduleloader.h>
 #include <asm/cacheflush.h>
+#include <asm/asm-compat.h>
 #include <linux/netdevice.h>
 #include <linux/filter.h>
 #include <linux/if_vlan.h>
arch/powerpc/platforms/powernv/opal-wrappers.S +1 -0
index a8d9b4089c31..4016e3c3d18b 100644
@@ -14,6 +14,7 @@
 #include <asm/hvcall.h>
 #include <asm/asm-offsets.h>
 #include <asm/opal.h>
+#include <asm/asm-compat.h>
 
 	.section	".text"
 
arch/powerpc/platforms/pseries/setup.c +1 -0
index 139f0af6c3d9..e14ccf32a97d 100644
@@ -69,6 +69,7 @@
 #include <asm/kexec.h>
 #include <asm/isa-bridge.h>
 #include <asm/security_features.h>
+#include <asm/asm-const.h>
 
 #include "pseries.h"
 
arch/powerpc/purgatory/trampoline.S +1 -9
index 4aad9dd10ace..1e1129553fd7 100644
@@ -12,15 +12,7 @@
  * Software Foundation (version 2 of the License).
  */
 
-#if defined(__LITTLE_ENDIAN__)
-#define STWX_BE	stwbrx
-#define LWZX_BE	lwbrx
-#elif defined(__BIG_ENDIAN__)
-#define STWX_BE	stwx
-#define LWZX_BE	lwzx
-#else
-#error no endianness defined!
-#endif
+#include <asm/asm-compat.h>
 
 	.machine ppc64
 	.balign 256
arch/powerpc/xmon/spr_access.S +1 -0
index 4099cbcddaaa..720a52afdd58 100644
@@ -1,5 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0 */
 #include <asm/ppc_asm.h>
+#include <asm/asm-compat.h>
 
 /* unsigned long xmon_mfspr(sprn, default_value) */
 _GLOBAL(xmon_mfspr)
Signature · 1 line
2.13.3
#9 lore raw

PATCH v3 5/16 powerpc: clean the inclusion of stringify.h

In reply to Christophe Leroy

Only include linux/stringify.h is files using __stringify()

---
 arch/powerpc/include/asm/dcr-native.h        | 1 +
 arch/powerpc/include/asm/ppc-opcode.h        | 1 -
 arch/powerpc/include/asm/reg_fsl_emb.h       | 2 ++
 arch/powerpc/include/asm/synch.h             | 1 -
 arch/powerpc/include/asm/thread_info.h       | 1 -
 arch/powerpc/kernel/prom.c                   | 1 -
 arch/powerpc/kernel/prom_init.c              | 1 -
 arch/powerpc/kvm/book3s_64_vio_hv.c          | 1 +
 arch/powerpc/lib/locks.c                     | 1 -
 arch/powerpc/perf/req-gen/_begin.h           | 2 ++
 arch/powerpc/perf/req-gen/perf.h             | 1 +
 arch/powerpc/platforms/cell/cbe_thermal.c    | 1 +
 arch/powerpc/platforms/cell/spufs/sputrace.h | 1 +
 arch/powerpc/platforms/powernv/vas.h         | 1 +
 arch/powerpc/platforms/pseries/mobility.c    | 1 +
 15 files changed, 11 insertions(+), 6 deletions(-)
arch/powerpc/include/asm/dcr-native.h +1 -0
index 4a2beef74277..151dff555f50 100644
@@ -25,6 +25,7 @@
 #include <linux/spinlock.h>
 #include <asm/cputable.h>
 #include <asm/cpu_has_feature.h>
+#include <linux/stringify.h>
 
 typedef struct {
 	unsigned int base;
arch/powerpc/include/asm/ppc-opcode.h +0 -1
index 68d916ae1986..04a03da18602 100644
@@ -12,7 +12,6 @@
 #ifndef _ASM_POWERPC_PPC_OPCODE_H
 #define _ASM_POWERPC_PPC_OPCODE_H
 
-#include <linux/stringify.h>
 #include <asm/asm-const.h>
 
 #define	__REG_R0	0
arch/powerpc/include/asm/reg_fsl_emb.h +2 -0
index d7ccf93e6279..a21f529c43d9 100644
@@ -7,6 +7,8 @@
 #ifndef __ASM_POWERPC_REG_FSL_EMB_H__
 #define __ASM_POWERPC_REG_FSL_EMB_H__
 
+#include <linux/stringify.h>
+
 #ifndef __ASSEMBLY__
 /* Performance Monitor Registers */
 #define mfpmr(rn)	({unsigned int rval; \
arch/powerpc/include/asm/synch.h +0 -1
index f6f8c75bbb24..aca70fb43147 100644
@@ -3,7 +3,6 @@
 #define _ASM_POWERPC_SYNCH_H 
 #ifdef __KERNEL__
 
-#include <linux/stringify.h>
 #include <asm/feature-fixups.h>
 #include <asm/asm-const.h>
 
arch/powerpc/include/asm/thread_info.h +0 -1
index ae554b6fe6b9..3c0002044bc9 100644
@@ -27,7 +27,6 @@
 #include <linux/cache.h>
 #include <asm/processor.h>
 #include <asm/page.h>
-#include <linux/stringify.h>
 #include <asm/accounting.h>
 
 /*
arch/powerpc/kernel/prom.c +0 -1
index 05e7fb47a7a4..60ccf08d3a08 100644
@@ -23,7 +23,6 @@
 #include <linux/spinlock.h>
 #include <linux/types.h>
 #include <linux/pci.h>
-#include <linux/stringify.h>
 #include <linux/delay.h>
 #include <linux/initrd.h>
 #include <linux/bitops.h>
arch/powerpc/kernel/prom_init.c +0 -1
index 5425dd3d6a9f..8e516336df33 100644
@@ -27,7 +27,6 @@
 #include <linux/types.h>
 #include <linux/pci.h>
 #include <linux/proc_fs.h>
-#include <linux/stringify.h>
 #include <linux/delay.h>
 #include <linux/initrd.h>
 #include <linux/bitops.h>
arch/powerpc/kvm/book3s_64_vio_hv.c +1 -0
index 925fc316a104..80d50d67b8c5 100644
@@ -26,6 +26,7 @@
 #include <linux/slab.h>
 #include <linux/hugetlb.h>
 #include <linux/list.h>
+#include <linux/stringify.h>
 
 #include <asm/tlbflush.h>
 #include <asm/kvm_ppc.h>
arch/powerpc/lib/locks.c +0 -1
index b7b1237d4aa6..35a0ef932e1a 100644
@@ -15,7 +15,6 @@
 #include <linux/kernel.h>
 #include <linux/spinlock.h>
 #include <linux/export.h>
-#include <linux/stringify.h>
 #include <linux/smp.h>
 
 /* waiting for a spinlock... */
arch/powerpc/perf/req-gen/_begin.h +2 -0
index 549f8782c52d..a200b86eba3b 100644
@@ -3,6 +3,8 @@
 #ifndef POWERPC_PERF_REQ_GEN_H_
 #define POWERPC_PERF_REQ_GEN_H_
 
+#include <linux/stringify.h>
+
 #define CAT2_STR_(t, s) __stringify(t/s)
 #define CAT2_STR(t, s) CAT2_STR_(t, s)
 #define I(...) __VA_ARGS__
arch/powerpc/perf/req-gen/perf.h +1 -0
index 871a9a1766c2..fa9bc804e67a 100644
@@ -3,6 +3,7 @@
 #define LINUX_POWERPC_PERF_REQ_GEN_PERF_H_
 
 #include <linux/perf_event.h>
+#include <linux/stringify.h>
 
 #ifndef REQUEST_FILE
 #error "REQUEST_FILE must be defined before including"
arch/powerpc/platforms/cell/cbe_thermal.c +1 -0
index 2c15ff094483..55aac74e1cb9 100644
@@ -49,6 +49,7 @@
 #include <linux/device.h>
 #include <linux/kernel.h>
 #include <linux/cpu.h>
+#include <linux/stringify.h>
 #include <asm/spu.h>
 #include <asm/io.h>
 #include <asm/prom.h>
arch/powerpc/platforms/cell/spufs/sputrace.h +1 -0
index d557e999b662..1def11e911ac 100644
@@ -3,6 +3,7 @@
 #define _TRACE_SPUFS_H
 
 #include <linux/tracepoint.h>
+#include <linux/stringify.h>
 
 #undef TRACE_SYSTEM
 #define TRACE_SYSTEM spufs
arch/powerpc/platforms/powernv/vas.h +1 -0
index ae0100fd35bb..f5493dbdd7ff 100644
@@ -15,6 +15,7 @@
 #include <linux/io.h>
 #include <linux/dcache.h>
 #include <linux/mutex.h>
+#include <linux/stringify.h>
 
 /*
  * Overview of Virtual Accelerator Switchboard (VAS).
arch/powerpc/platforms/pseries/mobility.c +1 -0
index 8a8033a249c7..f0e30dc94988 100644
@@ -17,6 +17,7 @@
 #include <linux/device.h>
 #include <linux/delay.h>
 #include <linux/slab.h>
+#include <linux/stringify.h>
 
 #include <asm/machdep.h>
 #include <asm/rtas.h>
Signature · 1 line
2.13.3
#11 lore raw

PATCH v3 6/16 powerpc: clean inclusions of asm/feature-fixups.h

In reply to Christophe Leroy

files not using feature fixup don't need asm/feature-fixups.h files using feature fixup need asm/feature-fixups.h

---
 arch/powerpc/include/asm/cputable.h            | 1 -
 arch/powerpc/include/asm/dbell.h               | 1 +
 arch/powerpc/include/asm/dt_cpu_ftrs.h         | 1 -
 arch/powerpc/include/asm/exception-64s.h       | 1 +
 arch/powerpc/include/asm/firmware.h            | 1 -
 arch/powerpc/include/asm/kvm_booke_hv_asm.h    | 2 ++
 arch/powerpc/include/asm/mmu.h                 | 1 -
 arch/powerpc/include/asm/ppc_asm.h             | 1 +
 arch/powerpc/include/asm/reg.h                 | 1 +
 arch/powerpc/kernel/cpu_setup_6xx.S            | 1 +
 arch/powerpc/kernel/entry_32.S                 | 1 +
 arch/powerpc/kernel/entry_64.S                 | 1 +
 arch/powerpc/kernel/exceptions-64e.S           | 1 +
 arch/powerpc/kernel/exceptions-64s.S           | 1 +
 arch/powerpc/kernel/fpu.S                      | 1 +
 arch/powerpc/kernel/head_32.S                  | 1 +
 arch/powerpc/kernel/head_64.S                  | 1 +
 arch/powerpc/kernel/head_fsl_booke.S           | 1 +
 arch/powerpc/kernel/idle_6xx.S                 | 1 +
 arch/powerpc/kernel/idle_book3s.S              | 1 +
 arch/powerpc/kernel/idle_e500.S                | 1 +
 arch/powerpc/kernel/idle_power4.S              | 1 +
 arch/powerpc/kernel/l2cr_6xx.S                 | 1 +
 arch/powerpc/kernel/misc_32.S                  | 1 +
 arch/powerpc/kernel/misc_64.S                  | 1 +
 arch/powerpc/kernel/setup_32.c                 | 1 +
 arch/powerpc/kernel/setup_64.c                 | 1 +
 arch/powerpc/kernel/swsusp_32.S                | 1 +
 arch/powerpc/kernel/swsusp_asm64.S             | 1 +
 arch/powerpc/kernel/tm.S                       | 1 +
 arch/powerpc/kvm/book3s_64_slb.S               | 1 +
 arch/powerpc/kvm/book3s_hv_interrupts.S        | 1 +
 arch/powerpc/kvm/book3s_hv_rmhandlers.S        | 1 +
 arch/powerpc/kvm/book3s_segment.S              | 1 +
 arch/powerpc/lib/copypage_64.S                 | 1 +
 arch/powerpc/lib/copyuser_64.S                 | 1 +
 arch/powerpc/lib/hweight_64.S                  | 1 +
 arch/powerpc/lib/memcpy_64.S                   | 1 +
 arch/powerpc/mm/hash_low_32.S                  | 1 +
 arch/powerpc/mm/hash_native_64.c               | 1 +
 arch/powerpc/mm/slb_low.S                      | 1 +
 arch/powerpc/mm/tlb_low_64e.S                  | 1 +
 arch/powerpc/mm/tlb_nohash_low.S               | 1 +
 arch/powerpc/platforms/powermac/cache.S        | 1 +
 arch/powerpc/platforms/powermac/sleep.S        | 1 +
 arch/powerpc/platforms/powernv/opal-wrappers.S | 1 +
 arch/powerpc/platforms/pseries/hvCall.S        | 1 +
 47 files changed, 44 insertions(+), 4 deletions(-)
arch/powerpc/include/asm/cputable.h +0 -1
index badcb36cb253..5f9f477d39d3 100644
@@ -4,7 +4,6 @@
 
 
 #include <linux/types.h>
-#include <asm/feature-fixups.h>
 #include <uapi/asm/cputable.h>
 #include <asm/asm-const.h>
 
arch/powerpc/include/asm/dbell.h +1 -0
index 998c42ff1caa..99b84db23e8c 100644
@@ -16,6 +16,7 @@
 #include <linux/threads.h>
 
 #include <asm/ppc-opcode.h>
+#include <asm/feature-fixups.h>
 
 #define PPC_DBELL_MSG_BRDCAST	(0x04000000)
 #define PPC_DBELL_TYPE(x)	(((x) & 0xf) << (63-36))
arch/powerpc/include/asm/dt_cpu_ftrs.h +0 -1
index 55113432fc91..0c729e2d0e8a 100644
@@ -10,7 +10,6 @@
  */
 
 #include <linux/types.h>
-#include <asm/feature-fixups.h>
 #include <uapi/asm/cputable.h>
 
 #ifdef CONFIG_PPC_DT_CPU_FTRS
arch/powerpc/include/asm/exception-64s.h +1 -0
index c40b4380951c..1f2efc1a9769 100644
@@ -35,6 +35,7 @@
  * implementations as possible.
  */
 #include <asm/head-64.h>
+#include <asm/feature-fixups.h>
 
 /* PACA save area offsets (exgen, exmc, etc) */
 #define EX_R9		0
arch/powerpc/include/asm/firmware.h +0 -1
index ce8aab72c21b..7a051bd21f87 100644
@@ -14,7 +14,6 @@
 
 #ifdef __KERNEL__
 
-#include <asm/feature-fixups.h>
 #include <asm/asm-const.h>
 
 /* firmware feature bitmask values */
arch/powerpc/include/asm/kvm_booke_hv_asm.h +2 -0
index e5f048bbcb7c..931260b59ac6 100644
@@ -9,6 +9,8 @@
 #ifndef ASM_KVM_BOOKE_HV_ASM_H
 #define ASM_KVM_BOOKE_HV_ASM_H
 
+#include <asm/feature-fixups.h>
+
 #ifdef __ASSEMBLY__
 
 /*
arch/powerpc/include/asm/mmu.h +0 -1
index 8418d83b5eb0..13ea441ac531 100644
@@ -5,7 +5,6 @@
 
 #include <linux/types.h>
 
-#include <asm/feature-fixups.h>
 #include <asm/asm-const.h>
 
 /*
arch/powerpc/include/asm/ppc_asm.h +1 -0
index 75ece56dcd62..b5d023680801 100644
@@ -9,6 +9,7 @@
 #include <asm/processor.h>
 #include <asm/ppc-opcode.h>
 #include <asm/firmware.h>
+#include <asm/feature-fixups.h>
 
 #ifdef __ASSEMBLY__
 
arch/powerpc/include/asm/reg.h +1 -0
index d4a8dc71a057..486b7c83b8c5 100644
@@ -14,6 +14,7 @@
 #include <linux/stringify.h>
 #include <asm/cputable.h>
 #include <asm/asm-const.h>
+#include <asm/feature-fixups.h>
 
 /* Pickup Book E specific registers. */
 #if defined(CONFIG_BOOKE) || defined(CONFIG_40x)
arch/powerpc/kernel/cpu_setup_6xx.S +1 -0
index a9f3970693e1..fa3c2c91290c 100644
@@ -16,6 +16,7 @@
 #include <asm/asm-offsets.h>
 #include <asm/cache.h>
 #include <asm/mmu.h>
+#include <asm/feature-fixups.h>
 
 _GLOBAL(__setup_cpu_603)
 	mflr	r5
arch/powerpc/kernel/entry_32.S +1 -0
index 7642cb984d3a..3bd097be90d9 100644
@@ -34,6 +34,7 @@
 #include <asm/ptrace.h>
 #include <asm/export.h>
 #include <asm/asm-405.h>
+#include <asm/feature-fixups.h>
 
 /*
  * MSR_KERNEL is > 0x10000 on 4xx/Book-E since it include MSR_CE.
arch/powerpc/kernel/entry_64.S +1 -0
index fc4b4c69ce40..31068be6be59 100644
@@ -44,6 +44,7 @@
 #else
 #include <asm/exception-64e.h>
 #endif
+#include <asm/feature-fixups.h>
 
 /*
  * System calls.
arch/powerpc/kernel/exceptions-64e.S +1 -0
index 9b6e653e501a..419efdd567be 100644
@@ -27,6 +27,7 @@
 #include <asm/hw_irq.h>
 #include <asm/kvm_asm.h>
 #include <asm/kvm_booke_hv_asm.h>
+#include <asm/feature-fixups.h>
 
 /* XXX This will ultimately add space for a special exception save
  *     structure used to save things like SRR0/SRR1, SPRGs, MAS, etc...
arch/powerpc/kernel/exceptions-64s.S +1 -0
index 285c6465324a..a3c79aed2f61 100644
@@ -18,6 +18,7 @@
 #include <asm/ptrace.h>
 #include <asm/cpuidle.h>
 #include <asm/head-64.h>
+#include <asm/feature-fixups.h>
 
 /*
  * There are a few constraints to be concerned with.
arch/powerpc/kernel/fpu.S +1 -0
index 07c913fd5aba..529dcc21c3f9 100644
@@ -26,6 +26,7 @@
 #include <asm/ptrace.h>
 #include <asm/export.h>
 #include <asm/asm-compat.h>
+#include <asm/feature-fixups.h>
 
 #ifdef CONFIG_VSX
 #define __REST_32FPVSRS(n,c,base)					\
arch/powerpc/kernel/head_32.S +1 -0
index 29b2fed93289..61ca27929355 100644
@@ -35,6 +35,7 @@
 #include <asm/bug.h>
 #include <asm/kvm_book3s_asm.h>
 #include <asm/export.h>
+#include <asm/feature-fixups.h>
 
 /* 601 only have IBAT; cr0.eq is set on 601 when using this macro */
 #define LOAD_BAT(n, reg, RA, RB)	\
arch/powerpc/kernel/head_64.S +1 -0
index 6eca15f25c73..4898e9491a1c 100644
@@ -44,6 +44,7 @@
 #include <asm/cputhreads.h>
 #include <asm/ppc-opcode.h>
 #include <asm/export.h>
+#include <asm/feature-fixups.h>
 
 /* The physical memory is laid out such that the secondary processor
  * spin code sits at 0x0000...0x00ff. On server, the vectors follow
arch/powerpc/kernel/head_fsl_booke.S +1 -0
index bf4c6021515f..e2750b856c8f 100644
@@ -43,6 +43,7 @@
 #include <asm/cache.h>
 #include <asm/ptrace.h>
 #include <asm/export.h>
+#include <asm/feature-fixups.h>
 #include "head_booke.h"
 
 /* As with the other PowerPC ports, it is expected that when code
arch/powerpc/kernel/idle_6xx.S +1 -0
index 1686916cc7f0..ff026c9d3cab 100644
@@ -20,6 +20,7 @@
 #include <asm/thread_info.h>
 #include <asm/ppc_asm.h>
 #include <asm/asm-offsets.h>
+#include <asm/feature-fixups.h>
 
 	.text
 
arch/powerpc/kernel/idle_book3s.S +1 -0
index 3db0513d8442..0cb6ffe992c2 100644
@@ -24,6 +24,7 @@
 #include <asm/book3s/64/mmu-hash.h>
 #include <asm/mmu.h>
 #include <asm/asm-compat.h>
+#include <asm/feature-fixups.h>
 
 #undef DEBUG
 
arch/powerpc/kernel/idle_e500.S +1 -0
index b9b6ef510be1..583e55ac7d26 100644
@@ -17,6 +17,7 @@
 #include <asm/thread_info.h>
 #include <asm/ppc_asm.h>
 #include <asm/asm-offsets.h>
+#include <asm/feature-fixups.h>
 
 	.text
 
arch/powerpc/kernel/idle_power4.S +1 -0
index 08faa93755f9..dd7471fe20bd 100644
@@ -16,6 +16,7 @@
 #include <asm/asm-offsets.h>
 #include <asm/irqflags.h>
 #include <asm/hw_irq.h>
+#include <asm/feature-fixups.h>
 
 #undef DEBUG
 
arch/powerpc/kernel/l2cr_6xx.S +1 -0
index 6408f09dbbd9..6e7dbb7d527c 100644
@@ -45,6 +45,7 @@
 #include <asm/ppc_asm.h>
 #include <asm/cache.h>
 #include <asm/page.h>
+#include <asm/feature-fixups.h>
 
 /* Usage:
 
arch/powerpc/kernel/misc_32.S +1 -0
index 3f7a9a2d2435..695b24a2d954 100644
@@ -34,6 +34,7 @@
 #include <asm/bug.h>
 #include <asm/ptrace.h>
 #include <asm/export.h>
+#include <asm/feature-fixups.h>
 
 	.text
 
arch/powerpc/kernel/misc_64.S +1 -0
index fa267e94090a..262ba9481781 100644
@@ -28,6 +28,7 @@
 #include <asm/ptrace.h>
 #include <asm/mmu.h>
 #include <asm/export.h>
+#include <asm/feature-fixups.h>
 
 	.text
 
arch/powerpc/kernel/setup_32.c +1 -0
index ef747a5a30b9..0e3743343280 100644
@@ -41,6 +41,7 @@
 #include <asm/cpu_has_feature.h>
 #include <asm/asm-prototypes.h>
 #include <asm/kdump.h>
+#include <asm/feature-fixups.h>
 
 #define DBG(fmt...)
 
arch/powerpc/kernel/setup_64.c +1 -0
index 225bc5f91049..6a501b25dd85 100644
@@ -68,6 +68,7 @@
 #include <asm/opal.h>
 #include <asm/cputhreads.h>
 #include <asm/hw_irq.h>
+#include <asm/feature-fixups.h>
 
 #include "setup.h"
 
arch/powerpc/kernel/swsusp_32.S +1 -0
index 34b73a262709..7a919e9a3400 100644
@@ -7,6 +7,7 @@
 #include <asm/ppc_asm.h>
 #include <asm/asm-offsets.h>
 #include <asm/mmu.h>
+#include <asm/feature-fixups.h>
 
 /*
  * Structure for storing CPU registers on the save area.
arch/powerpc/kernel/swsusp_asm64.S +1 -0
index 82d8aae81c6a..f83bf6f72cb0 100644
@@ -13,6 +13,7 @@
 #include <asm/thread_info.h>
 #include <asm/ppc_asm.h>
 #include <asm/asm-offsets.h>
+#include <asm/feature-fixups.h>
 
 /*
  * Structure for storing CPU registers on the save area.
arch/powerpc/kernel/tm.S +1 -0
index ff12f47a96b6..c0dcdd57cd7f 100644
@@ -13,6 +13,7 @@
 #include <asm/reg.h>
 #include <asm/bug.h>
 #include <asm/export.h>
+#include <asm/feature-fixups.h>
 
 #ifdef CONFIG_VSX
 /* See fpu.S, this is borrowed from there */
arch/powerpc/kvm/book3s_64_slb.S +1 -0
index d293485c1a60..066c665dc86f 100644
@@ -18,6 +18,7 @@
  */
 
 #include <asm/asm-compat.h>
+#include <asm/feature-fixups.h>
 
 #define SHADOW_SLB_ENTRY_LEN	0x10
 #define OFFSET_ESID(x)		(SHADOW_SLB_ENTRY_LEN * x)
arch/powerpc/kvm/book3s_hv_interrupts.S +1 -0
index 4218073eea1f..666b91c79eb4 100644
@@ -28,6 +28,7 @@
 #include <asm/exception-64s.h>
 #include <asm/ppc-opcode.h>
 #include <asm/asm-compat.h>
+#include <asm/feature-fixups.h>
 
 /*****************************************************************************
  *                                                                           *
arch/powerpc/kvm/book3s_hv_rmhandlers.S +1 -0
index e24a1e7279fd..ac53be00039a 100644
@@ -33,6 +33,7 @@
 #include <asm/xive-regs.h>
 #include <asm/thread_info.h>
 #include <asm/asm-compat.h>
+#include <asm/feature-fixups.h>
 
 /* Sign-extend HDEC if not on POWER9 */
 #define EXTEND_HDEC(reg)			\
arch/powerpc/kvm/book3s_segment.S +1 -0
index 7fec258bb072..e5c542a7c5ac 100644
@@ -20,6 +20,7 @@
 /* Real mode helpers */
 
 #include <asm/asm-compat.h>
+#include <asm/feature-fixups.h>
 
 #if defined(CONFIG_PPC_BOOK3S_64)
 
arch/powerpc/lib/copypage_64.S +1 -0
index 8d5034f645f3..694390357667 100644
@@ -11,6 +11,7 @@
 #include <asm/ppc_asm.h>
 #include <asm/asm-offsets.h>
 #include <asm/export.h>
+#include <asm/feature-fixups.h>
 
         .section        ".toc","aw"
 PPC64_CACHES:
arch/powerpc/lib/copyuser_64.S +1 -0
index 65244263b6a3..2d6f128d3ebe 100644
@@ -10,6 +10,7 @@
 #include <asm/ppc_asm.h>
 #include <asm/export.h>
 #include <asm/asm-compat.h>
+#include <asm/feature-fixups.h>
 
 #ifdef __BIG_ENDIAN__
 #define sLd sld		/* Shift towards low-numbered address. */
arch/powerpc/lib/hweight_64.S +1 -0
index 3de7ac154f24..0526b2225260 100644
@@ -20,6 +20,7 @@
 #include <asm/processor.h>
 #include <asm/ppc_asm.h>
 #include <asm/export.h>
+#include <asm/feature-fixups.h>
 
 /* Note: This code relies on -mminimal-toc */
 
arch/powerpc/lib/memcpy_64.S +1 -0
index 26ea02b7311f..94650d6eae9c 100644
@@ -10,6 +10,7 @@
 #include <asm/ppc_asm.h>
 #include <asm/export.h>
 #include <asm/asm-compat.h>
+#include <asm/feature-fixups.h>
 
 	.align	7
 _GLOBAL_TOC(memcpy)
arch/powerpc/mm/hash_low_32.S +1 -0
index ffbd7c0bda96..26acf6c8c20c 100644
@@ -27,6 +27,7 @@
 #include <asm/thread_info.h>
 #include <asm/asm-offsets.h>
 #include <asm/export.h>
+#include <asm/feature-fixups.h>
 
 #ifdef CONFIG_SMP
 	.section .bss
arch/powerpc/mm/hash_native_64.c +1 -0
index 1d049c78c82a..1baabc74c4ae 100644
@@ -30,6 +30,7 @@
 #include <asm/udbg.h>
 #include <asm/kexec.h>
 #include <asm/ppc-opcode.h>
+#include <asm/feature-fixups.h>
 
 #include <misc/cxl-base.h>
 
arch/powerpc/mm/slb_low.S +1 -0
index a83fbd2a4a24..4ac5057ad439 100644
@@ -22,6 +22,7 @@
 #include <asm/mmu.h>
 #include <asm/pgtable.h>
 #include <asm/firmware.h>
+#include <asm/feature-fixups.h>
 
 /*
  * This macro generates asm code to compute the VSID scramble
arch/powerpc/mm/tlb_low_64e.S +1 -0
index eb82d787d99a..7fd20c52a8ec 100644
@@ -22,6 +22,7 @@
 #include <asm/ppc-opcode.h>
 #include <asm/kvm_asm.h>
 #include <asm/kvm_booke_hv_asm.h>
+#include <asm/feature-fixups.h>
 
 #ifdef CONFIG_PPC_64K_PAGES
 #define VPTE_PMD_SHIFT	(PTE_INDEX_SIZE+1)
arch/powerpc/mm/tlb_nohash_low.S +1 -0
index 505a3d010c47..e066a658acac 100644
@@ -35,6 +35,7 @@
 #include <asm/processor.h>
 #include <asm/bug.h>
 #include <asm/asm-compat.h>
+#include <asm/feature-fixups.h>
 
 #if defined(CONFIG_40x)
 
arch/powerpc/platforms/powermac/cache.S +1 -0
index cc5347eb1662..27862feee4a5 100644
@@ -17,6 +17,7 @@
 #include <asm/processor.h>
 #include <asm/ppc_asm.h>
 #include <asm/cputable.h>
+#include <asm/feature-fixups.h>
 
 /*
  * Flush and disable all data caches (dL1, L2, L3). This is used
arch/powerpc/platforms/powermac/sleep.S +1 -0
index 1c2802fabd57..f89808b9713d 100644
@@ -18,6 +18,7 @@
 #include <asm/thread_info.h>
 #include <asm/asm-offsets.h>
 #include <asm/mmu.h>
+#include <asm/feature-fixups.h>
 
 #define MAGIC	0x4c617273	/* 'Lars' */
 
arch/powerpc/platforms/powernv/opal-wrappers.S +1 -0
index 4016e3c3d18b..3508be7d758a 100644
@@ -15,6 +15,7 @@
 #include <asm/asm-offsets.h>
 #include <asm/opal.h>
 #include <asm/asm-compat.h>
+#include <asm/feature-fixups.h>
 
 	.section	".text"
 
arch/powerpc/platforms/pseries/hvCall.S +1 -0
index c511a1743a44..d91412c591ef 100644
@@ -13,6 +13,7 @@
 #include <asm/ppc_asm.h>
 #include <asm/asm-offsets.h>
 #include <asm/ptrace.h>
+#include <asm/feature-fixups.h>
 
 	.section	".text"
 	
Signature · 1 line
2.13.3
#13 lore raw

PATCH v3 7/16 powerpc: remove superflous inclusions of asm/fixmap.h

In reply to Christophe Leroy

Files not using fixmap consts or functions don't need asm/fixmap.h

---
 arch/powerpc/include/asm/fixmap.h    | 2 --
 arch/powerpc/kernel/head_8xx.S       | 1 -
 arch/powerpc/mm/dump_hashpagetable.c | 1 -
 arch/powerpc/sysdev/cpm_common.c     | 1 -
 4 files changed, 5 deletions(-)
arch/powerpc/include/asm/fixmap.h +0 -2
index 6c40dfda5912..40efdf1d2d6e 100644
@@ -15,9 +15,7 @@
 #define _ASM_FIXMAP_H
 
 #ifndef __ASSEMBLY__
-#include <linux/kernel.h>
 #include <asm/page.h>
-#include <asm/pgtable.h>
 #ifdef CONFIG_HIGHMEM
 #include <linux/threads.h>
 #include <asm/kmap_types.h>
arch/powerpc/kernel/head_8xx.S +0 -1
index 6cab07e76732..95f6bdc0718f 100644
@@ -30,7 +30,6 @@
 #include <asm/ppc_asm.h>
 #include <asm/asm-offsets.h>
 #include <asm/ptrace.h>
-#include <asm/fixmap.h>
 #include <asm/export.h>
 
 #if CONFIG_TASK_SIZE <= 0x80000000 && CONFIG_PAGE_OFFSET >= 0x80000000
arch/powerpc/mm/dump_hashpagetable.c +0 -1
index 14cfb11b09d0..ddffb1513ddc 100644
@@ -19,7 +19,6 @@
 #include <linux/mm.h>
 #include <linux/sched.h>
 #include <linux/seq_file.h>
-#include <asm/fixmap.h>
 #include <asm/pgtable.h>
 #include <linux/const.h>
 #include <asm/page.h>
arch/powerpc/sysdev/cpm_common.c +0 -1
index b74508175b67..010975c3422f 100644
@@ -28,7 +28,6 @@
 #include <asm/udbg.h>
 #include <asm/io.h>
 #include <asm/cpm.h>
-#include <asm/fixmap.h>
 #include <soc/fsl/qe/qe.h>
 
 #include <mm/mmu_decl.h>
Signature · 1 line
2.13.3
#15 lore raw

PATCH v3 8/16 powerpc: declare set_breakpoint() static

In reply to Christophe Leroy

set_breakpoint() is only used in process.c so make it static

---
 arch/powerpc/include/asm/debug.h |  1 -
 arch/powerpc/kernel/process.c    | 14 +++++++-------
 2 files changed, 7 insertions(+), 8 deletions(-)
arch/powerpc/include/asm/debug.h +0 -1
index ce5da214ffe5..7756026b95ca 100644
@@ -45,7 +45,6 @@ static inline int debugger_break_match(struct pt_regs *regs) { return 0; }
 static inline int debugger_fault_handler(struct pt_regs *regs) { return 0; }
 #endif
 
-void set_breakpoint(struct arch_hw_breakpoint *brk);
 void __set_breakpoint(struct arch_hw_breakpoint *brk);
 bool ppc_breakpoint_available(void);
 #ifdef CONFIG_PPC_ADV_DEBUG_REGS
arch/powerpc/kernel/process.c +7 -7
index 9ef4aea9fffe..6061efb369e8 100644
@@ -716,6 +716,13 @@ void switch_booke_debug_regs(struct debug_reg *new_debug)
 EXPORT_SYMBOL_GPL(switch_booke_debug_regs);
 #else	/* !CONFIG_PPC_ADV_DEBUG_REGS */
 #ifndef CONFIG_HAVE_HW_BREAKPOINT
+static void set_breakpoint(struct arch_hw_breakpoint *brk)
+{
+	preempt_disable();
+	__set_breakpoint(brk);
+	preempt_enable();
+}
+
 static void set_debug_reg_defaults(struct thread_struct *thread)
 {
 	thread->hw_brk.address = 0;
@@ -828,13 +835,6 @@ void __set_breakpoint(struct arch_hw_breakpoint *brk)
 		WARN_ON_ONCE(1);
 }
 
-void set_breakpoint(struct arch_hw_breakpoint *brk)
-{
-	preempt_disable();
-	__set_breakpoint(brk);
-	preempt_enable();
-}
-
 /* Check if we have DAWR or DABR hardware */
 bool ppc_breakpoint_available(void)
 {
Signature · 1 line
2.13.3
#17 lore raw

PATCH v3 9/16 powerpc/book3s: Remove PPC_PIN_SIZE

In reply to Christophe Leroy

PPC_PIN_SIZE is specific to the 44x and is defined in mmu.h

---
 arch/powerpc/include/asm/book3s/32/pgtable.h | 5 -----
 arch/powerpc/include/asm/nohash/32/pgtable.h | 2 +-
 2 files changed, 1 insertion(+), 6 deletions(-)
arch/powerpc/include/asm/book3s/32/pgtable.h +0 -5
index 3c3e34240628..751cf931bb3f 100644
@@ -84,17 +84,12 @@
  * of RAM.  -- Cort
  */
 #define VMALLOC_OFFSET (0x1000000) /* 16M */
-#ifdef PPC_PIN_SIZE
-#define VMALLOC_START (((_ALIGN((long)high_memory, PPC_PIN_SIZE) + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1)))
-#else
 #define VMALLOC_START ((((long)high_memory + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1)))
-#endif
 #define VMALLOC_END	ioremap_bot
 
 #ifndef __ASSEMBLY__
 #include <linux/sched.h>
 #include <linux/threads.h>
-#include <asm/io.h>			/* For sub-arch specific PPC_PIN_SIZE */
 
 extern unsigned long ioremap_bot;
 
arch/powerpc/include/asm/nohash/32/pgtable.h +1 -1
index 7df2f3a66cc5..79805e0dad27 100644
@@ -8,7 +8,7 @@
 #ifndef __ASSEMBLY__
 #include <linux/sched.h>
 #include <linux/threads.h>
-#include <asm/io.h>			/* For sub-arch specific PPC_PIN_SIZE */
+#include <asm/mmu.h>			/* For sub-arch specific PPC_PIN_SIZE */
 #include <asm/asm-405.h>
 
 extern unsigned long ioremap_bot;
Signature · 1 line
2.13.3
#19 lore raw

PATCH v3 10/16 powerpc: fix includes in asm/processor.h

In reply to Christophe Leroy

Remove superflous includes and add missing ones

---
 arch/powerpc/include/asm/hw_breakpoint.h | 1 +
 arch/powerpc/include/asm/processor.h     | 5 ++---
 2 files changed, 3 insertions(+), 3 deletions(-)
arch/powerpc/include/asm/hw_breakpoint.h +1 -0
index 8e7b09703ca4..3637588d3f6d 100644
@@ -55,6 +55,7 @@ struct arch_hw_breakpoint {
 struct perf_event;
 struct pmu;
 struct perf_sample_data;
+struct task_struct;
 
 #define HW_BREAKPOINT_ALIGN 0x7
 
arch/powerpc/include/asm/processor.h +2 -3
index 5debe337ea9d..52fadded5c1e 100644
@@ -39,10 +39,9 @@
 #endif /* CONFIG_PPC64 */
 
 #ifndef __ASSEMBLY__
-#include <linux/compiler.h>
-#include <linux/cache.h>
+#include <linux/types.h>
+#include <asm/thread_info.h>
 #include <asm/ptrace.h>
-#include <asm/types.h>
 #include <asm/hw_breakpoint.h>
 
 /* We do _not_ want to define new machine types at all, those must die
Signature · 1 line
2.13.3
#21 lore raw

PATCH v3 11/16 powerpc/nohash: fix hash related comments in pgtable.h

In reply to Christophe Leroy
---
 arch/powerpc/include/asm/nohash/32/pgtable.h |  4 ----
 arch/powerpc/include/asm/nohash/64/pgtable.h | 18 ++++--------------
 2 files changed, 4 insertions(+), 18 deletions(-)
arch/powerpc/include/asm/nohash/32/pgtable.h +0 -4
index 79805e0dad27..a507a65b0866 100644
@@ -223,10 +223,6 @@ static inline unsigned long long pte_update(pte_t *p,
 }
 #endif /* CONFIG_PTE_64BIT */
 
-/*
- * 2.6 calls this without flushing the TLB entry; this is wrong
- * for our hash-based implementation, we fix that up here.
- */
 #define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG
 static inline int __ptep_test_and_clear_young(unsigned int context, unsigned long addr, pte_t *ptep)
 {
arch/powerpc/include/asm/nohash/64/pgtable.h +4 -14
index fe05b3e03cf1..7cd6809f4d33 100644
@@ -3,7 +3,7 @@
 #define _ASM_POWERPC_NOHASH_64_PGTABLE_H
 /*
  * This file contains the functions and defines necessary to modify and use
- * the ppc64 hashed page table.
+ * the ppc64 non-hashed page table.
  */
 
 #include <asm/nohash/64/pgtable-4k.h>
@@ -38,7 +38,7 @@
 
 /*
  * The vmalloc space starts at the beginning of that region, and
- * occupies half of it on hash CPUs and a quarter of it on Book3E
+ * occupies a quarter of it on Book3E
  * (we keep a quarter for the virtual memmap)
  */
 #define VMALLOC_START	KERN_VIRT_START
@@ -78,7 +78,7 @@
 
 /*
  * Defines the address of the vmemap area, in its own region on
- * hash table CPUs and after the vmalloc space on Book3E
+ * after the vmalloc space on Book3E
  */
 #define VMEMMAP_BASE		VMALLOC_END
 #define VMEMMAP_END		KERN_IO_START
@@ -248,14 +248,6 @@ static inline void huge_ptep_set_wrprotect(struct mm_struct *mm,
 	pte_update(mm, addr, ptep, _PAGE_RW, 0, 1);
 }
 
-/*
- * We currently remove entries from the hashtable regardless of whether
- * the entry was young or dirty. The generic routines only flush if the
- * entry was young or dirty which is not good enough.
- *
- * We should be more intelligent about this but for the moment we override
- * these functions and force a tlb flush unconditionally
- */
 #define __HAVE_ARCH_PTEP_CLEAR_YOUNG_FLUSH
 #define ptep_clear_flush_young(__vma, __address, __ptep)		\
 ({									\
@@ -279,9 +271,7 @@ static inline void pte_clear(struct mm_struct *mm, unsigned long addr,
 }
 
 
-/* Set the dirty and/or accessed bits atomically in a linux PTE, this
- * function doesn't need to flush the hash entry
- */
+/* Set the dirty and/or accessed bits atomically in a linux PTE */
 static inline void __ptep_set_access_flags(struct vm_area_struct *vma,
 					   pte_t *ptep, pte_t entry,
 					   unsigned long address,
Signature · 1 line
2.13.3
#23 lore raw

PATCH v3 12/16 powerpc/44x: remove page.h from mmu-44x.h

In reply to Christophe Leroy

mmu-44x.h doesn't need asm/page.h if PAGE_SHIFT are replaced by CONFIG_PPC_XX_PAGES

---
 arch/powerpc/include/asm/mmu-44x.h | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
arch/powerpc/include/asm/mmu-44x.h +4 -5
index 9bdbe1d1c9b9..295b3dbb2698 100644
@@ -5,7 +5,6 @@
  * PPC440 support
  */
 
-#include <asm/page.h>
 #include <asm/asm-const.h>
 
 #define PPC44x_MMUCR_TID	0x000000ff
@@ -125,19 +124,19 @@ typedef struct {
 /* Size of the TLBs used for pinning in lowmem */
 #define PPC_PIN_SIZE	(1 << 28)	/* 256M */
 
-#if (PAGE_SHIFT == 12)
+#if defined(CONFIG_PPC_4K_PAGES)
 #define PPC44x_TLBE_SIZE	PPC44x_TLB_4K
 #define PPC47x_TLBE_SIZE	PPC47x_TLB0_4K
 #define mmu_virtual_psize	MMU_PAGE_4K
-#elif (PAGE_SHIFT == 14)
+#elif defined(CONFIG_PPC_16K_PAGES)
 #define PPC44x_TLBE_SIZE	PPC44x_TLB_16K
 #define PPC47x_TLBE_SIZE	PPC47x_TLB0_16K
 #define mmu_virtual_psize	MMU_PAGE_16K
-#elif (PAGE_SHIFT == 16)
+#elif defined(CONFIG_PPC_64K_PAGES)
 #define PPC44x_TLBE_SIZE	PPC44x_TLB_64K
 #define PPC47x_TLBE_SIZE	PPC47x_TLB0_64K
 #define mmu_virtual_psize	MMU_PAGE_64K
-#elif (PAGE_SHIFT == 18)
+#elif defined(CONFIG_PPC_256K_PAGES)
 #define PPC44x_TLBE_SIZE	PPC44x_TLB_256K
 #define mmu_virtual_psize	MMU_PAGE_256K
 #else
Signature · 1 line
2.13.3
#25 lore raw

PATCH v3 13/16 powerpc: split reg.h in two parts

In reply to Christophe Leroy

Move all macros involving feature-fixups in a new file reg-ftr.h

---
 arch/powerpc/include/asm/exception-64s.h |  1 +
 arch/powerpc/include/asm/reg-ftr.h       | 71 ++++++++++++++++++++++++++++++++
 arch/powerpc/include/asm/reg.h           | 42 -------------------
 arch/powerpc/kernel/entry_64.S           |  1 +
 arch/powerpc/kernel/exceptions-64s.S     |  1 +
 arch/powerpc/kernel/head_64.S            |  1 +
 arch/powerpc/kernel/idle_book3s.S        |  1 +
 arch/powerpc/kernel/paca.c               |  1 +
 arch/powerpc/kernel/process.c            |  1 +
 arch/powerpc/kernel/tm.S                 |  1 +
 arch/powerpc/kvm/book3s_hv_rmhandlers.S  |  1 +
 arch/powerpc/kvm/book3s_rmhandlers.S     |  1 +
 arch/powerpc/kvm/book3s_segment.S        |  1 +
 arch/powerpc/kvm/tm.S                    |  1 +
 14 files changed, 83 insertions(+), 42 deletions(-)
 create mode 100644 arch/powerpc/include/asm/reg-ftr.h
arch/powerpc/include/asm/exception-64s.h +1 -0
index 1f2efc1a9769..9d748eaeb9ec 100644
@@ -36,6 +36,7 @@
  */
 #include <asm/head-64.h>
 #include <asm/feature-fixups.h>
+#include <asm/reg-ftr.h>
 
 /* PACA save area offsets (exgen, exmc, etc) */
 #define EX_R9		0
arch/powerpc/include/asm/reg-ftr.h new file +71 -0

71 lines not on this page · raw message

arch/powerpc/include/asm/reg.h +0 -42

66 lines not on this page · raw message

arch/powerpc/kernel/entry_64.S +1 -0
index 31068be6be59..5651d50d8d10 100644
@@ -45,6 +45,7 @@
 #include <asm/exception-64e.h>
 #endif
 #include <asm/feature-fixups.h>
+#include <asm/reg-ftr.h>
 
 /*
  * System calls.
arch/powerpc/kernel/exceptions-64s.S +1 -0
index a3c79aed2f61..06907e5e16a7 100644
@@ -19,6 +19,7 @@
 #include <asm/cpuidle.h>
 #include <asm/head-64.h>
 #include <asm/feature-fixups.h>
+#include <asm/reg-ftr.h>
 
 /*
  * There are a few constraints to be concerned with.
arch/powerpc/kernel/head_64.S +1 -0
index 4898e9491a1c..fb959742aaa2 100644
@@ -25,6 +25,7 @@
 #include <linux/threads.h>
 #include <linux/init.h>
 #include <asm/reg.h>
+#include <asm/reg-ftr.h>
 #include <asm/page.h>
 #include <asm/mmu.h>
 #include <asm/ppc_asm.h>
arch/powerpc/kernel/idle_book3s.S +1 -0
index 0cb6ffe992c2..c87aaacda6d7 100644
@@ -25,6 +25,7 @@
 #include <asm/mmu.h>
 #include <asm/asm-compat.h>
 #include <asm/feature-fixups.h>
+#include <asm/reg-ftr.h>
 
 #undef DEBUG
 
arch/powerpc/kernel/paca.c +1 -0
index 0ee3e6d50f28..75ae2a48d02d 100644
@@ -17,6 +17,7 @@
 #include <asm/sections.h>
 #include <asm/pgtable.h>
 #include <asm/kexec.h>
+#include <asm/reg-ftr.h>
 
 #include "setup.h"
 
arch/powerpc/kernel/process.c +1 -0
index 6061efb369e8..402a0ce96d6a 100644
@@ -65,6 +65,7 @@
 #include <asm/livepatch.h>
 #include <asm/cpu_has_feature.h>
 #include <asm/asm-prototypes.h>
+#include <asm/reg-ftr.h>
 
 #include <linux/kprobes.h>
 #include <linux/kdebug.h>
arch/powerpc/kernel/tm.S +1 -0
index c0dcdd57cd7f..ac833198f308 100644
@@ -11,6 +11,7 @@
 #include <asm/ppc-opcode.h>
 #include <asm/ptrace.h>
 #include <asm/reg.h>
+#include <asm/reg-ftr.h>
 #include <asm/bug.h>
 #include <asm/export.h>
 #include <asm/feature-fixups.h>
arch/powerpc/kvm/book3s_hv_rmhandlers.S +1 -0
index ac53be00039a..2d01fcf44991 100644
@@ -20,6 +20,7 @@
 #include <asm/ppc_asm.h>
 #include <asm/kvm_asm.h>
 #include <asm/reg.h>
+#include <asm/reg-ftr.h>
 #include <asm/mmu.h>
 #include <asm/page.h>
 #include <asm/ptrace.h>
arch/powerpc/kvm/book3s_rmhandlers.S +1 -0
index b0089e04c8c8..17a08780fb63 100644
@@ -20,6 +20,7 @@
 #include <asm/ppc_asm.h>
 #include <asm/kvm_asm.h>
 #include <asm/reg.h>
+#include <asm/reg-ftr.h>
 #include <asm/mmu.h>
 #include <asm/page.h>
 #include <asm/asm-offsets.h>
arch/powerpc/kvm/book3s_segment.S +1 -0
index e5c542a7c5ac..6cb740cd8af4 100644
@@ -21,6 +21,7 @@
 
 #include <asm/asm-compat.h>
 #include <asm/feature-fixups.h>
+#include <asm/reg-ftr.h>
 
 #if defined(CONFIG_PPC_BOOK3S_64)
 
arch/powerpc/kvm/tm.S +1 -0
index 90e330f21356..112b8dee5a6d 100644
@@ -15,6 +15,7 @@
  */
 
 #include <asm/reg.h>
+#include <asm/reg-ftr.h>
 #include <asm/ppc_asm.h>
 #include <asm/asm-offsets.h>
 #include <asm/export.h>
Signature · 1 line
2.13.3
#26 lore raw

PATCH v3 14/16 powerpc: Split synch.h in two parts

In reply to Christophe Leroy

move feature-fixups related stuff from synch.h to synch-ftr.h

---
 arch/powerpc/include/asm/atomic.h                 |  1 +
 arch/powerpc/include/asm/barrier.h                |  1 +
 arch/powerpc/include/asm/bitops.h                 |  1 +
 arch/powerpc/include/asm/cmpxchg.h                |  1 +
 arch/powerpc/include/asm/spinlock.h               |  1 +
 arch/powerpc/include/asm/{synch.h => synch-ftr.h} | 22 +++--------------
 arch/powerpc/include/asm/synch.h                  | 30 -----------------------
 arch/powerpc/lib/feature-fixups-test.S            |  1 +
 8 files changed, 9 insertions(+), 49 deletions(-)
 copy arch/powerpc/include/asm/{synch.h => synch-ftr.h} (66%)
arch/powerpc/include/asm/atomic.h +1 -0
index cbdb0b7e60a3..49a929ec5435 100644
@@ -11,6 +11,7 @@
 #include <asm/cmpxchg.h>
 #include <asm/barrier.h>
 #include <asm/asm-405.h>
+#include <asm/synch-ftr.h>
 
 #define ATOMIC_INIT(i)		{ (i) }
 
arch/powerpc/include/asm/barrier.h +1 -0
index de1316874e45..d90a1463967b 100644
@@ -6,6 +6,7 @@
 #define _ASM_POWERPC_BARRIER_H
 
 #include <asm/asm-const.h>
+#include <asm/synch-ftr.h>
 
 /*
  * Memory barrier.
arch/powerpc/include/asm/bitops.h +1 -0
index ff71566dadee..b8bf2f5b75ce 100644
@@ -44,6 +44,7 @@
 
 #include <linux/compiler.h>
 #include <asm/asm-compat.h>
+#include <asm/synch-ftr.h>
 #include <asm/synch.h>
 #include <asm/asm-405.h>
 
arch/powerpc/include/asm/cmpxchg.h +1 -0
index 27183871eb3b..d94a67a1a574 100644
@@ -4,6 +4,7 @@
 
 #ifdef __KERNEL__
 #include <linux/compiler.h>
+#include <asm/synch-ftr.h>
 #include <asm/synch.h>
 #include <linux/bug.h>
 #include <asm/asm-405.h>
arch/powerpc/include/asm/spinlock.h +1 -0
index 685c72310f5d..182f950a4c5d 100644
@@ -24,6 +24,7 @@
 #include <asm/paca.h>
 #include <asm/hvcall.h>
 #endif
+#include <asm/synch-ftr.h>
 #include <asm/synch.h>
 #include <asm/ppc-opcode.h>
 #include <asm/asm-405.h>
arch/powerpc/include/asm/synch-ftr.h renamed from arch/powerpc/include/asm/synch.h +3 -19
similarity index 66%
copy from arch/powerpc/include/asm/synch.h
copy to arch/powerpc/include/asm/synch-ftr.h
index aca70fb43147..f86c536bd351 100644
@@ -1,27 +1,11 @@
 /* SPDX-License-Identifier: GPL-2.0 */
-#ifndef _ASM_POWERPC_SYNCH_H 
-#define _ASM_POWERPC_SYNCH_H 
+#ifndef _ASM_POWERPC_SYNCH_FTR_H
+#define _ASM_POWERPC_SYNCH_FTR_H
 #ifdef __KERNEL__
 
 #include <asm/feature-fixups.h>
 #include <asm/asm-const.h>
 
-#ifndef __ASSEMBLY__
-extern unsigned int __start___lwsync_fixup, __stop___lwsync_fixup;
-extern void do_lwsync_fixups(unsigned long value, void *fixup_start,
-			     void *fixup_end);
-
-static inline void eieio(void)
-{
-	__asm__ __volatile__ ("eieio" : : : "memory");
-}
-
-static inline void isync(void)
-{
-	__asm__ __volatile__ ("isync" : : : "memory");
-}
-#endif /* __ASSEMBLY__ */
-
 #if defined(__powerpc64__)
 #    define LWSYNC	lwsync
 #elif defined(CONFIG_E500)
@@ -50,4 +34,4 @@ static inline void isync(void)
 #endif
 
 #endif /* __KERNEL__ */
-#endif	/* _ASM_POWERPC_SYNCH_H */
+#endif	/* _ASM_POWERPC_SYNCH_FTR_H */
arch/powerpc/include/asm/synch.h +0 -30
index aca70fb43147..48b23168ea9e 100644
@@ -3,9 +3,6 @@
 #define _ASM_POWERPC_SYNCH_H 
 #ifdef __KERNEL__
 
-#include <asm/feature-fixups.h>
-#include <asm/asm-const.h>
-
 #ifndef __ASSEMBLY__
 extern unsigned int __start___lwsync_fixup, __stop___lwsync_fixup;
 extern void do_lwsync_fixups(unsigned long value, void *fixup_start,
@@ -22,32 +19,5 @@ static inline void isync(void)
 }
 #endif /* __ASSEMBLY__ */
 
-#if defined(__powerpc64__)
-#    define LWSYNC	lwsync
-#elif defined(CONFIG_E500)
-#    define LWSYNC					\
-	START_LWSYNC_SECTION(96);			\
-	sync;						\
-	MAKE_LWSYNC_SECTION_ENTRY(96, __lwsync_fixup);
-#else
-#    define LWSYNC	sync
-#endif
-
-#ifdef CONFIG_SMP
-#define __PPC_ACQUIRE_BARRIER				\
-	START_LWSYNC_SECTION(97);			\
-	isync;						\
-	MAKE_LWSYNC_SECTION_ENTRY(97, __lwsync_fixup);
-#define PPC_ACQUIRE_BARRIER	 "\n" stringify_in_c(__PPC_ACQUIRE_BARRIER)
-#define PPC_RELEASE_BARRIER	 stringify_in_c(LWSYNC) "\n"
-#define PPC_ATOMIC_ENTRY_BARRIER "\n" stringify_in_c(sync) "\n"
-#define PPC_ATOMIC_EXIT_BARRIER	 "\n" stringify_in_c(sync) "\n"
-#else
-#define PPC_ACQUIRE_BARRIER
-#define PPC_RELEASE_BARRIER
-#define PPC_ATOMIC_ENTRY_BARRIER
-#define PPC_ATOMIC_EXIT_BARRIER
-#endif
-
 #endif /* __KERNEL__ */
 #endif	/* _ASM_POWERPC_SYNCH_H */
arch/powerpc/lib/feature-fixups-test.S +1 -0
index ee7c5fd5fc64..8c781b2e467b 100644
@@ -10,6 +10,7 @@
 
 #include <asm/feature-fixups.h>
 #include <asm/ppc_asm.h>
+#include <asm/synch-ftr.h>
 #include <asm/synch.h>
 #include <asm/asm-compat.h>
 
Signature · 1 line
2.13.3
#27 lore raw

PATCH v3 15/16 powerpc: remove unnecessary inclusion of asm/tlbflush.h

In reply to Christophe Leroy

asm/tlbflush.h is only needed for:
- using functions xxx_flush_tlb_xxx()
- using MMU_NO_CONTEXT
- including asm-generic/pgtable.h

---
 arch/powerpc/include/asm/highmem.h    | 2 +-
 arch/powerpc/include/asm/tlb.h        | 1 -
 arch/powerpc/kvm/book3s.c             | 1 -
 arch/powerpc/kvm/book3s_32_mmu.c      | 1 -
 arch/powerpc/kvm/book3s_64_mmu.c      | 1 -
 arch/powerpc/kvm/book3s_64_mmu_hv.c   | 1 -
 arch/powerpc/kvm/book3s_64_vio.c      | 1 -
 arch/powerpc/kvm/book3s_64_vio_hv.c   | 1 -
 arch/powerpc/kvm/book3s_hv.c          | 1 -
 arch/powerpc/kvm/book3s_hv_rm_mmu.c   | 1 -
 arch/powerpc/kvm/book3s_pr.c          | 1 -
 arch/powerpc/kvm/e500.c               | 1 -
 arch/powerpc/kvm/e500mc.c             | 1 -
 arch/powerpc/kvm/powerpc.c            | 1 -
 arch/powerpc/mm/fault.c               | 1 -
 arch/powerpc/mm/hash_native_64.c      | 1 -
 arch/powerpc/mm/hash_utils_64.c       | 1 -
 arch/powerpc/mm/mmu_context_hash32.c  | 1 -
 arch/powerpc/mm/mmu_decl.h            | 1 -
 arch/powerpc/mm/subpage-prot.c        | 1 -
 arch/powerpc/platforms/pseries/lpar.c | 1 -
 arch/powerpc/sysdev/cpm1.c            | 1 -
 22 files changed, 1 insertion(+), 22 deletions(-)
arch/powerpc/include/asm/highmem.h +1 -1
index cec820f961da..a4b65b186ec6 100644
@@ -25,7 +25,7 @@
 
 #include <linux/interrupt.h>
 #include <asm/kmap_types.h>
-#include <asm/tlbflush.h>
+#include <asm/cacheflush.h>
 #include <asm/page.h>
 #include <asm/fixmap.h>
 
arch/powerpc/include/asm/tlb.h +0 -1
index 9138baccebb0..6d2ba7c779dc 100644
@@ -17,7 +17,6 @@
 #include <asm/pgtable.h>
 #endif
 #include <asm/pgalloc.h>
-#include <asm/tlbflush.h>
 #ifndef __powerpc64__
 #include <asm/page.h>
 #include <asm/mmu.h>
arch/powerpc/kvm/book3s.c +0 -1
index edaf4720d156..87348e498c89 100644
@@ -28,7 +28,6 @@
 #include <asm/reg.h>
 #include <asm/cputable.h>
 #include <asm/cacheflush.h>
-#include <asm/tlbflush.h>
 #include <linux/uaccess.h>
 #include <asm/io.h>
 #include <asm/kvm_ppc.h>
arch/powerpc/kvm/book3s_32_mmu.c +0 -1
index 45c8ea4a0487..612169988a3d 100644
@@ -23,7 +23,6 @@
 #include <linux/kvm_host.h>
 #include <linux/highmem.h>
 
-#include <asm/tlbflush.h>
 #include <asm/kvm_ppc.h>
 #include <asm/kvm_book3s.h>
 
arch/powerpc/kvm/book3s_64_mmu.c +0 -1
index cf9d686e8162..c92dd25bed23 100644
@@ -23,7 +23,6 @@
 #include <linux/kvm_host.h>
 #include <linux/highmem.h>
 
-#include <asm/tlbflush.h>
 #include <asm/kvm_ppc.h>
 #include <asm/kvm_book3s.h>
 #include <asm/book3s/64/mmu-hash.h>
arch/powerpc/kvm/book3s_64_mmu_hv.c +0 -1
index 7f3a8cf5d66f..3c0e8fb2b773 100644
@@ -29,7 +29,6 @@
 #include <linux/file.h>
 #include <linux/debugfs.h>
 
-#include <asm/tlbflush.h>
 #include <asm/kvm_ppc.h>
 #include <asm/kvm_book3s.h>
 #include <asm/book3s/64/mmu-hash.h>
arch/powerpc/kvm/book3s_64_vio.c +0 -1
index d066e37551ec..b3c1935229b0 100644
@@ -31,7 +31,6 @@
 #include <linux/iommu.h>
 #include <linux/file.h>
 
-#include <asm/tlbflush.h>
 #include <asm/kvm_ppc.h>
 #include <asm/kvm_book3s.h>
 #include <asm/book3s/64/mmu-hash.h>
arch/powerpc/kvm/book3s_64_vio_hv.c +0 -1
index 80d50d67b8c5..3315a56b6737 100644
@@ -28,7 +28,6 @@
 #include <linux/list.h>
 #include <linux/stringify.h>
 
-#include <asm/tlbflush.h>
 #include <asm/kvm_ppc.h>
 #include <asm/kvm_book3s.h>
 #include <asm/book3s/64/mmu-hash.h>
arch/powerpc/kvm/book3s_hv.c +0 -1
index de686b340f4a..b4a5cc8525a0 100644
@@ -53,7 +53,6 @@
 #include <asm/disassemble.h>
 #include <asm/cputable.h>
 #include <asm/cacheflush.h>
-#include <asm/tlbflush.h>
 #include <linux/uaccess.h>
 #include <asm/io.h>
 #include <asm/kvm_ppc.h>
arch/powerpc/kvm/book3s_hv_rm_mmu.c +0 -1
index 1f22d9e977d4..a67cf1cdeda4 100644
@@ -14,7 +14,6 @@
 #include <linux/module.h>
 #include <linux/log2.h>
 
-#include <asm/tlbflush.h>
 #include <asm/trace.h>
 #include <asm/kvm_ppc.h>
 #include <asm/kvm_book3s.h>
arch/powerpc/kvm/book3s_pr.c +0 -1
index c3b8006f0eac..47ee43bbd696 100644
@@ -27,7 +27,6 @@
 #include <asm/reg.h>
 #include <asm/cputable.h>
 #include <asm/cacheflush.h>
-#include <asm/tlbflush.h>
 #include <linux/uaccess.h>
 #include <asm/io.h>
 #include <asm/kvm_ppc.h>
arch/powerpc/kvm/e500.c +0 -1
index f9f6468f4171..afd3c255a427 100644
@@ -21,7 +21,6 @@
 
 #include <asm/reg.h>
 #include <asm/cputable.h>
-#include <asm/tlbflush.h>
 #include <asm/kvm_ppc.h>
 
 #include "../mm/mmu_decl.h"
arch/powerpc/kvm/e500mc.c +0 -1
index d0b6b5788afc..d31645491a93 100644
@@ -21,7 +21,6 @@
 
 #include <asm/reg.h>
 #include <asm/cputable.h>
-#include <asm/tlbflush.h>
 #include <asm/kvm_ppc.h>
 #include <asm/dbell.h>
 
arch/powerpc/kvm/powerpc.c +0 -1
index 0e8c20c5eaac..3ccc386b380d 100644
@@ -33,7 +33,6 @@
 #include <asm/cputable.h>
 #include <linux/uaccess.h>
 #include <asm/kvm_ppc.h>
-#include <asm/tlbflush.h>
 #include <asm/cputhreads.h>
 #include <asm/irqflags.h>
 #include <asm/iommu.h>
arch/powerpc/mm/fault.c +0 -1
index b1ca7a0974e3..7d262c6437c4 100644
@@ -42,7 +42,6 @@
 #include <asm/pgtable.h>
 #include <asm/mmu.h>
 #include <asm/mmu_context.h>
-#include <asm/tlbflush.h>
 #include <asm/siginfo.h>
 #include <asm/debug.h>
 
arch/powerpc/mm/hash_native_64.c +0 -1
index 1baabc74c4ae..4958f2a4f1d5 100644
@@ -23,7 +23,6 @@
 #include <asm/mmu.h>
 #include <asm/mmu_context.h>
 #include <asm/pgtable.h>
-#include <asm/tlbflush.h>
 #include <asm/trace.h>
 #include <asm/tlb.h>
 #include <asm/cputable.h>
arch/powerpc/mm/hash_utils_64.c +0 -1
index 8318716e5075..af6c70dfe140 100644
@@ -48,7 +48,6 @@
 #include <linux/uaccess.h>
 #include <asm/machdep.h>
 #include <asm/prom.h>
-#include <asm/tlbflush.h>
 #include <asm/io.h>
 #include <asm/eeh.h>
 #include <asm/tlb.h>
arch/powerpc/mm/mmu_context_hash32.c +0 -1
index aa5a7fd89461..921c1e33e941 100644
@@ -27,7 +27,6 @@
 #include <linux/export.h>
 
 #include <asm/mmu_context.h>
-#include <asm/tlbflush.h>
 
 /*
  * On 32-bit PowerPC 6xx/7xx/7xxx CPUs, we use a set of 16 VSIDs
arch/powerpc/mm/mmu_decl.h +0 -1
index c4c0a09a7775..e5d779eed181 100644
@@ -19,7 +19,6 @@
  *
  */
 #include <linux/mm.h>
-#include <asm/tlbflush.h>
 #include <asm/mmu.h>
 
 #ifdef CONFIG_PPC_MMU_NOHASH
arch/powerpc/mm/subpage-prot.c +0 -1
index 9d16ee251fc0..3327551c8b47 100644
@@ -17,7 +17,6 @@
 
 #include <asm/pgtable.h>
 #include <linux/uaccess.h>
-#include <asm/tlbflush.h>
 
 /*
  * Free all pages allocated for subpage protection maps and pointers.
arch/powerpc/platforms/pseries/lpar.c +0 -1
index 5a392e40f3d2..bc50f1dcc430 100644
@@ -36,7 +36,6 @@
 #include <asm/machdep.h>
 #include <asm/mmu_context.h>
 #include <asm/iommu.h>
-#include <asm/tlbflush.h>
 #include <asm/tlb.h>
 #include <asm/prom.h>
 #include <asm/cputable.h>
arch/powerpc/sysdev/cpm1.c +0 -1
index 5240d3a74a10..4f8dcf124828 100644
@@ -38,7 +38,6 @@
 #include <asm/8xx_immap.h>
 #include <asm/cpm1.h>
 #include <asm/io.h>
-#include <asm/tlbflush.h>
 #include <asm/rheap.h>
 #include <asm/prom.h>
 #include <asm/cpm.h>
Signature · 1 line
2.13.3
#29 lore raw

PATCH v3 16/16 powerpc: split asm/tlbflush.h

In reply to Christophe Leroy

Split asm/tlbflush.h into:
asm/nohash/tlbflush.h
asm/book3s/32/tlbflush.h
asm/book3s/64/tlbflush.h (already existing)

---
 arch/powerpc/include/asm/book3s/32/tlbflush.h    | 25 +++++++
 arch/powerpc/include/asm/book3s/tlbflush.h       | 11 +++
 arch/powerpc/include/asm/{ => nohash}/tlbflush.h | 42 ++----------
 arch/powerpc/include/asm/tlbflush.h              | 86 ++----------------------
 4 files changed, 45 insertions(+), 119 deletions(-)
 create mode 100644 arch/powerpc/include/asm/book3s/32/tlbflush.h
 create mode 100644 arch/powerpc/include/asm/book3s/tlbflush.h
 copy arch/powerpc/include/asm/{ => nohash}/tlbflush.h (57%)
arch/powerpc/include/asm/book3s/32/tlbflush.h new file +25 -0
new file mode 100644
index 000000000000..068085b709fb
@@ -0,0 +1,25 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef _ASM_POWERPC_BOOK3S_32_TLBFLUSH_H
+#define _ASM_POWERPC_BOOK3S_32_TLBFLUSH_H
+
+#define MMU_NO_CONTEXT      (0)
+/*
+ * TLB flushing for "classic" hash-MMU 32-bit CPUs, 6xx, 7xx, 7xxx
+ */
+extern void flush_tlb_mm(struct mm_struct *mm);
+extern void flush_tlb_page(struct vm_area_struct *vma, unsigned long vmaddr);
+extern void flush_tlb_page_nohash(struct vm_area_struct *vma, unsigned long addr);
+extern void flush_tlb_range(struct vm_area_struct *vma, unsigned long start,
+			    unsigned long end);
+extern void flush_tlb_kernel_range(unsigned long start, unsigned long end);
+static inline void local_flush_tlb_page(struct vm_area_struct *vma,
+					unsigned long vmaddr)
+{
+	flush_tlb_page(vma, vmaddr);
+}
+static inline void local_flush_tlb_mm(struct mm_struct *mm)
+{
+	flush_tlb_mm(mm);
+}
+
+#endif /* _ASM_POWERPC_TLBFLUSH_H */
arch/powerpc/include/asm/book3s/tlbflush.h new file +11 -0
new file mode 100644
index 000000000000..dec11de41055
@@ -0,0 +1,11 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef _ASM_POWERPC_BOOK3S_TLBFLUSH_H
+#define _ASM_POWERPC_BOOK3S_TLBFLUSH_H
+
+#ifdef CONFIG_PPC64
+#include <asm/book3s/64/tlbflush.h>
+#else
+#include <asm/book3s/32/tlbflush.h>
+#endif
+
+#endif /* _ASM_POWERPC_BOOK3S_TLBFLUSH_H */
arch/powerpc/include/asm/nohash/tlbflush.h renamed from arch/powerpc/include/asm/tlbflush.h +4 -38

56 lines not on this page · raw message

arch/powerpc/include/asm/tlbflush.h +5 -81

92 lines not on this page · raw message

Signature · 1 line
2.13.3