diff options
Diffstat (limited to 'arch/powerpc')
-rw-r--r-- | arch/powerpc/include/asm/kexec.h | 10 | ||||
-rw-r--r-- | arch/powerpc/include/asm/systbl.h | 1 | ||||
-rw-r--r-- | arch/powerpc/include/asm/thread_info.h | 13 | ||||
-rw-r--r-- | arch/powerpc/include/asm/unistd.h | 2 | ||||
-rw-r--r-- | arch/powerpc/include/uapi/asm/unistd.h | 1 | ||||
-rw-r--r-- | arch/powerpc/kernel/machine_kexec_64.c | 2 | ||||
-rw-r--r-- | arch/powerpc/kernel/smp.c | 9 | ||||
-rw-r--r-- | arch/powerpc/platforms/powernv/opal-wrappers.S | 1 | ||||
-rw-r--r-- | arch/powerpc/platforms/pseries/lpar.c | 8 |
9 files changed, 29 insertions, 18 deletions
diff --git a/arch/powerpc/include/asm/kexec.h b/arch/powerpc/include/asm/kexec.h index 19c36cba37c4..a46f5f45570c 100644 --- a/arch/powerpc/include/asm/kexec.h +++ b/arch/powerpc/include/asm/kexec.h | |||
@@ -86,6 +86,11 @@ extern int overlaps_crashkernel(unsigned long start, unsigned long size); | |||
86 | extern void reserve_crashkernel(void); | 86 | extern void reserve_crashkernel(void); |
87 | extern void machine_kexec_mask_interrupts(void); | 87 | extern void machine_kexec_mask_interrupts(void); |
88 | 88 | ||
89 | static inline bool kdump_in_progress(void) | ||
90 | { | ||
91 | return crashing_cpu >= 0; | ||
92 | } | ||
93 | |||
89 | #else /* !CONFIG_KEXEC */ | 94 | #else /* !CONFIG_KEXEC */ |
90 | static inline void crash_kexec_secondary(struct pt_regs *regs) { } | 95 | static inline void crash_kexec_secondary(struct pt_regs *regs) { } |
91 | 96 | ||
@@ -106,6 +111,11 @@ static inline int crash_shutdown_unregister(crash_shutdown_t handler) | |||
106 | return 0; | 111 | return 0; |
107 | } | 112 | } |
108 | 113 | ||
114 | static inline bool kdump_in_progress(void) | ||
115 | { | ||
116 | return false; | ||
117 | } | ||
118 | |||
109 | #endif /* CONFIG_KEXEC */ | 119 | #endif /* CONFIG_KEXEC */ |
110 | #endif /* ! __ASSEMBLY__ */ | 120 | #endif /* ! __ASSEMBLY__ */ |
111 | #endif /* __KERNEL__ */ | 121 | #endif /* __KERNEL__ */ |
diff --git a/arch/powerpc/include/asm/systbl.h b/arch/powerpc/include/asm/systbl.h index ce9577d693be..91062eef582f 100644 --- a/arch/powerpc/include/asm/systbl.h +++ b/arch/powerpc/include/asm/systbl.h | |||
@@ -366,3 +366,4 @@ SYSCALL_SPU(seccomp) | |||
366 | SYSCALL_SPU(getrandom) | 366 | SYSCALL_SPU(getrandom) |
367 | SYSCALL_SPU(memfd_create) | 367 | SYSCALL_SPU(memfd_create) |
368 | SYSCALL_SPU(bpf) | 368 | SYSCALL_SPU(bpf) |
369 | COMPAT_SYS(execveat) | ||
diff --git a/arch/powerpc/include/asm/thread_info.h b/arch/powerpc/include/asm/thread_info.h index ebc4f165690a..0be6c681cab1 100644 --- a/arch/powerpc/include/asm/thread_info.h +++ b/arch/powerpc/include/asm/thread_info.h | |||
@@ -23,9 +23,9 @@ | |||
23 | #define THREAD_SIZE (1 << THREAD_SHIFT) | 23 | #define THREAD_SIZE (1 << THREAD_SHIFT) |
24 | 24 | ||
25 | #ifdef CONFIG_PPC64 | 25 | #ifdef CONFIG_PPC64 |
26 | #define CURRENT_THREAD_INFO(dest, sp) clrrdi dest, sp, THREAD_SHIFT | 26 | #define CURRENT_THREAD_INFO(dest, sp) stringify_in_c(clrrdi dest, sp, THREAD_SHIFT) |
27 | #else | 27 | #else |
28 | #define CURRENT_THREAD_INFO(dest, sp) rlwinm dest, sp, 0, 0, 31-THREAD_SHIFT | 28 | #define CURRENT_THREAD_INFO(dest, sp) stringify_in_c(rlwinm dest, sp, 0, 0, 31-THREAD_SHIFT) |
29 | #endif | 29 | #endif |
30 | 30 | ||
31 | #ifndef __ASSEMBLY__ | 31 | #ifndef __ASSEMBLY__ |
@@ -71,12 +71,13 @@ struct thread_info { | |||
71 | #define THREAD_SIZE_ORDER (THREAD_SHIFT - PAGE_SHIFT) | 71 | #define THREAD_SIZE_ORDER (THREAD_SHIFT - PAGE_SHIFT) |
72 | 72 | ||
73 | /* how to get the thread information struct from C */ | 73 | /* how to get the thread information struct from C */ |
74 | register unsigned long __current_r1 asm("r1"); | ||
75 | static inline struct thread_info *current_thread_info(void) | 74 | static inline struct thread_info *current_thread_info(void) |
76 | { | 75 | { |
77 | /* gcc4, at least, is smart enough to turn this into a single | 76 | unsigned long val; |
78 | * rlwinm for ppc32 and clrrdi for ppc64 */ | 77 | |
79 | return (struct thread_info *)(__current_r1 & ~(THREAD_SIZE-1)); | 78 | asm (CURRENT_THREAD_INFO(%0,1) : "=r" (val)); |
79 | |||
80 | return (struct thread_info *)val; | ||
80 | } | 81 | } |
81 | 82 | ||
82 | #endif /* __ASSEMBLY__ */ | 83 | #endif /* __ASSEMBLY__ */ |
diff --git a/arch/powerpc/include/asm/unistd.h b/arch/powerpc/include/asm/unistd.h index e0da021caa00..36b79c31eedd 100644 --- a/arch/powerpc/include/asm/unistd.h +++ b/arch/powerpc/include/asm/unistd.h | |||
@@ -12,7 +12,7 @@ | |||
12 | #include <uapi/asm/unistd.h> | 12 | #include <uapi/asm/unistd.h> |
13 | 13 | ||
14 | 14 | ||
15 | #define __NR_syscalls 362 | 15 | #define __NR_syscalls 363 |
16 | 16 | ||
17 | #define __NR__exit __NR_exit | 17 | #define __NR__exit __NR_exit |
18 | #define NR_syscalls __NR_syscalls | 18 | #define NR_syscalls __NR_syscalls |
diff --git a/arch/powerpc/include/uapi/asm/unistd.h b/arch/powerpc/include/uapi/asm/unistd.h index f55351f2e66e..ef5b5b1f3123 100644 --- a/arch/powerpc/include/uapi/asm/unistd.h +++ b/arch/powerpc/include/uapi/asm/unistd.h | |||
@@ -384,5 +384,6 @@ | |||
384 | #define __NR_getrandom 359 | 384 | #define __NR_getrandom 359 |
385 | #define __NR_memfd_create 360 | 385 | #define __NR_memfd_create 360 |
386 | #define __NR_bpf 361 | 386 | #define __NR_bpf 361 |
387 | #define __NR_execveat 362 | ||
387 | 388 | ||
388 | #endif /* _UAPI_ASM_POWERPC_UNISTD_H_ */ | 389 | #endif /* _UAPI_ASM_POWERPC_UNISTD_H_ */ |
diff --git a/arch/powerpc/kernel/machine_kexec_64.c b/arch/powerpc/kernel/machine_kexec_64.c index 879b3aacac32..f96d1ec24189 100644 --- a/arch/powerpc/kernel/machine_kexec_64.c +++ b/arch/powerpc/kernel/machine_kexec_64.c | |||
@@ -330,7 +330,7 @@ void default_machine_kexec(struct kimage *image) | |||
330 | * using debugger IPI. | 330 | * using debugger IPI. |
331 | */ | 331 | */ |
332 | 332 | ||
333 | if (crashing_cpu == -1) | 333 | if (!kdump_in_progress()) |
334 | kexec_prepare_cpus(); | 334 | kexec_prepare_cpus(); |
335 | 335 | ||
336 | pr_debug("kexec: Starting switchover sequence.\n"); | 336 | pr_debug("kexec: Starting switchover sequence.\n"); |
diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c index 8ec017cb4446..8b2d2dc8ef10 100644 --- a/arch/powerpc/kernel/smp.c +++ b/arch/powerpc/kernel/smp.c | |||
@@ -700,6 +700,7 @@ void start_secondary(void *unused) | |||
700 | smp_store_cpu_info(cpu); | 700 | smp_store_cpu_info(cpu); |
701 | set_dec(tb_ticks_per_jiffy); | 701 | set_dec(tb_ticks_per_jiffy); |
702 | preempt_disable(); | 702 | preempt_disable(); |
703 | cpu_callin_map[cpu] = 1; | ||
703 | 704 | ||
704 | if (smp_ops->setup_cpu) | 705 | if (smp_ops->setup_cpu) |
705 | smp_ops->setup_cpu(cpu); | 706 | smp_ops->setup_cpu(cpu); |
@@ -738,14 +739,6 @@ void start_secondary(void *unused) | |||
738 | notify_cpu_starting(cpu); | 739 | notify_cpu_starting(cpu); |
739 | set_cpu_online(cpu, true); | 740 | set_cpu_online(cpu, true); |
740 | 741 | ||
741 | /* | ||
742 | * CPU must be marked active and online before we signal back to the | ||
743 | * master, because the scheduler needs to see the cpu_online and | ||
744 | * cpu_active bits set. | ||
745 | */ | ||
746 | smp_wmb(); | ||
747 | cpu_callin_map[cpu] = 1; | ||
748 | |||
749 | local_irq_enable(); | 742 | local_irq_enable(); |
750 | 743 | ||
751 | cpu_startup_entry(CPUHP_ONLINE); | 744 | cpu_startup_entry(CPUHP_ONLINE); |
diff --git a/arch/powerpc/platforms/powernv/opal-wrappers.S b/arch/powerpc/platforms/powernv/opal-wrappers.S index 54eca8b3b288..0509bca5e830 100644 --- a/arch/powerpc/platforms/powernv/opal-wrappers.S +++ b/arch/powerpc/platforms/powernv/opal-wrappers.S | |||
@@ -40,7 +40,6 @@ BEGIN_FTR_SECTION; \ | |||
40 | b 1f; \ | 40 | b 1f; \ |
41 | END_FTR_SECTION(0, 1); \ | 41 | END_FTR_SECTION(0, 1); \ |
42 | ld r12,opal_tracepoint_refcount@toc(r2); \ | 42 | ld r12,opal_tracepoint_refcount@toc(r2); \ |
43 | std r12,32(r1); \ | ||
44 | cmpdi r12,0; \ | 43 | cmpdi r12,0; \ |
45 | bne- LABEL; \ | 44 | bne- LABEL; \ |
46 | 1: | 45 | 1: |
diff --git a/arch/powerpc/platforms/pseries/lpar.c b/arch/powerpc/platforms/pseries/lpar.c index 469751d92004..b5682fd6c984 100644 --- a/arch/powerpc/platforms/pseries/lpar.c +++ b/arch/powerpc/platforms/pseries/lpar.c | |||
@@ -43,6 +43,7 @@ | |||
43 | #include <asm/trace.h> | 43 | #include <asm/trace.h> |
44 | #include <asm/firmware.h> | 44 | #include <asm/firmware.h> |
45 | #include <asm/plpar_wrappers.h> | 45 | #include <asm/plpar_wrappers.h> |
46 | #include <asm/kexec.h> | ||
46 | #include <asm/fadump.h> | 47 | #include <asm/fadump.h> |
47 | 48 | ||
48 | #include "pseries.h" | 49 | #include "pseries.h" |
@@ -267,8 +268,13 @@ static void pSeries_lpar_hptab_clear(void) | |||
267 | * out to the user, but at least this will stop us from | 268 | * out to the user, but at least this will stop us from |
268 | * continuing on further and creating an even more | 269 | * continuing on further and creating an even more |
269 | * difficult to debug situation. | 270 | * difficult to debug situation. |
271 | * | ||
272 | * There is a known problem when kdump'ing, if cpus are offline | ||
273 | * the above call will fail. Rather than panicking again, keep | ||
274 | * going and hope the kdump kernel is also little endian, which | ||
275 | * it usually is. | ||
270 | */ | 276 | */ |
271 | if (rc) | 277 | if (rc && !kdump_in_progress()) |
272 | panic("Could not enable big endian exceptions"); | 278 | panic("Could not enable big endian exceptions"); |
273 | } | 279 | } |
274 | #endif | 280 | #endif |