Skip to content

Commit 79b8cb9

Browse files
committed
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
2 parents f40bde8 + 1be6f10 commit 79b8cb9

File tree

7 files changed

+22
-11
lines changed

7 files changed

+22
-11
lines changed

arch/powerpc/include/asm/kexec.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,11 @@ extern int overlaps_crashkernel(unsigned long start, unsigned long size);
8686
extern void reserve_crashkernel(void);
8787
extern void machine_kexec_mask_interrupts(void);
8888

89+
static inline bool kdump_in_progress(void)
90+
{
91+
return crashing_cpu >= 0;
92+
}
93+
8994
#else /* !CONFIG_KEXEC */
9095
static inline void crash_kexec_secondary(struct pt_regs *regs) { }
9196

@@ -106,6 +111,11 @@ static inline int crash_shutdown_unregister(crash_shutdown_t handler)
106111
return 0;
107112
}
108113

114+
static inline bool kdump_in_progress(void)
115+
{
116+
return false;
117+
}
118+
109119
#endif /* CONFIG_KEXEC */
110120
#endif /* ! __ASSEMBLY__ */
111121
#endif /* __KERNEL__ */

arch/powerpc/include/asm/systbl.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,3 +366,4 @@ SYSCALL_SPU(seccomp)
366366
SYSCALL_SPU(getrandom)
367367
SYSCALL_SPU(memfd_create)
368368
SYSCALL_SPU(bpf)
369+
COMPAT_SYS(execveat)

arch/powerpc/include/asm/unistd.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#include <uapi/asm/unistd.h>
1313

1414

15-
#define __NR_syscalls 362
15+
#define __NR_syscalls 363
1616

1717
#define __NR__exit __NR_exit
1818
#define NR_syscalls __NR_syscalls

arch/powerpc/include/uapi/asm/unistd.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,5 +384,6 @@
384384
#define __NR_getrandom 359
385385
#define __NR_memfd_create 360
386386
#define __NR_bpf 361
387+
#define __NR_execveat 362
387388

388389
#endif /* _UAPI_ASM_POWERPC_UNISTD_H_ */

arch/powerpc/kernel/machine_kexec_64.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ void default_machine_kexec(struct kimage *image)
330330
* using debugger IPI.
331331
*/
332332

333-
if (crashing_cpu == -1)
333+
if (!kdump_in_progress())
334334
kexec_prepare_cpus();
335335

336336
pr_debug("kexec: Starting switchover sequence.\n");

arch/powerpc/kernel/smp.c

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -700,6 +700,7 @@ void start_secondary(void *unused)
700700
smp_store_cpu_info(cpu);
701701
set_dec(tb_ticks_per_jiffy);
702702
preempt_disable();
703+
cpu_callin_map[cpu] = 1;
703704

704705
if (smp_ops->setup_cpu)
705706
smp_ops->setup_cpu(cpu);
@@ -738,14 +739,6 @@ void start_secondary(void *unused)
738739
notify_cpu_starting(cpu);
739740
set_cpu_online(cpu, true);
740741

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-
749742
local_irq_enable();
750743

751744
cpu_startup_entry(CPUHP_ONLINE);

arch/powerpc/platforms/pseries/lpar.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
#include <asm/trace.h>
4444
#include <asm/firmware.h>
4545
#include <asm/plpar_wrappers.h>
46+
#include <asm/kexec.h>
4647
#include <asm/fadump.h>
4748

4849
#include "pseries.h"
@@ -267,8 +268,13 @@ static void pSeries_lpar_hptab_clear(void)
267268
* out to the user, but at least this will stop us from
268269
* continuing on further and creating an even more
269270
* 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.
270276
*/
271-
if (rc)
277+
if (rc && !kdump_in_progress())
272278
panic("Could not enable big endian exceptions");
273279
}
274280
#endif

0 commit comments

Comments
 (0)