Commit 018cace2 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mpe/linux

Pull powerpc fixes from Michael Ellerman:
 "Ben's travelling so this is my first attempt at a pull request.

  There's nothing too exciting.  The CONFIG_FHANDLE one is annoying, I
  know you love defconfig changes.  But we've had a couple of developers
  waste time debugging boxes that wouldn't boot, only to realise it's
  just that systemd needs CONFIG_FHANDLE and our defconfigs don't have
  it.

  The new syscalls seem to be working, I've run the selftests that
  exist, and also let trinity bash on them for a while"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mpe/linux:
  powerpc: Wire up sys_seccomp(), sys_getrandom() and sys_memfd_create()
  powerpc: Make CONFIG_FHANDLE=y for all 64 bit powerpc defconfigs
  powerpc: use machine_subsys_initcall() for opal_hmi_handler_init()
  powerpc/perf: Fix ABIv2 kernel backtraces
  powerpc/pseries: Fix endian issues in memory hotplug
parents 8381e57a 7d59deb5
...@@ -5,6 +5,7 @@ CONFIG_SMP=y ...@@ -5,6 +5,7 @@ CONFIG_SMP=y
CONFIG_NR_CPUS=4 CONFIG_NR_CPUS=4
CONFIG_EXPERIMENTAL=y CONFIG_EXPERIMENTAL=y
CONFIG_SYSVIPC=y CONFIG_SYSVIPC=y
CONFIG_FHANDLE=y
CONFIG_IKCONFIG=y CONFIG_IKCONFIG=y
CONFIG_IKCONFIG_PROC=y CONFIG_IKCONFIG_PROC=y
CONFIG_LOG_BUF_SHIFT=15 CONFIG_LOG_BUF_SHIFT=15
......
...@@ -5,6 +5,7 @@ CONFIG_SMP=y ...@@ -5,6 +5,7 @@ CONFIG_SMP=y
CONFIG_NR_CPUS=4 CONFIG_NR_CPUS=4
CONFIG_EXPERIMENTAL=y CONFIG_EXPERIMENTAL=y
CONFIG_SYSVIPC=y CONFIG_SYSVIPC=y
CONFIG_FHANDLE=y
CONFIG_IKCONFIG=y CONFIG_IKCONFIG=y
CONFIG_IKCONFIG_PROC=y CONFIG_IKCONFIG_PROC=y
CONFIG_LOG_BUF_SHIFT=15 CONFIG_LOG_BUF_SHIFT=15
......
...@@ -4,6 +4,7 @@ CONFIG_ALTIVEC=y ...@@ -4,6 +4,7 @@ CONFIG_ALTIVEC=y
CONFIG_SMP=y CONFIG_SMP=y
CONFIG_NR_CPUS=24 CONFIG_NR_CPUS=24
CONFIG_SYSVIPC=y CONFIG_SYSVIPC=y
CONFIG_FHANDLE=y
CONFIG_IRQ_DOMAIN_DEBUG=y CONFIG_IRQ_DOMAIN_DEBUG=y
CONFIG_NO_HZ=y CONFIG_NO_HZ=y
CONFIG_HIGH_RES_TIMERS=y CONFIG_HIGH_RES_TIMERS=y
......
...@@ -5,6 +5,7 @@ CONFIG_NR_CPUS=4 ...@@ -5,6 +5,7 @@ CONFIG_NR_CPUS=4
CONFIG_EXPERIMENTAL=y CONFIG_EXPERIMENTAL=y
CONFIG_SYSVIPC=y CONFIG_SYSVIPC=y
CONFIG_POSIX_MQUEUE=y CONFIG_POSIX_MQUEUE=y
CONFIG_FHANDLE=y
CONFIG_IKCONFIG=y CONFIG_IKCONFIG=y
CONFIG_IKCONFIG_PROC=y CONFIG_IKCONFIG_PROC=y
CONFIG_BLK_DEV_INITRD=y CONFIG_BLK_DEV_INITRD=y
......
...@@ -4,6 +4,7 @@ CONFIG_NR_CPUS=4 ...@@ -4,6 +4,7 @@ CONFIG_NR_CPUS=4
CONFIG_EXPERIMENTAL=y CONFIG_EXPERIMENTAL=y
CONFIG_SYSVIPC=y CONFIG_SYSVIPC=y
CONFIG_POSIX_MQUEUE=y CONFIG_POSIX_MQUEUE=y
CONFIG_FHANDLE=y
CONFIG_IKCONFIG=y CONFIG_IKCONFIG=y
CONFIG_IKCONFIG_PROC=y CONFIG_IKCONFIG_PROC=y
# CONFIG_COMPAT_BRK is not set # CONFIG_COMPAT_BRK is not set
......
...@@ -3,6 +3,7 @@ CONFIG_ALTIVEC=y ...@@ -3,6 +3,7 @@ CONFIG_ALTIVEC=y
CONFIG_SMP=y CONFIG_SMP=y
CONFIG_NR_CPUS=2 CONFIG_NR_CPUS=2
CONFIG_SYSVIPC=y CONFIG_SYSVIPC=y
CONFIG_FHANDLE=y
CONFIG_NO_HZ=y CONFIG_NO_HZ=y
CONFIG_HIGH_RES_TIMERS=y CONFIG_HIGH_RES_TIMERS=y
CONFIG_BLK_DEV_INITRD=y CONFIG_BLK_DEV_INITRD=y
......
...@@ -4,6 +4,7 @@ CONFIG_VSX=y ...@@ -4,6 +4,7 @@ CONFIG_VSX=y
CONFIG_SMP=y CONFIG_SMP=y
CONFIG_SYSVIPC=y CONFIG_SYSVIPC=y
CONFIG_POSIX_MQUEUE=y CONFIG_POSIX_MQUEUE=y
CONFIG_FHANDLE=y
CONFIG_IRQ_DOMAIN_DEBUG=y CONFIG_IRQ_DOMAIN_DEBUG=y
CONFIG_NO_HZ=y CONFIG_NO_HZ=y
CONFIG_HIGH_RES_TIMERS=y CONFIG_HIGH_RES_TIMERS=y
......
...@@ -3,6 +3,7 @@ CONFIG_PPC_BOOK3E_64=y ...@@ -3,6 +3,7 @@ CONFIG_PPC_BOOK3E_64=y
CONFIG_SMP=y CONFIG_SMP=y
CONFIG_SYSVIPC=y CONFIG_SYSVIPC=y
CONFIG_POSIX_MQUEUE=y CONFIG_POSIX_MQUEUE=y
CONFIG_FHANDLE=y
CONFIG_NO_HZ=y CONFIG_NO_HZ=y
CONFIG_HIGH_RES_TIMERS=y CONFIG_HIGH_RES_TIMERS=y
CONFIG_TASKSTATS=y CONFIG_TASKSTATS=y
......
...@@ -5,6 +5,7 @@ CONFIG_SMP=y ...@@ -5,6 +5,7 @@ CONFIG_SMP=y
CONFIG_NR_CPUS=2 CONFIG_NR_CPUS=2
CONFIG_SYSVIPC=y CONFIG_SYSVIPC=y
CONFIG_POSIX_MQUEUE=y CONFIG_POSIX_MQUEUE=y
CONFIG_FHANDLE=y
CONFIG_HIGH_RES_TIMERS=y CONFIG_HIGH_RES_TIMERS=y
CONFIG_BLK_DEV_INITRD=y CONFIG_BLK_DEV_INITRD=y
CONFIG_RD_LZMA=y CONFIG_RD_LZMA=y
......
...@@ -5,6 +5,7 @@ CONFIG_SMP=y ...@@ -5,6 +5,7 @@ CONFIG_SMP=y
CONFIG_NR_CPUS=2048 CONFIG_NR_CPUS=2048
CONFIG_SYSVIPC=y CONFIG_SYSVIPC=y
CONFIG_POSIX_MQUEUE=y CONFIG_POSIX_MQUEUE=y
CONFIG_FHANDLE=y
CONFIG_AUDIT=y CONFIG_AUDIT=y
CONFIG_AUDITSYSCALL=y CONFIG_AUDITSYSCALL=y
CONFIG_IRQ_DOMAIN_DEBUG=y CONFIG_IRQ_DOMAIN_DEBUG=y
......
...@@ -6,6 +6,7 @@ CONFIG_NR_CPUS=2048 ...@@ -6,6 +6,7 @@ CONFIG_NR_CPUS=2048
CONFIG_CPU_LITTLE_ENDIAN=y CONFIG_CPU_LITTLE_ENDIAN=y
CONFIG_SYSVIPC=y CONFIG_SYSVIPC=y
CONFIG_POSIX_MQUEUE=y CONFIG_POSIX_MQUEUE=y
CONFIG_FHANDLE=y
CONFIG_AUDIT=y CONFIG_AUDIT=y
CONFIG_AUDITSYSCALL=y CONFIG_AUDITSYSCALL=y
CONFIG_IRQ_DOMAIN_DEBUG=y CONFIG_IRQ_DOMAIN_DEBUG=y
......
...@@ -47,6 +47,12 @@ ...@@ -47,6 +47,12 @@
STACK_FRAME_OVERHEAD + KERNEL_REDZONE_SIZE) STACK_FRAME_OVERHEAD + KERNEL_REDZONE_SIZE)
#define STACK_FRAME_MARKER 12 #define STACK_FRAME_MARKER 12
#if defined(_CALL_ELF) && _CALL_ELF == 2
#define STACK_FRAME_MIN_SIZE 32
#else
#define STACK_FRAME_MIN_SIZE STACK_FRAME_OVERHEAD
#endif
/* Size of dummy stack frame allocated when calling signal handler. */ /* Size of dummy stack frame allocated when calling signal handler. */
#define __SIGNAL_FRAMESIZE 128 #define __SIGNAL_FRAMESIZE 128
#define __SIGNAL_FRAMESIZE32 64 #define __SIGNAL_FRAMESIZE32 64
...@@ -60,6 +66,7 @@ ...@@ -60,6 +66,7 @@
#define STACK_FRAME_REGS_MARKER ASM_CONST(0x72656773) #define STACK_FRAME_REGS_MARKER ASM_CONST(0x72656773)
#define STACK_INT_FRAME_SIZE (sizeof(struct pt_regs) + STACK_FRAME_OVERHEAD) #define STACK_INT_FRAME_SIZE (sizeof(struct pt_regs) + STACK_FRAME_OVERHEAD)
#define STACK_FRAME_MARKER 2 #define STACK_FRAME_MARKER 2
#define STACK_FRAME_MIN_SIZE STACK_FRAME_OVERHEAD
/* Size of stack frame allocated when calling signal handler. */ /* Size of stack frame allocated when calling signal handler. */
#define __SIGNAL_FRAMESIZE 64 #define __SIGNAL_FRAMESIZE 64
......
...@@ -362,3 +362,6 @@ SYSCALL(ni_syscall) /* sys_kcmp */ ...@@ -362,3 +362,6 @@ SYSCALL(ni_syscall) /* sys_kcmp */
SYSCALL_SPU(sched_setattr) SYSCALL_SPU(sched_setattr)
SYSCALL_SPU(sched_getattr) SYSCALL_SPU(sched_getattr)
SYSCALL_SPU(renameat2) SYSCALL_SPU(renameat2)
SYSCALL_SPU(seccomp)
SYSCALL_SPU(getrandom)
SYSCALL_SPU(memfd_create)
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
#include <uapi/asm/unistd.h> #include <uapi/asm/unistd.h>
#define __NR_syscalls 358 #define __NR_syscalls 361
#define __NR__exit __NR_exit #define __NR__exit __NR_exit
#define NR_syscalls __NR_syscalls #define NR_syscalls __NR_syscalls
......
...@@ -380,5 +380,8 @@ ...@@ -380,5 +380,8 @@
#define __NR_sched_setattr 355 #define __NR_sched_setattr 355
#define __NR_sched_getattr 356 #define __NR_sched_getattr 356
#define __NR_renameat2 357 #define __NR_renameat2 357
#define __NR_seccomp 358
#define __NR_getrandom 359
#define __NR_memfd_create 360
#endif /* _UAPI_ASM_POWERPC_UNISTD_H_ */ #endif /* _UAPI_ASM_POWERPC_UNISTD_H_ */
...@@ -35,7 +35,7 @@ static int valid_next_sp(unsigned long sp, unsigned long prev_sp) ...@@ -35,7 +35,7 @@ static int valid_next_sp(unsigned long sp, unsigned long prev_sp)
return 0; /* must be 16-byte aligned */ return 0; /* must be 16-byte aligned */
if (!validate_sp(sp, current, STACK_FRAME_OVERHEAD)) if (!validate_sp(sp, current, STACK_FRAME_OVERHEAD))
return 0; return 0;
if (sp >= prev_sp + STACK_FRAME_OVERHEAD) if (sp >= prev_sp + STACK_FRAME_MIN_SIZE)
return 1; return 1;
/* /*
* sp could decrease when we jump off an interrupt stack * sp could decrease when we jump off an interrupt stack
......
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
#include <asm/opal.h> #include <asm/opal.h>
#include <asm/cputable.h> #include <asm/cputable.h>
#include <asm/machdep.h>
static int opal_hmi_handler_nb_init; static int opal_hmi_handler_nb_init;
struct OpalHmiEvtNode { struct OpalHmiEvtNode {
...@@ -185,4 +186,4 @@ static int __init opal_hmi_handler_init(void) ...@@ -185,4 +186,4 @@ static int __init opal_hmi_handler_init(void)
} }
return 0; return 0;
} }
subsys_initcall(opal_hmi_handler_init); machine_subsys_initcall(powernv, opal_hmi_handler_init);
...@@ -113,7 +113,7 @@ static int pseries_remove_memblock(unsigned long base, unsigned int memblock_siz ...@@ -113,7 +113,7 @@ static int pseries_remove_memblock(unsigned long base, unsigned int memblock_siz
static int pseries_remove_mem_node(struct device_node *np) static int pseries_remove_mem_node(struct device_node *np)
{ {
const char *type; const char *type;
const unsigned int *regs; const __be32 *regs;
unsigned long base; unsigned long base;
unsigned int lmb_size; unsigned int lmb_size;
int ret = -EINVAL; int ret = -EINVAL;
...@@ -132,8 +132,8 @@ static int pseries_remove_mem_node(struct device_node *np) ...@@ -132,8 +132,8 @@ static int pseries_remove_mem_node(struct device_node *np)
if (!regs) if (!regs)
return ret; return ret;
base = *(unsigned long *)regs; base = be64_to_cpu(*(unsigned long *)regs);
lmb_size = regs[3]; lmb_size = be32_to_cpu(regs[3]);
pseries_remove_memblock(base, lmb_size); pseries_remove_memblock(base, lmb_size);
return 0; return 0;
...@@ -153,7 +153,7 @@ static inline int pseries_remove_mem_node(struct device_node *np) ...@@ -153,7 +153,7 @@ static inline int pseries_remove_mem_node(struct device_node *np)
static int pseries_add_mem_node(struct device_node *np) static int pseries_add_mem_node(struct device_node *np)
{ {
const char *type; const char *type;
const unsigned int *regs; const __be32 *regs;
unsigned long base; unsigned long base;
unsigned int lmb_size; unsigned int lmb_size;
int ret = -EINVAL; int ret = -EINVAL;
...@@ -172,8 +172,8 @@ static int pseries_add_mem_node(struct device_node *np) ...@@ -172,8 +172,8 @@ static int pseries_add_mem_node(struct device_node *np)
if (!regs) if (!regs)
return ret; return ret;
base = *(unsigned long *)regs; base = be64_to_cpu(*(unsigned long *)regs);
lmb_size = regs[3]; lmb_size = be32_to_cpu(regs[3]);
/* /*
* Update memory region to represent the memory add * Update memory region to represent the memory add
...@@ -187,14 +187,14 @@ static int pseries_update_drconf_memory(struct of_prop_reconfig *pr) ...@@ -187,14 +187,14 @@ static int pseries_update_drconf_memory(struct of_prop_reconfig *pr)
struct of_drconf_cell *new_drmem, *old_drmem; struct of_drconf_cell *new_drmem, *old_drmem;
unsigned long memblock_size; unsigned long memblock_size;
u32 entries; u32 entries;
u32 *p; __be32 *p;
int i, rc = -EINVAL; int i, rc = -EINVAL;
memblock_size = pseries_memory_block_size(); memblock_size = pseries_memory_block_size();
if (!memblock_size) if (!memblock_size)
return -EINVAL; return -EINVAL;
p = (u32 *) pr->old_prop->value; p = (__be32 *) pr->old_prop->value;
if (!p) if (!p)
return -EINVAL; return -EINVAL;
...@@ -203,28 +203,30 @@ static int pseries_update_drconf_memory(struct of_prop_reconfig *pr) ...@@ -203,28 +203,30 @@ static int pseries_update_drconf_memory(struct of_prop_reconfig *pr)
* entries. Get the niumber of entries and skip to the array of * entries. Get the niumber of entries and skip to the array of
* of_drconf_cell's. * of_drconf_cell's.
*/ */
entries = *p++; entries = be32_to_cpu(*p++);
old_drmem = (struct of_drconf_cell *)p; old_drmem = (struct of_drconf_cell *)p;
p = (u32 *)pr->prop->value; p = (__be32 *)pr->prop->value;
p++; p++;
new_drmem = (struct of_drconf_cell *)p; new_drmem = (struct of_drconf_cell *)p;
for (i = 0; i < entries; i++) { for (i = 0; i < entries; i++) {
if ((old_drmem[i].flags & DRCONF_MEM_ASSIGNED) && if ((be32_to_cpu(old_drmem[i].flags) & DRCONF_MEM_ASSIGNED) &&
(!(new_drmem[i].flags & DRCONF_MEM_ASSIGNED))) { (!(be32_to_cpu(new_drmem[i].flags) & DRCONF_MEM_ASSIGNED))) {
rc = pseries_remove_memblock(old_drmem[i].base_addr, rc = pseries_remove_memblock(
be64_to_cpu(old_drmem[i].base_addr),
memblock_size); memblock_size);
break; break;
} else if ((!(old_drmem[i].flags & DRCONF_MEM_ASSIGNED)) && } else if ((!(be32_to_cpu(old_drmem[i].flags) &
(new_drmem[i].flags & DRCONF_MEM_ASSIGNED)) { DRCONF_MEM_ASSIGNED)) &&
rc = memblock_add(old_drmem[i].base_addr, (be32_to_cpu(new_drmem[i].flags) &
DRCONF_MEM_ASSIGNED)) {
rc = memblock_add(be64_to_cpu(old_drmem[i].base_addr),
memblock_size); memblock_size);
rc = (rc < 0) ? -EINVAL : 0; rc = (rc < 0) ? -EINVAL : 0;
break; break;
} }
} }
return rc; return rc;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment