aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/include/asm
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-06-10 21:54:22 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-06-10 21:54:22 -0400
commitc5aec4c76af1a2d89ee2f2d4d5463b2ad2d85de5 (patch)
tree628ae2d9370a6739fd98d8d2f055b46c87ab9316 /arch/powerpc/include/asm
parent2937f5efa5754754daf46de745f67350f7f06ec2 (diff)
parent0c0a3e5a100bbc4aaedd140e82b429227a76701b (diff)
Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc
Pull powerpc updates from Ben Herrenschmidt: "Here is the bulk of the powerpc changes for this merge window. It got a bit delayed in part because I wasn't paying attention, and in part because I discovered I had a core PCI change without a PCI maintainer ack in it. Bjorn eventually agreed it was ok to merge it though we'll probably improve it later and I didn't want to rebase to add his ack. There is going to be a bit more next week, essentially fixes that I still want to sort through and test. The biggest item this time is the support to build the ppc64 LE kernel with our new v2 ABI. We previously supported v2 userspace but the kernel itself was a tougher nut to crack. This is now sorted mostly thanks to Anton and Rusty. We also have a fairly big series from Cedric that add support for 64-bit LE zImage boot wrapper. This was made harder by the fact that traditionally our zImage wrapper was always 32-bit, but our new LE toolchains don't really support 32-bit anymore (it's somewhat there but not really "supported") so we didn't want to rely on it. This meant more churn that just endian fixes. This brings some more LE bits as well, such as the ability to run in LE mode without a hypervisor (ie. under OPAL firmware) by doing the right OPAL call to reinitialize the CPU to take HV interrupts in the right mode and the usual pile of endian fixes. There's another series from Gavin adding EEH improvements (one day we *will* have a release with less than 20 EEH patches, I promise!). Another highlight is the support for the "Split core" functionality on P8 by Michael. This allows a P8 core to be split into "sub cores" of 4 threads which allows the subcores to run different guests under KVM (the HW still doesn't support a partition per thread). And then the usual misc bits and fixes ..." [ Further delayed by gmail deciding that BenH is a dirty spammer. Google knows. ] * 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc: (155 commits) powerpc/powernv: Add missing include to LPC code selftests/powerpc: Test the THP bug we fixed in the previous commit powerpc/mm: Check paca psize is up to date for huge mappings powerpc/powernv: Pass buffer size to OPAL validate flash call powerpc/pseries: hcall functions are exported to modules, need _GLOBAL_TOC() powerpc: Exported functions __clear_user and copy_page use r2 so need _GLOBAL_TOC() powerpc/powernv: Set memory_block_size_bytes to 256MB powerpc: Allow ppc_md platform hook to override memory_block_size_bytes powerpc/powernv: Fix endian issues in memory error handling code powerpc/eeh: Skip eeh sysfs when eeh is disabled powerpc: 64bit sendfile is capped at 2GB powerpc/powernv: Provide debugfs access to the LPC bus via OPAL powerpc/serial: Use saner flags when creating legacy ports powerpc: Add cpu family documentation powerpc/xmon: Fix up xmon format strings powerpc/powernv: Add calls to support little endian host powerpc: Document sysfs DSCR interface powerpc: Fix regression of per-CPU DSCR setting powerpc: Split __SYSFS_SPRSETUP macro arch: powerpc/fadump: Cleaning up inconsistent NULL checks ...
Diffstat (limited to 'arch/powerpc/include/asm')
-rw-r--r--arch/powerpc/include/asm/code-patching.h40
-rw-r--r--arch/powerpc/include/asm/context_tracking.h4
-rw-r--r--arch/powerpc/include/asm/cputhreads.h7
-rw-r--r--arch/powerpc/include/asm/debug.h3
-rw-r--r--arch/powerpc/include/asm/eeh.h46
-rw-r--r--arch/powerpc/include/asm/elf.h2
-rw-r--r--arch/powerpc/include/asm/exception-64e.h6
-rw-r--r--arch/powerpc/include/asm/exception-64s.h2
-rw-r--r--arch/powerpc/include/asm/ftrace.h2
-rw-r--r--arch/powerpc/include/asm/hw_breakpoint.h2
-rw-r--r--arch/powerpc/include/asm/irqflags.h8
-rw-r--r--arch/powerpc/include/asm/kprobes.h5
-rw-r--r--arch/powerpc/include/asm/kvm_ppc.h7
-rw-r--r--arch/powerpc/include/asm/linkage.h2
-rw-r--r--arch/powerpc/include/asm/machdep.h8
-rw-r--r--arch/powerpc/include/asm/module.h4
-rw-r--r--arch/powerpc/include/asm/opal.h18
-rw-r--r--arch/powerpc/include/asm/paca.h3
-rw-r--r--arch/powerpc/include/asm/ppc-pci.h1
-rw-r--r--arch/powerpc/include/asm/ppc_asm.h72
-rw-r--r--arch/powerpc/include/asm/processor.h2
-rw-r--r--arch/powerpc/include/asm/reg.h10
-rw-r--r--arch/powerpc/include/asm/sections.h2
-rw-r--r--arch/powerpc/include/asm/smp.h8
-rw-r--r--arch/powerpc/include/asm/string.h4
-rw-r--r--arch/powerpc/include/asm/systbl.h8
-rw-r--r--arch/powerpc/include/asm/topology.h13
27 files changed, 190 insertions, 99 deletions
diff --git a/arch/powerpc/include/asm/code-patching.h b/arch/powerpc/include/asm/code-patching.h
index 97e02f985df8..37991e154ef8 100644
--- a/arch/powerpc/include/asm/code-patching.h
+++ b/arch/powerpc/include/asm/code-patching.h
@@ -42,15 +42,47 @@ void __patch_exception(int exc, unsigned long addr);
42} while (0) 42} while (0)
43#endif 43#endif
44 44
45#define OP_RT_RA_MASK 0xffff0000UL
46#define LIS_R2 0x3c020000UL
47#define ADDIS_R2_R12 0x3c4c0000UL
48#define ADDI_R2_R2 0x38420000UL
49
45static inline unsigned long ppc_function_entry(void *func) 50static inline unsigned long ppc_function_entry(void *func)
46{ 51{
47#ifdef CONFIG_PPC64 52#if defined(CONFIG_PPC64)
53#if defined(_CALL_ELF) && _CALL_ELF == 2
54 u32 *insn = func;
55
56 /*
57 * A PPC64 ABIv2 function may have a local and a global entry
58 * point. We need to use the local entry point when patching
59 * functions, so identify and step over the global entry point
60 * sequence.
61 *
62 * The global entry point sequence is always of the form:
63 *
64 * addis r2,r12,XXXX
65 * addi r2,r2,XXXX
66 *
67 * A linker optimisation may convert the addis to lis:
68 *
69 * lis r2,XXXX
70 * addi r2,r2,XXXX
71 */
72 if ((((*insn & OP_RT_RA_MASK) == ADDIS_R2_R12) ||
73 ((*insn & OP_RT_RA_MASK) == LIS_R2)) &&
74 ((*(insn+1) & OP_RT_RA_MASK) == ADDI_R2_R2))
75 return (unsigned long)(insn + 2);
76 else
77 return (unsigned long)func;
78#else
48 /* 79 /*
49 * On PPC64 the function pointer actually points to the function's 80 * On PPC64 ABIv1 the function pointer actually points to the
50 * descriptor. The first entry in the descriptor is the address 81 * function's descriptor. The first entry in the descriptor is the
51 * of the function text. 82 * address of the function text.
52 */ 83 */
53 return ((func_descr_t *)func)->entry; 84 return ((func_descr_t *)func)->entry;
85#endif
54#else 86#else
55 return (unsigned long)func; 87 return (unsigned long)func;
56#endif 88#endif
diff --git a/arch/powerpc/include/asm/context_tracking.h b/arch/powerpc/include/asm/context_tracking.h
index b6f5a33b8ee2..40014921ffff 100644
--- a/arch/powerpc/include/asm/context_tracking.h
+++ b/arch/powerpc/include/asm/context_tracking.h
@@ -2,9 +2,9 @@
2#define _ASM_POWERPC_CONTEXT_TRACKING_H 2#define _ASM_POWERPC_CONTEXT_TRACKING_H
3 3
4#ifdef CONFIG_CONTEXT_TRACKING 4#ifdef CONFIG_CONTEXT_TRACKING
5#define SCHEDULE_USER bl .schedule_user 5#define SCHEDULE_USER bl schedule_user
6#else 6#else
7#define SCHEDULE_USER bl .schedule 7#define SCHEDULE_USER bl schedule
8#endif 8#endif
9 9
10#endif 10#endif
diff --git a/arch/powerpc/include/asm/cputhreads.h b/arch/powerpc/include/asm/cputhreads.h
index ac3eedb9b74a..2bf8e9307be9 100644
--- a/arch/powerpc/include/asm/cputhreads.h
+++ b/arch/powerpc/include/asm/cputhreads.h
@@ -18,10 +18,12 @@
18 18
19#ifdef CONFIG_SMP 19#ifdef CONFIG_SMP
20extern int threads_per_core; 20extern int threads_per_core;
21extern int threads_per_subcore;
21extern int threads_shift; 22extern int threads_shift;
22extern cpumask_t threads_core_mask; 23extern cpumask_t threads_core_mask;
23#else 24#else
24#define threads_per_core 1 25#define threads_per_core 1
26#define threads_per_subcore 1
25#define threads_shift 0 27#define threads_shift 0
26#define threads_core_mask (CPU_MASK_CPU0) 28#define threads_core_mask (CPU_MASK_CPU0)
27#endif 29#endif
@@ -74,6 +76,11 @@ static inline int cpu_thread_in_core(int cpu)
74 return cpu & (threads_per_core - 1); 76 return cpu & (threads_per_core - 1);
75} 77}
76 78
79static inline int cpu_thread_in_subcore(int cpu)
80{
81 return cpu & (threads_per_subcore - 1);
82}
83
77static inline int cpu_first_thread_sibling(int cpu) 84static inline int cpu_first_thread_sibling(int cpu)
78{ 85{
79 return cpu & ~(threads_per_core - 1); 86 return cpu & ~(threads_per_core - 1);
diff --git a/arch/powerpc/include/asm/debug.h b/arch/powerpc/include/asm/debug.h
index d2516308ed1e..a954e4975049 100644
--- a/arch/powerpc/include/asm/debug.h
+++ b/arch/powerpc/include/asm/debug.h
@@ -46,7 +46,8 @@ static inline int debugger_break_match(struct pt_regs *regs) { return 0; }
46static inline int debugger_fault_handler(struct pt_regs *regs) { return 0; } 46static inline int debugger_fault_handler(struct pt_regs *regs) { return 0; }
47#endif 47#endif
48 48
49int set_breakpoint(struct arch_hw_breakpoint *brk); 49void set_breakpoint(struct arch_hw_breakpoint *brk);
50void __set_breakpoint(struct arch_hw_breakpoint *brk);
50#ifdef CONFIG_PPC_ADV_DEBUG_REGS 51#ifdef CONFIG_PPC_ADV_DEBUG_REGS
51extern void do_send_trap(struct pt_regs *regs, unsigned long address, 52extern void do_send_trap(struct pt_regs *regs, unsigned long address,
52 unsigned long error_code, int signal_code, int brkpt); 53 unsigned long error_code, int signal_code, int brkpt);
diff --git a/arch/powerpc/include/asm/eeh.h b/arch/powerpc/include/asm/eeh.h
index d4dd41fb951b..b76f58c124ca 100644
--- a/arch/powerpc/include/asm/eeh.h
+++ b/arch/powerpc/include/asm/eeh.h
@@ -32,6 +32,22 @@ struct device_node;
32 32
33#ifdef CONFIG_EEH 33#ifdef CONFIG_EEH
34 34
35/* EEH subsystem flags */
36#define EEH_ENABLED 0x1 /* EEH enabled */
37#define EEH_FORCE_DISABLED 0x2 /* EEH disabled */
38#define EEH_PROBE_MODE_DEV 0x4 /* From PCI device */
39#define EEH_PROBE_MODE_DEVTREE 0x8 /* From device tree */
40
41/*
42 * Delay for PE reset, all in ms
43 *
44 * PCI specification has reset hold time of 100 milliseconds.
45 * We have 250 milliseconds here. The PCI bus settlement time
46 * is specified as 1.5 seconds and we have 1.8 seconds.
47 */
48#define EEH_PE_RST_HOLD_TIME 250
49#define EEH_PE_RST_SETTLE_TIME 1800
50
35/* 51/*
36 * The struct is used to trace PE related EEH functionality. 52 * The struct is used to trace PE related EEH functionality.
37 * In theory, there will have one instance of the struct to 53 * In theory, there will have one instance of the struct to
@@ -53,7 +69,7 @@ struct device_node;
53 69
54#define EEH_PE_ISOLATED (1 << 0) /* Isolated PE */ 70#define EEH_PE_ISOLATED (1 << 0) /* Isolated PE */
55#define EEH_PE_RECOVERING (1 << 1) /* Recovering PE */ 71#define EEH_PE_RECOVERING (1 << 1) /* Recovering PE */
56#define EEH_PE_PHB_DEAD (1 << 2) /* Dead PHB */ 72#define EEH_PE_RESET (1 << 2) /* PE reset in progress */
57 73
58#define EEH_PE_KEEP (1 << 8) /* Keep PE on hotplug */ 74#define EEH_PE_KEEP (1 << 8) /* Keep PE on hotplug */
59 75
@@ -92,6 +108,7 @@ struct eeh_pe {
92 108
93#define EEH_DEV_NO_HANDLER (1 << 8) /* No error handler */ 109#define EEH_DEV_NO_HANDLER (1 << 8) /* No error handler */
94#define EEH_DEV_SYSFS (1 << 9) /* Sysfs created */ 110#define EEH_DEV_SYSFS (1 << 9) /* Sysfs created */
111#define EEH_DEV_REMOVED (1 << 10) /* Removed permanently */
95 112
96struct eeh_dev { 113struct eeh_dev {
97 int mode; /* EEH mode */ 114 int mode; /* EEH mode */
@@ -99,7 +116,9 @@ struct eeh_dev {
99 int config_addr; /* Config address */ 116 int config_addr; /* Config address */
100 int pe_config_addr; /* PE config address */ 117 int pe_config_addr; /* PE config address */
101 u32 config_space[16]; /* Saved PCI config space */ 118 u32 config_space[16]; /* Saved PCI config space */
102 u8 pcie_cap; /* Saved PCIe capability */ 119 int pcix_cap; /* Saved PCIx capability */
120 int pcie_cap; /* Saved PCIe capability */
121 int aer_cap; /* Saved AER capability */
103 struct eeh_pe *pe; /* Associated PE */ 122 struct eeh_pe *pe; /* Associated PE */
104 struct list_head list; /* Form link list in the PE */ 123 struct list_head list; /* Form link list in the PE */
105 struct pci_controller *phb; /* Associated PHB */ 124 struct pci_controller *phb; /* Associated PHB */
@@ -171,37 +190,40 @@ struct eeh_ops {
171 int (*restore_config)(struct device_node *dn); 190 int (*restore_config)(struct device_node *dn);
172}; 191};
173 192
193extern int eeh_subsystem_flags;
174extern struct eeh_ops *eeh_ops; 194extern struct eeh_ops *eeh_ops;
175extern bool eeh_subsystem_enabled;
176extern raw_spinlock_t confirm_error_lock; 195extern raw_spinlock_t confirm_error_lock;
177extern int eeh_probe_mode;
178 196
179static inline bool eeh_enabled(void) 197static inline bool eeh_enabled(void)
180{ 198{
181 return eeh_subsystem_enabled; 199 if ((eeh_subsystem_flags & EEH_FORCE_DISABLED) ||
200 !(eeh_subsystem_flags & EEH_ENABLED))
201 return false;
202
203 return true;
182} 204}
183 205
184static inline void eeh_set_enable(bool mode) 206static inline void eeh_set_enable(bool mode)
185{ 207{
186 eeh_subsystem_enabled = mode; 208 if (mode)
209 eeh_subsystem_flags |= EEH_ENABLED;
210 else
211 eeh_subsystem_flags &= ~EEH_ENABLED;
187} 212}
188 213
189#define EEH_PROBE_MODE_DEV (1<<0) /* From PCI device */
190#define EEH_PROBE_MODE_DEVTREE (1<<1) /* From device tree */
191
192static inline void eeh_probe_mode_set(int flag) 214static inline void eeh_probe_mode_set(int flag)
193{ 215{
194 eeh_probe_mode = flag; 216 eeh_subsystem_flags |= flag;
195} 217}
196 218
197static inline int eeh_probe_mode_devtree(void) 219static inline int eeh_probe_mode_devtree(void)
198{ 220{
199 return (eeh_probe_mode == EEH_PROBE_MODE_DEVTREE); 221 return (eeh_subsystem_flags & EEH_PROBE_MODE_DEVTREE);
200} 222}
201 223
202static inline int eeh_probe_mode_dev(void) 224static inline int eeh_probe_mode_dev(void)
203{ 225{
204 return (eeh_probe_mode == EEH_PROBE_MODE_DEV); 226 return (eeh_subsystem_flags & EEH_PROBE_MODE_DEV);
205} 227}
206 228
207static inline void eeh_serialize_lock(unsigned long *flags) 229static inline void eeh_serialize_lock(unsigned long *flags)
diff --git a/arch/powerpc/include/asm/elf.h b/arch/powerpc/include/asm/elf.h
index 935b5e7a1436..888d8f3f2524 100644
--- a/arch/powerpc/include/asm/elf.h
+++ b/arch/powerpc/include/asm/elf.h
@@ -90,6 +90,8 @@ typedef elf_vrregset_t elf_fpxregset_t;
90do { \ 90do { \
91 if (((ex).e_flags & 0x3) == 2) \ 91 if (((ex).e_flags & 0x3) == 2) \
92 set_thread_flag(TIF_ELF2ABI); \ 92 set_thread_flag(TIF_ELF2ABI); \
93 else \
94 clear_thread_flag(TIF_ELF2ABI); \
93 if ((ex).e_ident[EI_CLASS] == ELFCLASS32) \ 95 if ((ex).e_ident[EI_CLASS] == ELFCLASS32) \
94 set_thread_flag(TIF_32BIT); \ 96 set_thread_flag(TIF_32BIT); \
95 else \ 97 else \
diff --git a/arch/powerpc/include/asm/exception-64e.h b/arch/powerpc/include/asm/exception-64e.h
index a563d9afd179..a8b52b61043f 100644
--- a/arch/powerpc/include/asm/exception-64e.h
+++ b/arch/powerpc/include/asm/exception-64e.h
@@ -174,10 +174,10 @@ exc_##label##_book3e:
174 mtlr r16; 174 mtlr r16;
175#define TLB_MISS_STATS_D(name) \ 175#define TLB_MISS_STATS_D(name) \
176 addi r9,r13,MMSTAT_DSTATS+name; \ 176 addi r9,r13,MMSTAT_DSTATS+name; \
177 bl .tlb_stat_inc; 177 bl tlb_stat_inc;
178#define TLB_MISS_STATS_I(name) \ 178#define TLB_MISS_STATS_I(name) \
179 addi r9,r13,MMSTAT_ISTATS+name; \ 179 addi r9,r13,MMSTAT_ISTATS+name; \
180 bl .tlb_stat_inc; 180 bl tlb_stat_inc;
181#define TLB_MISS_STATS_X(name) \ 181#define TLB_MISS_STATS_X(name) \
182 ld r8,PACA_EXTLB+EX_TLB_ESR(r13); \ 182 ld r8,PACA_EXTLB+EX_TLB_ESR(r13); \
183 cmpdi cr2,r8,-1; \ 183 cmpdi cr2,r8,-1; \
@@ -185,7 +185,7 @@ exc_##label##_book3e:
185 addi r9,r13,MMSTAT_DSTATS+name; \ 185 addi r9,r13,MMSTAT_DSTATS+name; \
186 b 62f; \ 186 b 62f; \
18761: addi r9,r13,MMSTAT_ISTATS+name; \ 18761: addi r9,r13,MMSTAT_ISTATS+name; \
18862: bl .tlb_stat_inc; 18862: bl tlb_stat_inc;
189#define TLB_MISS_STATS_SAVE_INFO \ 189#define TLB_MISS_STATS_SAVE_INFO \
190 std r14,EX_TLB_ESR(r12); /* save ESR */ 190 std r14,EX_TLB_ESR(r12); /* save ESR */
191#define TLB_MISS_STATS_SAVE_INFO_BOLTED \ 191#define TLB_MISS_STATS_SAVE_INFO_BOLTED \
diff --git a/arch/powerpc/include/asm/exception-64s.h b/arch/powerpc/include/asm/exception-64s.h
index aeaa56cd9b54..8f35cd7d59cc 100644
--- a/arch/powerpc/include/asm/exception-64s.h
+++ b/arch/powerpc/include/asm/exception-64s.h
@@ -517,7 +517,7 @@ label##_relon_hv: \
517#define DISABLE_INTS RECONCILE_IRQ_STATE(r10,r11) 517#define DISABLE_INTS RECONCILE_IRQ_STATE(r10,r11)
518 518
519#define ADD_NVGPRS \ 519#define ADD_NVGPRS \
520 bl .save_nvgprs 520 bl save_nvgprs
521 521
522#define RUNLATCH_ON \ 522#define RUNLATCH_ON \
523BEGIN_FTR_SECTION \ 523BEGIN_FTR_SECTION \
diff --git a/arch/powerpc/include/asm/ftrace.h b/arch/powerpc/include/asm/ftrace.h
index 169d039ed402..e3661872fbea 100644
--- a/arch/powerpc/include/asm/ftrace.h
+++ b/arch/powerpc/include/asm/ftrace.h
@@ -61,6 +61,7 @@ struct dyn_arch_ftrace {
61#endif 61#endif
62 62
63#if defined(CONFIG_FTRACE_SYSCALLS) && defined(CONFIG_PPC64) && !defined(__ASSEMBLY__) 63#if defined(CONFIG_FTRACE_SYSCALLS) && defined(CONFIG_PPC64) && !defined(__ASSEMBLY__)
64#if !defined(_CALL_ELF) || _CALL_ELF != 2
64#define ARCH_HAS_SYSCALL_MATCH_SYM_NAME 65#define ARCH_HAS_SYSCALL_MATCH_SYM_NAME
65static inline bool arch_syscall_match_sym_name(const char *sym, const char *name) 66static inline bool arch_syscall_match_sym_name(const char *sym, const char *name)
66{ 67{
@@ -72,6 +73,7 @@ static inline bool arch_syscall_match_sym_name(const char *sym, const char *name
72 */ 73 */
73 return !strcmp(sym + 4, name + 3); 74 return !strcmp(sym + 4, name + 3);
74} 75}
76#endif
75#endif /* CONFIG_FTRACE_SYSCALLS && CONFIG_PPC64 && !__ASSEMBLY__ */ 77#endif /* CONFIG_FTRACE_SYSCALLS && CONFIG_PPC64 && !__ASSEMBLY__ */
76 78
77#endif /* _ASM_POWERPC_FTRACE */ 79#endif /* _ASM_POWERPC_FTRACE */
diff --git a/arch/powerpc/include/asm/hw_breakpoint.h b/arch/powerpc/include/asm/hw_breakpoint.h
index eb0f4ac75c4c..ac6432d9be46 100644
--- a/arch/powerpc/include/asm/hw_breakpoint.h
+++ b/arch/powerpc/include/asm/hw_breakpoint.h
@@ -79,7 +79,7 @@ static inline void hw_breakpoint_disable(void)
79 brk.address = 0; 79 brk.address = 0;
80 brk.type = 0; 80 brk.type = 0;
81 brk.len = 0; 81 brk.len = 0;
82 set_breakpoint(&brk); 82 __set_breakpoint(&brk);
83} 83}
84extern void thread_change_pc(struct task_struct *tsk, struct pt_regs *regs); 84extern void thread_change_pc(struct task_struct *tsk, struct pt_regs *regs);
85 85
diff --git a/arch/powerpc/include/asm/irqflags.h b/arch/powerpc/include/asm/irqflags.h
index f51a5580bfd0..e20eb95429a8 100644
--- a/arch/powerpc/include/asm/irqflags.h
+++ b/arch/powerpc/include/asm/irqflags.h
@@ -20,9 +20,9 @@
20 */ 20 */
21#define TRACE_WITH_FRAME_BUFFER(func) \ 21#define TRACE_WITH_FRAME_BUFFER(func) \
22 mflr r0; \ 22 mflr r0; \
23 stdu r1, -32(r1); \ 23 stdu r1, -STACK_FRAME_OVERHEAD(r1); \
24 std r0, 16(r1); \ 24 std r0, 16(r1); \
25 stdu r1, -32(r1); \ 25 stdu r1, -STACK_FRAME_OVERHEAD(r1); \
26 bl func; \ 26 bl func; \
27 ld r1, 0(r1); \ 27 ld r1, 0(r1); \
28 ld r1, 0(r1); 28 ld r1, 0(r1);
@@ -36,8 +36,8 @@
36 * have to call a C function so call a wrapper that saves all the 36 * have to call a C function so call a wrapper that saves all the
37 * C-clobbered registers. 37 * C-clobbered registers.
38 */ 38 */
39#define TRACE_ENABLE_INTS TRACE_WITH_FRAME_BUFFER(.trace_hardirqs_on) 39#define TRACE_ENABLE_INTS TRACE_WITH_FRAME_BUFFER(trace_hardirqs_on)
40#define TRACE_DISABLE_INTS TRACE_WITH_FRAME_BUFFER(.trace_hardirqs_off) 40#define TRACE_DISABLE_INTS TRACE_WITH_FRAME_BUFFER(trace_hardirqs_off)
41 41
42/* 42/*
43 * This is used by assembly code to soft-disable interrupts first and 43 * This is used by assembly code to soft-disable interrupts first and
diff --git a/arch/powerpc/include/asm/kprobes.h b/arch/powerpc/include/asm/kprobes.h
index 7b6feab6fd26..af15d4d8d604 100644
--- a/arch/powerpc/include/asm/kprobes.h
+++ b/arch/powerpc/include/asm/kprobes.h
@@ -30,6 +30,7 @@
30#include <linux/ptrace.h> 30#include <linux/ptrace.h>
31#include <linux/percpu.h> 31#include <linux/percpu.h>
32#include <asm/probes.h> 32#include <asm/probes.h>
33#include <asm/code-patching.h>
33 34
34#define __ARCH_WANT_KPROBES_INSN_SLOT 35#define __ARCH_WANT_KPROBES_INSN_SLOT
35 36
@@ -56,9 +57,9 @@ typedef ppc_opcode_t kprobe_opcode_t;
56 if ((colon = strchr(name, ':')) != NULL) { \ 57 if ((colon = strchr(name, ':')) != NULL) { \
57 colon++; \ 58 colon++; \
58 if (*colon != '\0' && *colon != '.') \ 59 if (*colon != '\0' && *colon != '.') \
59 addr = *(kprobe_opcode_t **)addr; \ 60 addr = (kprobe_opcode_t *)ppc_function_entry(addr); \
60 } else if (name[0] != '.') \ 61 } else if (name[0] != '.') \
61 addr = *(kprobe_opcode_t **)addr; \ 62 addr = (kprobe_opcode_t *)ppc_function_entry(addr); \
62 } else { \ 63 } else { \
63 char dot_name[KSYM_NAME_LEN]; \ 64 char dot_name[KSYM_NAME_LEN]; \
64 dot_name[0] = '.'; \ 65 dot_name[0] = '.'; \
diff --git a/arch/powerpc/include/asm/kvm_ppc.h b/arch/powerpc/include/asm/kvm_ppc.h
index 4a7cc453be0b..9c89cdd067a6 100644
--- a/arch/powerpc/include/asm/kvm_ppc.h
+++ b/arch/powerpc/include/asm/kvm_ppc.h
@@ -337,6 +337,10 @@ static inline void kvmppc_fast_vcpu_kick(struct kvm_vcpu *vcpu)
337 vcpu->kvm->arch.kvm_ops->fast_vcpu_kick(vcpu); 337 vcpu->kvm->arch.kvm_ops->fast_vcpu_kick(vcpu);
338} 338}
339 339
340extern void kvm_hv_vm_activated(void);
341extern void kvm_hv_vm_deactivated(void);
342extern bool kvm_hv_mode_active(void);
343
340#else 344#else
341static inline void __init kvm_cma_reserve(void) 345static inline void __init kvm_cma_reserve(void)
342{} 346{}
@@ -356,6 +360,9 @@ static inline void kvmppc_fast_vcpu_kick(struct kvm_vcpu *vcpu)
356{ 360{
357 kvm_vcpu_kick(vcpu); 361 kvm_vcpu_kick(vcpu);
358} 362}
363
364static inline bool kvm_hv_mode_active(void) { return false; }
365
359#endif 366#endif
360 367
361#ifdef CONFIG_KVM_XICS 368#ifdef CONFIG_KVM_XICS
diff --git a/arch/powerpc/include/asm/linkage.h b/arch/powerpc/include/asm/linkage.h
index b36f650a13ff..e3ad5c72724a 100644
--- a/arch/powerpc/include/asm/linkage.h
+++ b/arch/powerpc/include/asm/linkage.h
@@ -2,6 +2,7 @@
2#define _ASM_POWERPC_LINKAGE_H 2#define _ASM_POWERPC_LINKAGE_H
3 3
4#ifdef CONFIG_PPC64 4#ifdef CONFIG_PPC64
5#if !defined(_CALL_ELF) || _CALL_ELF != 2
5#define cond_syscall(x) \ 6#define cond_syscall(x) \
6 asm ("\t.weak " #x "\n\t.set " #x ", sys_ni_syscall\n" \ 7 asm ("\t.weak " #x "\n\t.set " #x ", sys_ni_syscall\n" \
7 "\t.weak ." #x "\n\t.set ." #x ", .sys_ni_syscall\n") 8 "\t.weak ." #x "\n\t.set ." #x ", .sys_ni_syscall\n")
@@ -9,5 +10,6 @@
9 asm ("\t.globl " #alias "\n\t.set " #alias ", " #name "\n" \ 10 asm ("\t.globl " #alias "\n\t.set " #alias ", " #name "\n" \
10 "\t.globl ." #alias "\n\t.set ." #alias ", ." #name) 11 "\t.globl ." #alias "\n\t.set ." #alias ", ." #name)
11#endif 12#endif
13#endif
12 14
13#endif /* _ASM_POWERPC_LINKAGE_H */ 15#endif /* _ASM_POWERPC_LINKAGE_H */
diff --git a/arch/powerpc/include/asm/machdep.h b/arch/powerpc/include/asm/machdep.h
index 5b6c03f1058f..f92b0b54e921 100644
--- a/arch/powerpc/include/asm/machdep.h
+++ b/arch/powerpc/include/asm/machdep.h
@@ -98,6 +98,9 @@ struct machdep_calls {
98 void (*iommu_save)(void); 98 void (*iommu_save)(void);
99 void (*iommu_restore)(void); 99 void (*iommu_restore)(void);
100#endif 100#endif
101#ifdef CONFIG_MEMORY_HOTPLUG_SPARSE
102 unsigned long (*memory_block_size)(void);
103#endif
101#endif /* CONFIG_PPC64 */ 104#endif /* CONFIG_PPC64 */
102 105
103 void (*pci_dma_dev_setup)(struct pci_dev *dev); 106 void (*pci_dma_dev_setup)(struct pci_dev *dev);
@@ -113,6 +116,8 @@ struct machdep_calls {
113 /* Optional, may be NULL. */ 116 /* Optional, may be NULL. */
114 void (*show_cpuinfo)(struct seq_file *m); 117 void (*show_cpuinfo)(struct seq_file *m);
115 void (*show_percpuinfo)(struct seq_file *m, int i); 118 void (*show_percpuinfo)(struct seq_file *m, int i);
119 /* Returns the current operating frequency of "cpu" in Hz */
120 unsigned long (*get_proc_freq)(unsigned int cpu);
116 121
117 void (*init_IRQ)(void); 122 void (*init_IRQ)(void);
118 123
@@ -241,6 +246,9 @@ struct machdep_calls {
241 /* Called during PCI resource reassignment */ 246 /* Called during PCI resource reassignment */
242 resource_size_t (*pcibios_window_alignment)(struct pci_bus *, unsigned long type); 247 resource_size_t (*pcibios_window_alignment)(struct pci_bus *, unsigned long type);
243 248
249 /* Reset the secondary bus of bridge */
250 void (*pcibios_reset_secondary_bus)(struct pci_dev *dev);
251
244 /* Called to shutdown machine specific hardware not already controlled 252 /* Called to shutdown machine specific hardware not already controlled
245 * by other drivers. 253 * by other drivers.
246 */ 254 */
diff --git a/arch/powerpc/include/asm/module.h b/arch/powerpc/include/asm/module.h
index 49fa55bfbac4..dcfcad139bcc 100644
--- a/arch/powerpc/include/asm/module.h
+++ b/arch/powerpc/include/asm/module.h
@@ -35,6 +35,7 @@ struct mod_arch_specific {
35#ifdef __powerpc64__ 35#ifdef __powerpc64__
36 unsigned int stubs_section; /* Index of stubs section in module */ 36 unsigned int stubs_section; /* Index of stubs section in module */
37 unsigned int toc_section; /* What section is the TOC? */ 37 unsigned int toc_section; /* What section is the TOC? */
38 bool toc_fixed; /* Have we fixed up .TOC.? */
38#ifdef CONFIG_DYNAMIC_FTRACE 39#ifdef CONFIG_DYNAMIC_FTRACE
39 unsigned long toc; 40 unsigned long toc;
40 unsigned long tramp; 41 unsigned long tramp;
@@ -77,6 +78,9 @@ struct mod_arch_specific {
77# endif /* MODULE */ 78# endif /* MODULE */
78#endif 79#endif
79 80
81bool is_module_trampoline(u32 *insns);
82int module_trampoline_target(struct module *mod, u32 *trampoline,
83 unsigned long *target);
80 84
81struct exception_table_entry; 85struct exception_table_entry;
82void sort_ex_table(struct exception_table_entry *start, 86void sort_ex_table(struct exception_table_entry *start,
diff --git a/arch/powerpc/include/asm/opal.h b/arch/powerpc/include/asm/opal.h
index 66ad7a74116f..cb15cbb51600 100644
--- a/arch/powerpc/include/asm/opal.h
+++ b/arch/powerpc/include/asm/opal.h
@@ -154,6 +154,7 @@ extern int opal_enter_rtas(struct rtas_args *args,
154#define OPAL_LPC_READ 67 154#define OPAL_LPC_READ 67
155#define OPAL_LPC_WRITE 68 155#define OPAL_LPC_WRITE 68
156#define OPAL_RETURN_CPU 69 156#define OPAL_RETURN_CPU 69
157#define OPAL_REINIT_CPUS 70
157#define OPAL_ELOG_READ 71 158#define OPAL_ELOG_READ 71
158#define OPAL_ELOG_WRITE 72 159#define OPAL_ELOG_WRITE 72
159#define OPAL_ELOG_ACK 73 160#define OPAL_ELOG_ACK 73
@@ -509,7 +510,7 @@ enum OpalMemErr_DynErrType {
509struct OpalMemoryErrorData { 510struct OpalMemoryErrorData {
510 enum OpalMemErr_Version version:8; /* 0x00 */ 511 enum OpalMemErr_Version version:8; /* 0x00 */
511 enum OpalMemErrType type:8; /* 0x01 */ 512 enum OpalMemErrType type:8; /* 0x01 */
512 uint16_t flags; /* 0x02 */ 513 __be16 flags; /* 0x02 */
513 uint8_t reserved_1[4]; /* 0x04 */ 514 uint8_t reserved_1[4]; /* 0x04 */
514 515
515 union { 516 union {
@@ -517,15 +518,15 @@ struct OpalMemoryErrorData {
517 struct { 518 struct {
518 enum OpalMemErr_ResilErrType resil_err_type:8; 519 enum OpalMemErr_ResilErrType resil_err_type:8;
519 uint8_t reserved_1[7]; 520 uint8_t reserved_1[7];
520 uint64_t physical_address_start; 521 __be64 physical_address_start;
521 uint64_t physical_address_end; 522 __be64 physical_address_end;
522 } resilience; 523 } resilience;
523 /* Dynamic memory deallocation error info */ 524 /* Dynamic memory deallocation error info */
524 struct { 525 struct {
525 enum OpalMemErr_DynErrType dyn_err_type:8; 526 enum OpalMemErr_DynErrType dyn_err_type:8;
526 uint8_t reserved_1[7]; 527 uint8_t reserved_1[7];
527 uint64_t physical_address_start; 528 __be64 physical_address_start;
528 uint64_t physical_address_end; 529 __be64 physical_address_end;
529 } dyn_dealloc; 530 } dyn_dealloc;
530 } u; 531 } u;
531}; 532};
@@ -725,6 +726,11 @@ struct OpalIoPhb3ErrorData {
725 uint64_t pestB[OPAL_PHB3_NUM_PEST_REGS]; 726 uint64_t pestB[OPAL_PHB3_NUM_PEST_REGS];
726}; 727};
727 728
729enum {
730 OPAL_REINIT_CPUS_HILE_BE = (1 << 0),
731 OPAL_REINIT_CPUS_HILE_LE = (1 << 1),
732};
733
728typedef struct oppanel_line { 734typedef struct oppanel_line {
729 const char * line; 735 const char * line;
730 uint64_t line_len; 736 uint64_t line_len;
@@ -849,6 +855,7 @@ int64_t opal_pci_next_error(uint64_t phb_id, uint64_t *first_frozen_pe,
849 uint16_t *pci_error_type, uint16_t *severity); 855 uint16_t *pci_error_type, uint16_t *severity);
850int64_t opal_pci_poll(uint64_t phb_id); 856int64_t opal_pci_poll(uint64_t phb_id);
851int64_t opal_return_cpu(void); 857int64_t opal_return_cpu(void);
858int64_t opal_reinit_cpus(uint64_t flags);
852 859
853int64_t opal_xscom_read(uint32_t gcid, uint64_t pcb_addr, __be64 *val); 860int64_t opal_xscom_read(uint32_t gcid, uint64_t pcb_addr, __be64 *val);
854int64_t opal_xscom_write(uint32_t gcid, uint64_t pcb_addr, uint64_t val); 861int64_t opal_xscom_write(uint32_t gcid, uint64_t pcb_addr, uint64_t val);
@@ -916,6 +923,7 @@ extern void opal_get_rtc_time(struct rtc_time *tm);
916extern unsigned long opal_get_boot_time(void); 923extern unsigned long opal_get_boot_time(void);
917extern void opal_nvram_init(void); 924extern void opal_nvram_init(void);
918extern void opal_flash_init(void); 925extern void opal_flash_init(void);
926extern void opal_flash_term_callback(void);
919extern int opal_elog_init(void); 927extern int opal_elog_init(void);
920extern void opal_platform_dump_init(void); 928extern void opal_platform_dump_init(void);
921extern void opal_sys_param_init(void); 929extern void opal_sys_param_init(void);
diff --git a/arch/powerpc/include/asm/paca.h b/arch/powerpc/include/asm/paca.h
index 8e956a0b6e85..bb0bd25f20d0 100644
--- a/arch/powerpc/include/asm/paca.h
+++ b/arch/powerpc/include/asm/paca.h
@@ -92,7 +92,10 @@ struct paca_struct {
92 struct slb_shadow *slb_shadow_ptr; 92 struct slb_shadow *slb_shadow_ptr;
93 struct dtl_entry *dispatch_log; 93 struct dtl_entry *dispatch_log;
94 struct dtl_entry *dispatch_log_end; 94 struct dtl_entry *dispatch_log_end;
95#endif /* CONFIG_PPC_STD_MMU_64 */
96 u64 dscr_default; /* per-CPU default DSCR */
95 97
98#ifdef CONFIG_PPC_STD_MMU_64
96 /* 99 /*
97 * Now, starting in cacheline 2, the exception save areas 100 * Now, starting in cacheline 2, the exception save areas
98 */ 101 */
diff --git a/arch/powerpc/include/asm/ppc-pci.h b/arch/powerpc/include/asm/ppc-pci.h
index ed57fa7920c8..db1e2b8eff3c 100644
--- a/arch/powerpc/include/asm/ppc-pci.h
+++ b/arch/powerpc/include/asm/ppc-pci.h
@@ -58,6 +58,7 @@ int rtas_write_config(struct pci_dn *, int where, int size, u32 val);
58int rtas_read_config(struct pci_dn *, int where, int size, u32 *val); 58int rtas_read_config(struct pci_dn *, int where, int size, u32 *val);
59void eeh_pe_state_mark(struct eeh_pe *pe, int state); 59void eeh_pe_state_mark(struct eeh_pe *pe, int state);
60void eeh_pe_state_clear(struct eeh_pe *pe, int state); 60void eeh_pe_state_clear(struct eeh_pe *pe, int state);
61void eeh_pe_dev_mode_mark(struct eeh_pe *pe, int mode);
61 62
62void eeh_sysfs_add_device(struct pci_dev *pdev); 63void eeh_sysfs_add_device(struct pci_dev *pdev);
63void eeh_sysfs_remove_device(struct pci_dev *pdev); 64void eeh_sysfs_remove_device(struct pci_dev *pdev);
diff --git a/arch/powerpc/include/asm/ppc_asm.h b/arch/powerpc/include/asm/ppc_asm.h
index cded7c1278ef..9ea266eae33e 100644
--- a/arch/powerpc/include/asm/ppc_asm.h
+++ b/arch/powerpc/include/asm/ppc_asm.h
@@ -57,7 +57,7 @@ BEGIN_FW_FTR_SECTION; \
57 LDX_BE r10,0,r10; /* get log write index */ \ 57 LDX_BE r10,0,r10; /* get log write index */ \
58 cmpd cr1,r11,r10; \ 58 cmpd cr1,r11,r10; \
59 beq+ cr1,33f; \ 59 beq+ cr1,33f; \
60 bl .accumulate_stolen_time; \ 60 bl accumulate_stolen_time; \
61 ld r12,_MSR(r1); \ 61 ld r12,_MSR(r1); \
62 andi. r10,r12,MSR_PR; /* Restore cr0 (coming from user) */ \ 62 andi. r10,r12,MSR_PR; /* Restore cr0 (coming from user) */ \
6333: \ 6333: \
@@ -189,57 +189,53 @@ END_FW_FTR_SECTION_IFSET(FW_FEATURE_SPLPAR)
189#define __STK_REG(i) (112 + ((i)-14)*8) 189#define __STK_REG(i) (112 + ((i)-14)*8)
190#define STK_REG(i) __STK_REG(__REG_##i) 190#define STK_REG(i) __STK_REG(__REG_##i)
191 191
192#if defined(_CALL_ELF) && _CALL_ELF == 2
193#define STK_GOT 24
194#define __STK_PARAM(i) (32 + ((i)-3)*8)
195#else
196#define STK_GOT 40
192#define __STK_PARAM(i) (48 + ((i)-3)*8) 197#define __STK_PARAM(i) (48 + ((i)-3)*8)
198#endif
193#define STK_PARAM(i) __STK_PARAM(__REG_##i) 199#define STK_PARAM(i) __STK_PARAM(__REG_##i)
194 200
195#define XGLUE(a,b) a##b 201#if defined(_CALL_ELF) && _CALL_ELF == 2
196#define GLUE(a,b) XGLUE(a,b)
197 202
198#define _GLOBAL(name) \ 203#define _GLOBAL(name) \
199 .section ".text"; \ 204 .section ".text"; \
200 .align 2 ; \ 205 .align 2 ; \
206 .type name,@function; \
201 .globl name; \ 207 .globl name; \
202 .globl GLUE(.,name); \ 208name:
203 .section ".opd","aw"; \
204name: \
205 .quad GLUE(.,name); \
206 .quad .TOC.@tocbase; \
207 .quad 0; \
208 .previous; \
209 .type GLUE(.,name),@function; \
210GLUE(.,name):
211 209
212#define _INIT_GLOBAL(name) \ 210#define _GLOBAL_TOC(name) \
213 __REF; \ 211 .section ".text"; \
214 .align 2 ; \ 212 .align 2 ; \
213 .type name,@function; \
215 .globl name; \ 214 .globl name; \
216 .globl GLUE(.,name); \
217 .section ".opd","aw"; \
218name: \ 215name: \
219 .quad GLUE(.,name); \ 2160: addis r2,r12,(.TOC.-0b)@ha; \
220 .quad .TOC.@tocbase; \ 217 addi r2,r2,(.TOC.-0b)@l; \
221 .quad 0; \ 218 .localentry name,.-name
222 .previous; \
223 .type GLUE(.,name),@function; \
224GLUE(.,name):
225 219
226#define _KPROBE(name) \ 220#define _KPROBE(name) \
227 .section ".kprobes.text","a"; \ 221 .section ".kprobes.text","a"; \
228 .align 2 ; \ 222 .align 2 ; \
223 .type name,@function; \
229 .globl name; \ 224 .globl name; \
230 .globl GLUE(.,name); \ 225name:
231 .section ".opd","aw"; \ 226
232name: \ 227#define DOTSYM(a) a
233 .quad GLUE(.,name); \ 228
234 .quad .TOC.@tocbase; \ 229#else
235 .quad 0; \ 230
236 .previous; \ 231#define XGLUE(a,b) a##b
237 .type GLUE(.,name),@function; \ 232#define GLUE(a,b) XGLUE(a,b)
238GLUE(.,name):
239 233
240#define _STATIC(name) \ 234#define _GLOBAL(name) \
241 .section ".text"; \ 235 .section ".text"; \
242 .align 2 ; \ 236 .align 2 ; \
237 .globl name; \
238 .globl GLUE(.,name); \
243 .section ".opd","aw"; \ 239 .section ".opd","aw"; \
244name: \ 240name: \
245 .quad GLUE(.,name); \ 241 .quad GLUE(.,name); \
@@ -249,9 +245,13 @@ name: \
249 .type GLUE(.,name),@function; \ 245 .type GLUE(.,name),@function; \
250GLUE(.,name): 246GLUE(.,name):
251 247
252#define _INIT_STATIC(name) \ 248#define _GLOBAL_TOC(name) _GLOBAL(name)
253 __REF; \ 249
250#define _KPROBE(name) \
251 .section ".kprobes.text","a"; \
254 .align 2 ; \ 252 .align 2 ; \
253 .globl name; \
254 .globl GLUE(.,name); \
255 .section ".opd","aw"; \ 255 .section ".opd","aw"; \
256name: \ 256name: \
257 .quad GLUE(.,name); \ 257 .quad GLUE(.,name); \
@@ -261,6 +261,10 @@ name: \
261 .type GLUE(.,name),@function; \ 261 .type GLUE(.,name),@function; \
262GLUE(.,name): 262GLUE(.,name):
263 263
264#define DOTSYM(a) GLUE(.,a)
265
266#endif
267
264#else /* 32-bit */ 268#else /* 32-bit */
265 269
266#define _ENTRY(n) \ 270#define _ENTRY(n) \
diff --git a/arch/powerpc/include/asm/processor.h b/arch/powerpc/include/asm/processor.h
index d660dc36831a..6d59072e13a7 100644
--- a/arch/powerpc/include/asm/processor.h
+++ b/arch/powerpc/include/asm/processor.h
@@ -449,7 +449,7 @@ extern unsigned long cpuidle_disable;
449enum idle_boot_override {IDLE_NO_OVERRIDE = 0, IDLE_POWERSAVE_OFF}; 449enum idle_boot_override {IDLE_NO_OVERRIDE = 0, IDLE_POWERSAVE_OFF};
450 450
451extern int powersave_nap; /* set if nap mode can be used in idle loop */ 451extern int powersave_nap; /* set if nap mode can be used in idle loop */
452extern void power7_nap(void); 452extern void power7_nap(int check_irq);
453extern void power7_sleep(void); 453extern void power7_sleep(void);
454extern void flush_instruction_cache(void); 454extern void flush_instruction_cache(void);
455extern void hard_reset_now(void); 455extern void hard_reset_now(void);
diff --git a/arch/powerpc/include/asm/reg.h b/arch/powerpc/include/asm/reg.h
index 4852bcf270f3..bffd89d27301 100644
--- a/arch/powerpc/include/asm/reg.h
+++ b/arch/powerpc/include/asm/reg.h
@@ -215,6 +215,7 @@
215#define SPRN_TEXASR 0x82 /* Transaction EXception & Summary */ 215#define SPRN_TEXASR 0x82 /* Transaction EXception & Summary */
216#define TEXASR_FS __MASK(63-36) /* Transaction Failure Summary */ 216#define TEXASR_FS __MASK(63-36) /* Transaction Failure Summary */
217#define SPRN_TEXASRU 0x83 /* '' '' '' Upper 32 */ 217#define SPRN_TEXASRU 0x83 /* '' '' '' Upper 32 */
218#define TEXASR_FS __MASK(63-36) /* TEXASR Failure Summary */
218#define SPRN_TFHAR 0x80 /* Transaction Failure Handler Addr */ 219#define SPRN_TFHAR 0x80 /* Transaction Failure Handler Addr */
219#define SPRN_CTRLF 0x088 220#define SPRN_CTRLF 0x088
220#define SPRN_CTRLT 0x098 221#define SPRN_CTRLT 0x098
@@ -224,6 +225,7 @@
224#define CTRL_TE 0x00c00000 /* thread enable */ 225#define CTRL_TE 0x00c00000 /* thread enable */
225#define CTRL_RUNLATCH 0x1 226#define CTRL_RUNLATCH 0x1
226#define SPRN_DAWR 0xB4 227#define SPRN_DAWR 0xB4
228#define SPRN_RPR 0xBA /* Relative Priority Register */
227#define SPRN_CIABR 0xBB 229#define SPRN_CIABR 0xBB
228#define CIABR_PRIV 0x3 230#define CIABR_PRIV 0x3
229#define CIABR_PRIV_USER 1 231#define CIABR_PRIV_USER 1
@@ -272,8 +274,10 @@
272#define SPRN_HSRR1 0x13B /* Hypervisor Save/Restore 1 */ 274#define SPRN_HSRR1 0x13B /* Hypervisor Save/Restore 1 */
273#define SPRN_IC 0x350 /* Virtual Instruction Count */ 275#define SPRN_IC 0x350 /* Virtual Instruction Count */
274#define SPRN_VTB 0x351 /* Virtual Time Base */ 276#define SPRN_VTB 0x351 /* Virtual Time Base */
277#define SPRN_LDBAR 0x352 /* LD Base Address Register */
275#define SPRN_PMICR 0x354 /* Power Management Idle Control Reg */ 278#define SPRN_PMICR 0x354 /* Power Management Idle Control Reg */
276#define SPRN_PMSR 0x355 /* Power Management Status Reg */ 279#define SPRN_PMSR 0x355 /* Power Management Status Reg */
280#define SPRN_PMMAR 0x356 /* Power Management Memory Activity Register */
277#define SPRN_PMCR 0x374 /* Power Management Control Register */ 281#define SPRN_PMCR 0x374 /* Power Management Control Register */
278 282
279/* HFSCR and FSCR bit numbers are the same */ 283/* HFSCR and FSCR bit numbers are the same */
@@ -433,6 +437,12 @@
433#define HID0_BTCD (1<<1) /* Branch target cache disable */ 437#define HID0_BTCD (1<<1) /* Branch target cache disable */
434#define HID0_NOPDST (1<<1) /* No-op dst, dstt, etc. instr. */ 438#define HID0_NOPDST (1<<1) /* No-op dst, dstt, etc. instr. */
435#define HID0_NOPTI (1<<0) /* No-op dcbt and dcbst instr. */ 439#define HID0_NOPTI (1<<0) /* No-op dcbt and dcbst instr. */
440/* POWER8 HID0 bits */
441#define HID0_POWER8_4LPARMODE __MASK(61)
442#define HID0_POWER8_2LPARMODE __MASK(57)
443#define HID0_POWER8_1TO2LPAR __MASK(52)
444#define HID0_POWER8_1TO4LPAR __MASK(51)
445#define HID0_POWER8_DYNLPARDIS __MASK(48)
436 446
437#define SPRN_HID1 0x3F1 /* Hardware Implementation Register 1 */ 447#define SPRN_HID1 0x3F1 /* Hardware Implementation Register 1 */
438#ifdef CONFIG_6xx 448#ifdef CONFIG_6xx
diff --git a/arch/powerpc/include/asm/sections.h b/arch/powerpc/include/asm/sections.h
index 521790330672..a5e930aca804 100644
--- a/arch/powerpc/include/asm/sections.h
+++ b/arch/powerpc/include/asm/sections.h
@@ -50,6 +50,7 @@ static inline int overlaps_kvm_tmp(unsigned long start, unsigned long end)
50#endif 50#endif
51} 51}
52 52
53#if !defined(_CALL_ELF) || _CALL_ELF != 2
53#undef dereference_function_descriptor 54#undef dereference_function_descriptor
54static inline void *dereference_function_descriptor(void *ptr) 55static inline void *dereference_function_descriptor(void *ptr)
55{ 56{
@@ -60,6 +61,7 @@ static inline void *dereference_function_descriptor(void *ptr)
60 ptr = p; 61 ptr = p;
61 return ptr; 62 return ptr;
62} 63}
64#endif
63 65
64#endif 66#endif
65 67
diff --git a/arch/powerpc/include/asm/smp.h b/arch/powerpc/include/asm/smp.h
index ff51046b6466..5a6614a7f0b2 100644
--- a/arch/powerpc/include/asm/smp.h
+++ b/arch/powerpc/include/asm/smp.h
@@ -68,14 +68,6 @@ void generic_mach_cpu_die(void);
68void generic_set_cpu_dead(unsigned int cpu); 68void generic_set_cpu_dead(unsigned int cpu);
69void generic_set_cpu_up(unsigned int cpu); 69void generic_set_cpu_up(unsigned int cpu);
70int generic_check_cpu_restart(unsigned int cpu); 70int generic_check_cpu_restart(unsigned int cpu);
71
72extern void inhibit_secondary_onlining(void);
73extern void uninhibit_secondary_onlining(void);
74
75#else /* HOTPLUG_CPU */
76static inline void inhibit_secondary_onlining(void) {}
77static inline void uninhibit_secondary_onlining(void) {}
78
79#endif 71#endif
80 72
81#ifdef CONFIG_PPC64 73#ifdef CONFIG_PPC64
diff --git a/arch/powerpc/include/asm/string.h b/arch/powerpc/include/asm/string.h
index 0dffad6bcc84..e40010abcaf1 100644
--- a/arch/powerpc/include/asm/string.h
+++ b/arch/powerpc/include/asm/string.h
@@ -10,9 +10,7 @@
10#define __HAVE_ARCH_STRNCMP 10#define __HAVE_ARCH_STRNCMP
11#define __HAVE_ARCH_STRCAT 11#define __HAVE_ARCH_STRCAT
12#define __HAVE_ARCH_MEMSET 12#define __HAVE_ARCH_MEMSET
13#ifdef __BIG_ENDIAN__
14#define __HAVE_ARCH_MEMCPY 13#define __HAVE_ARCH_MEMCPY
15#endif
16#define __HAVE_ARCH_MEMMOVE 14#define __HAVE_ARCH_MEMMOVE
17#define __HAVE_ARCH_MEMCMP 15#define __HAVE_ARCH_MEMCMP
18#define __HAVE_ARCH_MEMCHR 16#define __HAVE_ARCH_MEMCHR
@@ -24,9 +22,7 @@ extern int strcmp(const char *,const char *);
24extern int strncmp(const char *, const char *, __kernel_size_t); 22extern int strncmp(const char *, const char *, __kernel_size_t);
25extern char * strcat(char *, const char *); 23extern char * strcat(char *, const char *);
26extern void * memset(void *,int,__kernel_size_t); 24extern void * memset(void *,int,__kernel_size_t);
27#ifdef __BIG_ENDIAN__
28extern void * memcpy(void *,const void *,__kernel_size_t); 25extern void * memcpy(void *,const void *,__kernel_size_t);
29#endif
30extern void * memmove(void *,const void *,__kernel_size_t); 26extern void * memmove(void *,const void *,__kernel_size_t);
31extern int memcmp(const void *,const void *,__kernel_size_t); 27extern int memcmp(const void *,const void *,__kernel_size_t);
32extern void * memchr(const void *,int,__kernel_size_t); 28extern void * memchr(const void *,int,__kernel_size_t);
diff --git a/arch/powerpc/include/asm/systbl.h b/arch/powerpc/include/asm/systbl.h
index ea4dc3a89c1f..babbeca6850f 100644
--- a/arch/powerpc/include/asm/systbl.h
+++ b/arch/powerpc/include/asm/systbl.h
@@ -62,7 +62,7 @@ COMPAT_SYS_SPU(fcntl)
62SYSCALL(ni_syscall) 62SYSCALL(ni_syscall)
63SYSCALL_SPU(setpgid) 63SYSCALL_SPU(setpgid)
64SYSCALL(ni_syscall) 64SYSCALL(ni_syscall)
65SYSX(sys_ni_syscall,sys_olduname, sys_olduname) 65SYSX(sys_ni_syscall,sys_olduname,sys_olduname)
66SYSCALL_SPU(umask) 66SYSCALL_SPU(umask)
67SYSCALL_SPU(chroot) 67SYSCALL_SPU(chroot)
68COMPAT_SYS(ustat) 68COMPAT_SYS(ustat)
@@ -190,7 +190,7 @@ SYSCALL_SPU(getcwd)
190SYSCALL_SPU(capget) 190SYSCALL_SPU(capget)
191SYSCALL_SPU(capset) 191SYSCALL_SPU(capset)
192COMPAT_SYS(sigaltstack) 192COMPAT_SYS(sigaltstack)
193COMPAT_SYS_SPU(sendfile) 193SYSX_SPU(sys_sendfile64,compat_sys_sendfile,sys_sendfile)
194SYSCALL(ni_syscall) 194SYSCALL(ni_syscall)
195SYSCALL(ni_syscall) 195SYSCALL(ni_syscall)
196PPC_SYS(vfork) 196PPC_SYS(vfork)
@@ -258,7 +258,7 @@ SYSCALL_SPU(tgkill)
258COMPAT_SYS_SPU(utimes) 258COMPAT_SYS_SPU(utimes)
259COMPAT_SYS_SPU(statfs64) 259COMPAT_SYS_SPU(statfs64)
260COMPAT_SYS_SPU(fstatfs64) 260COMPAT_SYS_SPU(fstatfs64)
261SYSX(sys_ni_syscall, ppc_fadvise64_64, ppc_fadvise64_64) 261SYSX(sys_ni_syscall,ppc_fadvise64_64,ppc_fadvise64_64)
262PPC_SYS_SPU(rtas) 262PPC_SYS_SPU(rtas)
263OLDSYS(debug_setcontext) 263OLDSYS(debug_setcontext)
264SYSCALL(ni_syscall) 264SYSCALL(ni_syscall)
@@ -295,7 +295,7 @@ SYSCALL_SPU(mkdirat)
295SYSCALL_SPU(mknodat) 295SYSCALL_SPU(mknodat)
296SYSCALL_SPU(fchownat) 296SYSCALL_SPU(fchownat)
297COMPAT_SYS_SPU(futimesat) 297COMPAT_SYS_SPU(futimesat)
298SYSX_SPU(sys_newfstatat, sys_fstatat64, sys_fstatat64) 298SYSX_SPU(sys_newfstatat,sys_fstatat64,sys_fstatat64)
299SYSCALL_SPU(unlinkat) 299SYSCALL_SPU(unlinkat)
300SYSCALL_SPU(renameat) 300SYSCALL_SPU(renameat)
301SYSCALL_SPU(linkat) 301SYSCALL_SPU(linkat)
diff --git a/arch/powerpc/include/asm/topology.h b/arch/powerpc/include/asm/topology.h
index 6c8a8c5a37a1..5f1048eaa5b6 100644
--- a/arch/powerpc/include/asm/topology.h
+++ b/arch/powerpc/include/asm/topology.h
@@ -16,19 +16,6 @@ struct device_node;
16 16
17#include <asm/mmzone.h> 17#include <asm/mmzone.h>
18 18
19static inline int cpu_to_node(int cpu)
20{
21 int nid;
22
23 nid = numa_cpu_lookup_table[cpu];
24
25 /*
26 * During early boot, the numa-cpu lookup table might not have been
27 * setup for all CPUs yet. In such cases, default to node 0.
28 */
29 return (nid < 0) ? 0 : nid;
30}
31
32#define parent_node(node) (node) 19#define parent_node(node) (node)
33 20
34#define cpumask_of_node(node) ((node) == -1 ? \ 21#define cpumask_of_node(node) ((node) == -1 ? \