Commit 79b8cb97373445d3f27d9dd8633fb2b8e3369af6

Authored by Linus Torvalds

Merge tag 'powerpc-3.19-3' of git://git.kernel.org/pub/scm/linux/kernel/git/mpe/linux

Pull powerpc fixes from Michael Ellerman:

 - Wire up sys_execveat(). Tested on 32 & 64 bit.

 - Fix for kdump on LE systems with cpus hot unplugged.

 - Revert Anton's fix for "kernel BUG at kernel/smpboot.c:134!", this
   broke other platforms, we'll do a proper fix for 3.20.

* tag 'powerpc-3.19-3' of git://git.kernel.org/pub/scm/linux/kernel/git/mpe/linux:
  Revert "powerpc: Secondary CPUs must set cpu_callin_map after setting active and online"
  powerpc/kdump: Ignore failure in enabling big endian exception during crash
  powerpc: Wire up sys_execveat() syscall

Showing 7 changed files Side-by-side Diff

arch/powerpc/include/asm/kexec.h
... ... @@ -86,6 +86,11 @@
86 86 extern void reserve_crashkernel(void);
87 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 94 #else /* !CONFIG_KEXEC */
90 95 static inline void crash_kexec_secondary(struct pt_regs *regs) { }
91 96  
... ... @@ -104,6 +109,11 @@
104 109 static inline int crash_shutdown_unregister(crash_shutdown_t handler)
105 110 {
106 111 return 0;
  112 +}
  113 +
  114 +static inline bool kdump_in_progress(void)
  115 +{
  116 + return false;
107 117 }
108 118  
109 119 #endif /* CONFIG_KEXEC */
arch/powerpc/include/asm/systbl.h
... ... @@ -366,4 +366,5 @@
366 366 SYSCALL_SPU(getrandom)
367 367 SYSCALL_SPU(memfd_create)
368 368 SYSCALL_SPU(bpf)
  369 +COMPAT_SYS(execveat)
arch/powerpc/include/asm/unistd.h
... ... @@ -12,7 +12,7 @@
12 12 #include <uapi/asm/unistd.h>
13 13  
14 14  
15   -#define __NR_syscalls 362
  15 +#define __NR_syscalls 363
16 16  
17 17 #define __NR__exit __NR_exit
18 18 #define NR_syscalls __NR_syscalls
arch/powerpc/include/uapi/asm/unistd.h
... ... @@ -384,6 +384,7 @@
384 384 #define __NR_getrandom 359
385 385 #define __NR_memfd_create 360
386 386 #define __NR_bpf 361
  387 +#define __NR_execveat 362
387 388  
388 389 #endif /* _UAPI_ASM_POWERPC_UNISTD_H_ */
arch/powerpc/kernel/machine_kexec_64.c
... ... @@ -330,7 +330,7 @@
330 330 * using debugger IPI.
331 331 */
332 332  
333   - if (crashing_cpu == -1)
  333 + if (!kdump_in_progress())
334 334 kexec_prepare_cpus();
335 335  
336 336 pr_debug("kexec: Starting switchover sequence.\n");
arch/powerpc/kernel/smp.c
... ... @@ -700,6 +700,7 @@
700 700 smp_store_cpu_info(cpu);
701 701 set_dec(tb_ticks_per_jiffy);
702 702 preempt_disable();
  703 + cpu_callin_map[cpu] = 1;
703 704  
704 705 if (smp_ops->setup_cpu)
705 706 smp_ops->setup_cpu(cpu);
... ... @@ -737,14 +738,6 @@
737 738 smp_wmb();
738 739 notify_cpu_starting(cpu);
739 740 set_cpu_online(cpu, true);
740   -
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 741  
749 742 local_irq_enable();
750 743  
arch/powerpc/platforms/pseries/lpar.c
... ... @@ -43,6 +43,7 @@
43 43 #include <asm/trace.h>
44 44 #include <asm/firmware.h>
45 45 #include <asm/plpar_wrappers.h>
  46 +#include <asm/kexec.h>
46 47 #include <asm/fadump.h>
47 48  
48 49 #include "pseries.h"
49 50  
... ... @@ -267,8 +268,13 @@
267 268 * out to the user, but at least this will stop us from
268 269 * continuing on further and creating an even more
269 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 278 panic("Could not enable big endian exceptions");
273 279 }
274 280 #endif