diff options
| -rw-r--r-- | arch/powerpc/configs/cell_defconfig | 1 | ||||
| -rw-r--r-- | arch/powerpc/configs/celleb_defconfig | 1 | ||||
| -rw-r--r-- | arch/powerpc/configs/corenet64_smp_defconfig | 1 | ||||
| -rw-r--r-- | arch/powerpc/configs/g5_defconfig | 1 | ||||
| -rw-r--r-- | arch/powerpc/configs/maple_defconfig | 1 | ||||
| -rw-r--r-- | arch/powerpc/configs/pasemi_defconfig | 1 | ||||
| -rw-r--r-- | arch/powerpc/configs/ppc64_defconfig | 1 | ||||
| -rw-r--r-- | arch/powerpc/configs/ppc64e_defconfig | 1 | ||||
| -rw-r--r-- | arch/powerpc/configs/ps3_defconfig | 1 | ||||
| -rw-r--r-- | arch/powerpc/configs/pseries_defconfig | 1 | ||||
| -rw-r--r-- | arch/powerpc/configs/pseries_le_defconfig | 1 | ||||
| -rw-r--r-- | arch/powerpc/include/asm/ptrace.h | 7 | ||||
| -rw-r--r-- | arch/powerpc/include/asm/systbl.h | 3 | ||||
| -rw-r--r-- | arch/powerpc/include/asm/unistd.h | 2 | ||||
| -rw-r--r-- | arch/powerpc/include/uapi/asm/unistd.h | 3 | ||||
| -rw-r--r-- | arch/powerpc/perf/callchain.c | 2 | ||||
| -rw-r--r-- | arch/powerpc/platforms/powernv/opal-hmi.c | 3 | ||||
| -rw-r--r-- | arch/powerpc/platforms/pseries/hotplug-memory.c | 36 |
18 files changed, 47 insertions, 20 deletions
diff --git a/arch/powerpc/configs/cell_defconfig b/arch/powerpc/configs/cell_defconfig index 4bee1a6d41d0..45fd06cdc3e8 100644 --- a/arch/powerpc/configs/cell_defconfig +++ b/arch/powerpc/configs/cell_defconfig | |||
| @@ -5,6 +5,7 @@ CONFIG_SMP=y | |||
| 5 | CONFIG_NR_CPUS=4 | 5 | CONFIG_NR_CPUS=4 |
| 6 | CONFIG_EXPERIMENTAL=y | 6 | CONFIG_EXPERIMENTAL=y |
| 7 | CONFIG_SYSVIPC=y | 7 | CONFIG_SYSVIPC=y |
| 8 | CONFIG_FHANDLE=y | ||
| 8 | CONFIG_IKCONFIG=y | 9 | CONFIG_IKCONFIG=y |
| 9 | CONFIG_IKCONFIG_PROC=y | 10 | CONFIG_IKCONFIG_PROC=y |
| 10 | CONFIG_LOG_BUF_SHIFT=15 | 11 | CONFIG_LOG_BUF_SHIFT=15 |
diff --git a/arch/powerpc/configs/celleb_defconfig b/arch/powerpc/configs/celleb_defconfig index 6d7b22f41b50..77d7bf3ca2ac 100644 --- a/arch/powerpc/configs/celleb_defconfig +++ b/arch/powerpc/configs/celleb_defconfig | |||
| @@ -5,6 +5,7 @@ CONFIG_SMP=y | |||
| 5 | CONFIG_NR_CPUS=4 | 5 | CONFIG_NR_CPUS=4 |
| 6 | CONFIG_EXPERIMENTAL=y | 6 | CONFIG_EXPERIMENTAL=y |
| 7 | CONFIG_SYSVIPC=y | 7 | CONFIG_SYSVIPC=y |
| 8 | CONFIG_FHANDLE=y | ||
| 8 | CONFIG_IKCONFIG=y | 9 | CONFIG_IKCONFIG=y |
| 9 | CONFIG_IKCONFIG_PROC=y | 10 | CONFIG_IKCONFIG_PROC=y |
| 10 | CONFIG_LOG_BUF_SHIFT=15 | 11 | CONFIG_LOG_BUF_SHIFT=15 |
diff --git a/arch/powerpc/configs/corenet64_smp_defconfig b/arch/powerpc/configs/corenet64_smp_defconfig index 4b07bade1ba9..269d6e47c67d 100644 --- a/arch/powerpc/configs/corenet64_smp_defconfig +++ b/arch/powerpc/configs/corenet64_smp_defconfig | |||
| @@ -4,6 +4,7 @@ CONFIG_ALTIVEC=y | |||
| 4 | CONFIG_SMP=y | 4 | CONFIG_SMP=y |
| 5 | CONFIG_NR_CPUS=24 | 5 | CONFIG_NR_CPUS=24 |
| 6 | CONFIG_SYSVIPC=y | 6 | CONFIG_SYSVIPC=y |
| 7 | CONFIG_FHANDLE=y | ||
| 7 | CONFIG_IRQ_DOMAIN_DEBUG=y | 8 | CONFIG_IRQ_DOMAIN_DEBUG=y |
| 8 | CONFIG_NO_HZ=y | 9 | CONFIG_NO_HZ=y |
| 9 | CONFIG_HIGH_RES_TIMERS=y | 10 | CONFIG_HIGH_RES_TIMERS=y |
diff --git a/arch/powerpc/configs/g5_defconfig b/arch/powerpc/configs/g5_defconfig index 3c72fa615bd9..7594c5ac6481 100644 --- a/arch/powerpc/configs/g5_defconfig +++ b/arch/powerpc/configs/g5_defconfig | |||
| @@ -5,6 +5,7 @@ CONFIG_NR_CPUS=4 | |||
| 5 | CONFIG_EXPERIMENTAL=y | 5 | CONFIG_EXPERIMENTAL=y |
| 6 | CONFIG_SYSVIPC=y | 6 | CONFIG_SYSVIPC=y |
| 7 | CONFIG_POSIX_MQUEUE=y | 7 | CONFIG_POSIX_MQUEUE=y |
| 8 | CONFIG_FHANDLE=y | ||
| 8 | CONFIG_IKCONFIG=y | 9 | CONFIG_IKCONFIG=y |
| 9 | CONFIG_IKCONFIG_PROC=y | 10 | CONFIG_IKCONFIG_PROC=y |
| 10 | CONFIG_BLK_DEV_INITRD=y | 11 | CONFIG_BLK_DEV_INITRD=y |
diff --git a/arch/powerpc/configs/maple_defconfig b/arch/powerpc/configs/maple_defconfig index 95e545d9f25c..c8b6a9ddb21b 100644 --- a/arch/powerpc/configs/maple_defconfig +++ b/arch/powerpc/configs/maple_defconfig | |||
| @@ -4,6 +4,7 @@ CONFIG_NR_CPUS=4 | |||
| 4 | CONFIG_EXPERIMENTAL=y | 4 | CONFIG_EXPERIMENTAL=y |
| 5 | CONFIG_SYSVIPC=y | 5 | CONFIG_SYSVIPC=y |
| 6 | CONFIG_POSIX_MQUEUE=y | 6 | CONFIG_POSIX_MQUEUE=y |
| 7 | CONFIG_FHANDLE=y | ||
| 7 | CONFIG_IKCONFIG=y | 8 | CONFIG_IKCONFIG=y |
| 8 | CONFIG_IKCONFIG_PROC=y | 9 | CONFIG_IKCONFIG_PROC=y |
| 9 | # CONFIG_COMPAT_BRK is not set | 10 | # CONFIG_COMPAT_BRK is not set |
diff --git a/arch/powerpc/configs/pasemi_defconfig b/arch/powerpc/configs/pasemi_defconfig index cec044a3ff69..e5e7838af008 100644 --- a/arch/powerpc/configs/pasemi_defconfig +++ b/arch/powerpc/configs/pasemi_defconfig | |||
| @@ -3,6 +3,7 @@ CONFIG_ALTIVEC=y | |||
| 3 | CONFIG_SMP=y | 3 | CONFIG_SMP=y |
| 4 | CONFIG_NR_CPUS=2 | 4 | CONFIG_NR_CPUS=2 |
| 5 | CONFIG_SYSVIPC=y | 5 | CONFIG_SYSVIPC=y |
| 6 | CONFIG_FHANDLE=y | ||
| 6 | CONFIG_NO_HZ=y | 7 | CONFIG_NO_HZ=y |
| 7 | CONFIG_HIGH_RES_TIMERS=y | 8 | CONFIG_HIGH_RES_TIMERS=y |
| 8 | CONFIG_BLK_DEV_INITRD=y | 9 | CONFIG_BLK_DEV_INITRD=y |
diff --git a/arch/powerpc/configs/ppc64_defconfig b/arch/powerpc/configs/ppc64_defconfig index f26b267eb71f..f6c02f8cdc62 100644 --- a/arch/powerpc/configs/ppc64_defconfig +++ b/arch/powerpc/configs/ppc64_defconfig | |||
| @@ -4,6 +4,7 @@ CONFIG_VSX=y | |||
| 4 | CONFIG_SMP=y | 4 | CONFIG_SMP=y |
| 5 | CONFIG_SYSVIPC=y | 5 | CONFIG_SYSVIPC=y |
| 6 | CONFIG_POSIX_MQUEUE=y | 6 | CONFIG_POSIX_MQUEUE=y |
| 7 | CONFIG_FHANDLE=y | ||
| 7 | CONFIG_IRQ_DOMAIN_DEBUG=y | 8 | CONFIG_IRQ_DOMAIN_DEBUG=y |
| 8 | CONFIG_NO_HZ=y | 9 | CONFIG_NO_HZ=y |
| 9 | CONFIG_HIGH_RES_TIMERS=y | 10 | CONFIG_HIGH_RES_TIMERS=y |
diff --git a/arch/powerpc/configs/ppc64e_defconfig b/arch/powerpc/configs/ppc64e_defconfig index 438e813dc9cb..587f5514f9b1 100644 --- a/arch/powerpc/configs/ppc64e_defconfig +++ b/arch/powerpc/configs/ppc64e_defconfig | |||
| @@ -3,6 +3,7 @@ CONFIG_PPC_BOOK3E_64=y | |||
| 3 | CONFIG_SMP=y | 3 | CONFIG_SMP=y |
| 4 | CONFIG_SYSVIPC=y | 4 | CONFIG_SYSVIPC=y |
| 5 | CONFIG_POSIX_MQUEUE=y | 5 | CONFIG_POSIX_MQUEUE=y |
| 6 | CONFIG_FHANDLE=y | ||
| 6 | CONFIG_NO_HZ=y | 7 | CONFIG_NO_HZ=y |
| 7 | CONFIG_HIGH_RES_TIMERS=y | 8 | CONFIG_HIGH_RES_TIMERS=y |
| 8 | CONFIG_TASKSTATS=y | 9 | CONFIG_TASKSTATS=y |
diff --git a/arch/powerpc/configs/ps3_defconfig b/arch/powerpc/configs/ps3_defconfig index fdee37fab81c..2e637c881d2b 100644 --- a/arch/powerpc/configs/ps3_defconfig +++ b/arch/powerpc/configs/ps3_defconfig | |||
| @@ -5,6 +5,7 @@ CONFIG_SMP=y | |||
| 5 | CONFIG_NR_CPUS=2 | 5 | CONFIG_NR_CPUS=2 |
| 6 | CONFIG_SYSVIPC=y | 6 | CONFIG_SYSVIPC=y |
| 7 | CONFIG_POSIX_MQUEUE=y | 7 | CONFIG_POSIX_MQUEUE=y |
| 8 | CONFIG_FHANDLE=y | ||
| 8 | CONFIG_HIGH_RES_TIMERS=y | 9 | CONFIG_HIGH_RES_TIMERS=y |
| 9 | CONFIG_BLK_DEV_INITRD=y | 10 | CONFIG_BLK_DEV_INITRD=y |
| 10 | CONFIG_RD_LZMA=y | 11 | CONFIG_RD_LZMA=y |
diff --git a/arch/powerpc/configs/pseries_defconfig b/arch/powerpc/configs/pseries_defconfig index a905063281cc..50375f1f59e7 100644 --- a/arch/powerpc/configs/pseries_defconfig +++ b/arch/powerpc/configs/pseries_defconfig | |||
| @@ -5,6 +5,7 @@ CONFIG_SMP=y | |||
| 5 | CONFIG_NR_CPUS=2048 | 5 | CONFIG_NR_CPUS=2048 |
| 6 | CONFIG_SYSVIPC=y | 6 | CONFIG_SYSVIPC=y |
| 7 | CONFIG_POSIX_MQUEUE=y | 7 | CONFIG_POSIX_MQUEUE=y |
| 8 | CONFIG_FHANDLE=y | ||
| 8 | CONFIG_AUDIT=y | 9 | CONFIG_AUDIT=y |
| 9 | CONFIG_AUDITSYSCALL=y | 10 | CONFIG_AUDITSYSCALL=y |
| 10 | CONFIG_IRQ_DOMAIN_DEBUG=y | 11 | CONFIG_IRQ_DOMAIN_DEBUG=y |
diff --git a/arch/powerpc/configs/pseries_le_defconfig b/arch/powerpc/configs/pseries_le_defconfig index 58e3dbf43ca4..4428ee428f4e 100644 --- a/arch/powerpc/configs/pseries_le_defconfig +++ b/arch/powerpc/configs/pseries_le_defconfig | |||
| @@ -6,6 +6,7 @@ CONFIG_NR_CPUS=2048 | |||
| 6 | CONFIG_CPU_LITTLE_ENDIAN=y | 6 | CONFIG_CPU_LITTLE_ENDIAN=y |
| 7 | CONFIG_SYSVIPC=y | 7 | CONFIG_SYSVIPC=y |
| 8 | CONFIG_POSIX_MQUEUE=y | 8 | CONFIG_POSIX_MQUEUE=y |
| 9 | CONFIG_FHANDLE=y | ||
| 9 | CONFIG_AUDIT=y | 10 | CONFIG_AUDIT=y |
| 10 | CONFIG_AUDITSYSCALL=y | 11 | CONFIG_AUDITSYSCALL=y |
| 11 | CONFIG_IRQ_DOMAIN_DEBUG=y | 12 | CONFIG_IRQ_DOMAIN_DEBUG=y |
diff --git a/arch/powerpc/include/asm/ptrace.h b/arch/powerpc/include/asm/ptrace.h index 279b80f3bb29..c0c61fa9cd9e 100644 --- a/arch/powerpc/include/asm/ptrace.h +++ b/arch/powerpc/include/asm/ptrace.h | |||
| @@ -47,6 +47,12 @@ | |||
| 47 | STACK_FRAME_OVERHEAD + KERNEL_REDZONE_SIZE) | 47 | STACK_FRAME_OVERHEAD + KERNEL_REDZONE_SIZE) |
| 48 | #define STACK_FRAME_MARKER 12 | 48 | #define STACK_FRAME_MARKER 12 |
| 49 | 49 | ||
| 50 | #if defined(_CALL_ELF) && _CALL_ELF == 2 | ||
| 51 | #define STACK_FRAME_MIN_SIZE 32 | ||
| 52 | #else | ||
| 53 | #define STACK_FRAME_MIN_SIZE STACK_FRAME_OVERHEAD | ||
| 54 | #endif | ||
| 55 | |||
| 50 | /* Size of dummy stack frame allocated when calling signal handler. */ | 56 | /* Size of dummy stack frame allocated when calling signal handler. */ |
| 51 | #define __SIGNAL_FRAMESIZE 128 | 57 | #define __SIGNAL_FRAMESIZE 128 |
| 52 | #define __SIGNAL_FRAMESIZE32 64 | 58 | #define __SIGNAL_FRAMESIZE32 64 |
| @@ -60,6 +66,7 @@ | |||
| 60 | #define STACK_FRAME_REGS_MARKER ASM_CONST(0x72656773) | 66 | #define STACK_FRAME_REGS_MARKER ASM_CONST(0x72656773) |
| 61 | #define STACK_INT_FRAME_SIZE (sizeof(struct pt_regs) + STACK_FRAME_OVERHEAD) | 67 | #define STACK_INT_FRAME_SIZE (sizeof(struct pt_regs) + STACK_FRAME_OVERHEAD) |
| 62 | #define STACK_FRAME_MARKER 2 | 68 | #define STACK_FRAME_MARKER 2 |
| 69 | #define STACK_FRAME_MIN_SIZE STACK_FRAME_OVERHEAD | ||
| 63 | 70 | ||
| 64 | /* Size of stack frame allocated when calling signal handler. */ | 71 | /* Size of stack frame allocated when calling signal handler. */ |
| 65 | #define __SIGNAL_FRAMESIZE 64 | 72 | #define __SIGNAL_FRAMESIZE 64 |
diff --git a/arch/powerpc/include/asm/systbl.h b/arch/powerpc/include/asm/systbl.h index 542bc0f0673f..7d8a60068805 100644 --- a/arch/powerpc/include/asm/systbl.h +++ b/arch/powerpc/include/asm/systbl.h | |||
| @@ -362,3 +362,6 @@ SYSCALL(ni_syscall) /* sys_kcmp */ | |||
| 362 | SYSCALL_SPU(sched_setattr) | 362 | SYSCALL_SPU(sched_setattr) |
| 363 | SYSCALL_SPU(sched_getattr) | 363 | SYSCALL_SPU(sched_getattr) |
| 364 | SYSCALL_SPU(renameat2) | 364 | SYSCALL_SPU(renameat2) |
| 365 | SYSCALL_SPU(seccomp) | ||
| 366 | SYSCALL_SPU(getrandom) | ||
| 367 | SYSCALL_SPU(memfd_create) | ||
diff --git a/arch/powerpc/include/asm/unistd.h b/arch/powerpc/include/asm/unistd.h index 5ce5552ab9f5..4e9af3fd43e7 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 358 | 15 | #define __NR_syscalls 361 |
| 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 2d526f7b48da..0688fc06e183 100644 --- a/arch/powerpc/include/uapi/asm/unistd.h +++ b/arch/powerpc/include/uapi/asm/unistd.h | |||
| @@ -380,5 +380,8 @@ | |||
| 380 | #define __NR_sched_setattr 355 | 380 | #define __NR_sched_setattr 355 |
| 381 | #define __NR_sched_getattr 356 | 381 | #define __NR_sched_getattr 356 |
| 382 | #define __NR_renameat2 357 | 382 | #define __NR_renameat2 357 |
| 383 | #define __NR_seccomp 358 | ||
| 384 | #define __NR_getrandom 359 | ||
| 385 | #define __NR_memfd_create 360 | ||
| 383 | 386 | ||
| 384 | #endif /* _UAPI_ASM_POWERPC_UNISTD_H_ */ | 387 | #endif /* _UAPI_ASM_POWERPC_UNISTD_H_ */ |
diff --git a/arch/powerpc/perf/callchain.c b/arch/powerpc/perf/callchain.c index 74d1e780748b..2396dda282cd 100644 --- a/arch/powerpc/perf/callchain.c +++ b/arch/powerpc/perf/callchain.c | |||
| @@ -35,7 +35,7 @@ static int valid_next_sp(unsigned long sp, unsigned long prev_sp) | |||
| 35 | return 0; /* must be 16-byte aligned */ | 35 | return 0; /* must be 16-byte aligned */ |
| 36 | if (!validate_sp(sp, current, STACK_FRAME_OVERHEAD)) | 36 | if (!validate_sp(sp, current, STACK_FRAME_OVERHEAD)) |
| 37 | return 0; | 37 | return 0; |
| 38 | if (sp >= prev_sp + STACK_FRAME_OVERHEAD) | 38 | if (sp >= prev_sp + STACK_FRAME_MIN_SIZE) |
| 39 | return 1; | 39 | return 1; |
| 40 | /* | 40 | /* |
| 41 | * sp could decrease when we jump off an interrupt stack | 41 | * sp could decrease when we jump off an interrupt stack |
diff --git a/arch/powerpc/platforms/powernv/opal-hmi.c b/arch/powerpc/platforms/powernv/opal-hmi.c index 97ac8dc33667..5e1ed1575aab 100644 --- a/arch/powerpc/platforms/powernv/opal-hmi.c +++ b/arch/powerpc/platforms/powernv/opal-hmi.c | |||
| @@ -28,6 +28,7 @@ | |||
| 28 | 28 | ||
| 29 | #include <asm/opal.h> | 29 | #include <asm/opal.h> |
| 30 | #include <asm/cputable.h> | 30 | #include <asm/cputable.h> |
| 31 | #include <asm/machdep.h> | ||
| 31 | 32 | ||
| 32 | static int opal_hmi_handler_nb_init; | 33 | static int opal_hmi_handler_nb_init; |
| 33 | struct OpalHmiEvtNode { | 34 | struct OpalHmiEvtNode { |
| @@ -185,4 +186,4 @@ static int __init opal_hmi_handler_init(void) | |||
| 185 | } | 186 | } |
| 186 | return 0; | 187 | return 0; |
| 187 | } | 188 | } |
| 188 | subsys_initcall(opal_hmi_handler_init); | 189 | machine_subsys_initcall(powernv, opal_hmi_handler_init); |
diff --git a/arch/powerpc/platforms/pseries/hotplug-memory.c b/arch/powerpc/platforms/pseries/hotplug-memory.c index c904583baf4b..17ee193960a0 100644 --- a/arch/powerpc/platforms/pseries/hotplug-memory.c +++ b/arch/powerpc/platforms/pseries/hotplug-memory.c | |||
| @@ -113,7 +113,7 @@ out: | |||
| 113 | static int pseries_remove_mem_node(struct device_node *np) | 113 | static int pseries_remove_mem_node(struct device_node *np) |
| 114 | { | 114 | { |
| 115 | const char *type; | 115 | const char *type; |
| 116 | const unsigned int *regs; | 116 | const __be32 *regs; |
| 117 | unsigned long base; | 117 | unsigned long base; |
| 118 | unsigned int lmb_size; | 118 | unsigned int lmb_size; |
| 119 | int ret = -EINVAL; | 119 | int ret = -EINVAL; |
| @@ -132,8 +132,8 @@ static int pseries_remove_mem_node(struct device_node *np) | |||
| 132 | if (!regs) | 132 | if (!regs) |
| 133 | return ret; | 133 | return ret; |
| 134 | 134 | ||
| 135 | base = *(unsigned long *)regs; | 135 | base = be64_to_cpu(*(unsigned long *)regs); |
| 136 | lmb_size = regs[3]; | 136 | lmb_size = be32_to_cpu(regs[3]); |
| 137 | 137 | ||
| 138 | pseries_remove_memblock(base, lmb_size); | 138 | pseries_remove_memblock(base, lmb_size); |
| 139 | return 0; | 139 | return 0; |
| @@ -153,7 +153,7 @@ static inline int pseries_remove_mem_node(struct device_node *np) | |||
| 153 | static int pseries_add_mem_node(struct device_node *np) | 153 | static int pseries_add_mem_node(struct device_node *np) |
| 154 | { | 154 | { |
| 155 | const char *type; | 155 | const char *type; |
| 156 | const unsigned int *regs; | 156 | const __be32 *regs; |
| 157 | unsigned long base; | 157 | unsigned long base; |
| 158 | unsigned int lmb_size; | 158 | unsigned int lmb_size; |
| 159 | int ret = -EINVAL; | 159 | int ret = -EINVAL; |
| @@ -172,8 +172,8 @@ static int pseries_add_mem_node(struct device_node *np) | |||
| 172 | if (!regs) | 172 | if (!regs) |
| 173 | return ret; | 173 | return ret; |
| 174 | 174 | ||
| 175 | base = *(unsigned long *)regs; | 175 | base = be64_to_cpu(*(unsigned long *)regs); |
| 176 | lmb_size = regs[3]; | 176 | lmb_size = be32_to_cpu(regs[3]); |
| 177 | 177 | ||
| 178 | /* | 178 | /* |
| 179 | * Update memory region to represent the memory add | 179 | * Update memory region to represent the memory add |
| @@ -187,14 +187,14 @@ static int pseries_update_drconf_memory(struct of_prop_reconfig *pr) | |||
| 187 | struct of_drconf_cell *new_drmem, *old_drmem; | 187 | struct of_drconf_cell *new_drmem, *old_drmem; |
| 188 | unsigned long memblock_size; | 188 | unsigned long memblock_size; |
| 189 | u32 entries; | 189 | u32 entries; |
| 190 | u32 *p; | 190 | __be32 *p; |
| 191 | int i, rc = -EINVAL; | 191 | int i, rc = -EINVAL; |
| 192 | 192 | ||
| 193 | memblock_size = pseries_memory_block_size(); | 193 | memblock_size = pseries_memory_block_size(); |
| 194 | if (!memblock_size) | 194 | if (!memblock_size) |
| 195 | return -EINVAL; | 195 | return -EINVAL; |
| 196 | 196 | ||
| 197 | p = (u32 *) pr->old_prop->value; | 197 | p = (__be32 *) pr->old_prop->value; |
| 198 | if (!p) | 198 | if (!p) |
| 199 | return -EINVAL; | 199 | return -EINVAL; |
| 200 | 200 | ||
| @@ -203,28 +203,30 @@ static int pseries_update_drconf_memory(struct of_prop_reconfig *pr) | |||
| 203 | * entries. Get the niumber of entries and skip to the array of | 203 | * entries. Get the niumber of entries and skip to the array of |
| 204 | * of_drconf_cell's. | 204 | * of_drconf_cell's. |
| 205 | */ | 205 | */ |
| 206 | entries = *p++; | 206 | entries = be32_to_cpu(*p++); |
| 207 | old_drmem = (struct of_drconf_cell *)p; | 207 | old_drmem = (struct of_drconf_cell *)p; |
| 208 | 208 | ||
| 209 | p = (u32 *)pr->prop->value; | 209 | p = (__be32 *)pr->prop->value; |
| 210 | p++; | 210 | p++; |
| 211 | new_drmem = (struct of_drconf_cell *)p; | 211 | new_drmem = (struct of_drconf_cell *)p; |
| 212 | 212 | ||
| 213 | for (i = 0; i < entries; i++) { | 213 | for (i = 0; i < entries; i++) { |
| 214 | if ((old_drmem[i].flags & DRCONF_MEM_ASSIGNED) && | 214 | if ((be32_to_cpu(old_drmem[i].flags) & DRCONF_MEM_ASSIGNED) && |
| 215 | (!(new_drmem[i].flags & DRCONF_MEM_ASSIGNED))) { | 215 | (!(be32_to_cpu(new_drmem[i].flags) & DRCONF_MEM_ASSIGNED))) { |
| 216 | rc = pseries_remove_memblock(old_drmem[i].base_addr, | 216 | rc = pseries_remove_memblock( |
| 217 | be64_to_cpu(old_drmem[i].base_addr), | ||
| 217 | memblock_size); | 218 | memblock_size); |
| 218 | break; | 219 | break; |
| 219 | } else if ((!(old_drmem[i].flags & DRCONF_MEM_ASSIGNED)) && | 220 | } else if ((!(be32_to_cpu(old_drmem[i].flags) & |
| 220 | (new_drmem[i].flags & DRCONF_MEM_ASSIGNED)) { | 221 | DRCONF_MEM_ASSIGNED)) && |
| 221 | rc = memblock_add(old_drmem[i].base_addr, | 222 | (be32_to_cpu(new_drmem[i].flags) & |
| 223 | DRCONF_MEM_ASSIGNED)) { | ||
| 224 | rc = memblock_add(be64_to_cpu(old_drmem[i].base_addr), | ||
| 222 | memblock_size); | 225 | memblock_size); |
| 223 | rc = (rc < 0) ? -EINVAL : 0; | 226 | rc = (rc < 0) ? -EINVAL : 0; |
| 224 | break; | 227 | break; |
| 225 | } | 228 | } |
| 226 | } | 229 | } |
| 227 | |||
| 228 | return rc; | 230 | return rc; |
| 229 | } | 231 | } |
| 230 | 232 | ||
