diff options
Diffstat (limited to 'arch/powerpc')
-rw-r--r-- | arch/powerpc/include/asm/posix_types.h | 3 | ||||
-rw-r--r-- | arch/powerpc/include/asm/stat.h | 4 | ||||
-rw-r--r-- | arch/powerpc/include/asm/thread_info.h | 18 | ||||
-rw-r--r-- | arch/powerpc/kernel/signal.c | 38 | ||||
-rw-r--r-- | arch/powerpc/kernel/signal.h | 3 | ||||
-rw-r--r-- | arch/powerpc/kernel/signal_32.c | 4 | ||||
-rw-r--r-- | arch/powerpc/kernel/signal_64.c | 4 | ||||
-rw-r--r-- | arch/powerpc/mm/mmu_context_nohash.c | 11 | ||||
-rw-r--r-- | arch/powerpc/platforms/cell/spufs/inode.c | 2 |
9 files changed, 29 insertions, 58 deletions
diff --git a/arch/powerpc/include/asm/posix_types.h b/arch/powerpc/include/asm/posix_types.h index f1393252bbda..2958c5b97b2d 100644 --- a/arch/powerpc/include/asm/posix_types.h +++ b/arch/powerpc/include/asm/posix_types.h | |||
@@ -16,9 +16,6 @@ typedef int __kernel_ssize_t; | |||
16 | typedef long __kernel_ptrdiff_t; | 16 | typedef long __kernel_ptrdiff_t; |
17 | #define __kernel_size_t __kernel_size_t | 17 | #define __kernel_size_t __kernel_size_t |
18 | 18 | ||
19 | typedef unsigned short __kernel_nlink_t; | ||
20 | #define __kernel_nlink_t __kernel_nlink_t | ||
21 | |||
22 | typedef short __kernel_ipc_pid_t; | 19 | typedef short __kernel_ipc_pid_t; |
23 | #define __kernel_ipc_pid_t __kernel_ipc_pid_t | 20 | #define __kernel_ipc_pid_t __kernel_ipc_pid_t |
24 | #endif | 21 | #endif |
diff --git a/arch/powerpc/include/asm/stat.h b/arch/powerpc/include/asm/stat.h index e4edc510b530..84880b80cc1c 100644 --- a/arch/powerpc/include/asm/stat.h +++ b/arch/powerpc/include/asm/stat.h | |||
@@ -30,11 +30,11 @@ struct stat { | |||
30 | unsigned long st_dev; | 30 | unsigned long st_dev; |
31 | ino_t st_ino; | 31 | ino_t st_ino; |
32 | #ifdef __powerpc64__ | 32 | #ifdef __powerpc64__ |
33 | nlink_t st_nlink; | 33 | unsigned long st_nlink; |
34 | mode_t st_mode; | 34 | mode_t st_mode; |
35 | #else | 35 | #else |
36 | mode_t st_mode; | 36 | mode_t st_mode; |
37 | nlink_t st_nlink; | 37 | unsigned short st_nlink; |
38 | #endif | 38 | #endif |
39 | uid_t st_uid; | 39 | uid_t st_uid; |
40 | gid_t st_gid; | 40 | gid_t st_gid; |
diff --git a/arch/powerpc/include/asm/thread_info.h b/arch/powerpc/include/asm/thread_info.h index a556ccc16b58..68831e9cf82f 100644 --- a/arch/powerpc/include/asm/thread_info.h +++ b/arch/powerpc/include/asm/thread_info.h | |||
@@ -140,7 +140,23 @@ static inline void set_restore_sigmask(void) | |||
140 | { | 140 | { |
141 | struct thread_info *ti = current_thread_info(); | 141 | struct thread_info *ti = current_thread_info(); |
142 | ti->local_flags |= _TLF_RESTORE_SIGMASK; | 142 | ti->local_flags |= _TLF_RESTORE_SIGMASK; |
143 | set_bit(TIF_SIGPENDING, &ti->flags); | 143 | WARN_ON(!test_bit(TIF_SIGPENDING, &ti->flags)); |
144 | } | ||
145 | static inline void clear_restore_sigmask(void) | ||
146 | { | ||
147 | current_thread_info()->local_flags &= ~_TLF_RESTORE_SIGMASK; | ||
148 | } | ||
149 | static inline bool test_restore_sigmask(void) | ||
150 | { | ||
151 | return current_thread_info()->local_flags & _TLF_RESTORE_SIGMASK; | ||
152 | } | ||
153 | static inline bool test_and_clear_restore_sigmask(void) | ||
154 | { | ||
155 | struct thread_info *ti = current_thread_info(); | ||
156 | if (!(ti->local_flags & _TLF_RESTORE_SIGMASK)) | ||
157 | return false; | ||
158 | ti->local_flags &= ~_TLF_RESTORE_SIGMASK; | ||
159 | return true; | ||
144 | } | 160 | } |
145 | 161 | ||
146 | static inline bool test_thread_local_flags(unsigned int flags) | 162 | static inline bool test_thread_local_flags(unsigned int flags) |
diff --git a/arch/powerpc/kernel/signal.c b/arch/powerpc/kernel/signal.c index 651c5963662b..5c023c9cf16e 100644 --- a/arch/powerpc/kernel/signal.c +++ b/arch/powerpc/kernel/signal.c | |||
@@ -51,16 +51,6 @@ void __user * get_sigframe(struct k_sigaction *ka, struct pt_regs *regs, | |||
51 | return (void __user *)newsp; | 51 | return (void __user *)newsp; |
52 | } | 52 | } |
53 | 53 | ||
54 | |||
55 | /* | ||
56 | * Restore the user process's signal mask | ||
57 | */ | ||
58 | void restore_sigmask(sigset_t *set) | ||
59 | { | ||
60 | sigdelsetmask(set, ~_BLOCKABLE); | ||
61 | set_current_blocked(set); | ||
62 | } | ||
63 | |||
64 | static void check_syscall_restart(struct pt_regs *regs, struct k_sigaction *ka, | 54 | static void check_syscall_restart(struct pt_regs *regs, struct k_sigaction *ka, |
65 | int has_handler) | 55 | int has_handler) |
66 | { | 56 | { |
@@ -114,30 +104,21 @@ static void check_syscall_restart(struct pt_regs *regs, struct k_sigaction *ka, | |||
114 | 104 | ||
115 | static int do_signal(struct pt_regs *regs) | 105 | static int do_signal(struct pt_regs *regs) |
116 | { | 106 | { |
117 | sigset_t *oldset; | 107 | sigset_t *oldset = sigmask_to_save(); |
118 | siginfo_t info; | 108 | siginfo_t info; |
119 | int signr; | 109 | int signr; |
120 | struct k_sigaction ka; | 110 | struct k_sigaction ka; |
121 | int ret; | 111 | int ret; |
122 | int is32 = is_32bit_task(); | 112 | int is32 = is_32bit_task(); |
123 | 113 | ||
124 | if (current_thread_info()->local_flags & _TLF_RESTORE_SIGMASK) | ||
125 | oldset = ¤t->saved_sigmask; | ||
126 | else | ||
127 | oldset = ¤t->blocked; | ||
128 | |||
129 | signr = get_signal_to_deliver(&info, &ka, regs, NULL); | 114 | signr = get_signal_to_deliver(&info, &ka, regs, NULL); |
130 | 115 | ||
131 | /* Is there any syscall restart business here ? */ | 116 | /* Is there any syscall restart business here ? */ |
132 | check_syscall_restart(regs, &ka, signr > 0); | 117 | check_syscall_restart(regs, &ka, signr > 0); |
133 | 118 | ||
134 | if (signr <= 0) { | 119 | if (signr <= 0) { |
135 | struct thread_info *ti = current_thread_info(); | ||
136 | /* No signal to deliver -- put the saved sigmask back */ | 120 | /* No signal to deliver -- put the saved sigmask back */ |
137 | if (ti->local_flags & _TLF_RESTORE_SIGMASK) { | 121 | restore_saved_sigmask(); |
138 | ti->local_flags &= ~_TLF_RESTORE_SIGMASK; | ||
139 | sigprocmask(SIG_SETMASK, ¤t->saved_sigmask, NULL); | ||
140 | } | ||
141 | regs->trap = 0; | 122 | regs->trap = 0; |
142 | return 0; /* no signals delivered */ | 123 | return 0; /* no signals delivered */ |
143 | } | 124 | } |
@@ -167,18 +148,7 @@ static int do_signal(struct pt_regs *regs) | |||
167 | 148 | ||
168 | regs->trap = 0; | 149 | regs->trap = 0; |
169 | if (ret) { | 150 | if (ret) { |
170 | block_sigmask(&ka, signr); | 151 | signal_delivered(signr, &info, &ka, regs, |
171 | |||
172 | /* | ||
173 | * A signal was successfully delivered; the saved sigmask is in | ||
174 | * its frame, and we can clear the TLF_RESTORE_SIGMASK flag. | ||
175 | */ | ||
176 | current_thread_info()->local_flags &= ~_TLF_RESTORE_SIGMASK; | ||
177 | |||
178 | /* | ||
179 | * Let tracing know that we've done the handler setup. | ||
180 | */ | ||
181 | tracehook_signal_handler(signr, &info, &ka, regs, | ||
182 | test_thread_flag(TIF_SINGLESTEP)); | 152 | test_thread_flag(TIF_SINGLESTEP)); |
183 | } | 153 | } |
184 | 154 | ||
@@ -193,8 +163,6 @@ void do_notify_resume(struct pt_regs *regs, unsigned long thread_info_flags) | |||
193 | if (thread_info_flags & _TIF_NOTIFY_RESUME) { | 163 | if (thread_info_flags & _TIF_NOTIFY_RESUME) { |
194 | clear_thread_flag(TIF_NOTIFY_RESUME); | 164 | clear_thread_flag(TIF_NOTIFY_RESUME); |
195 | tracehook_notify_resume(regs); | 165 | tracehook_notify_resume(regs); |
196 | if (current->replacement_session_keyring) | ||
197 | key_replace_session_keyring(); | ||
198 | } | 166 | } |
199 | } | 167 | } |
200 | 168 | ||
diff --git a/arch/powerpc/kernel/signal.h b/arch/powerpc/kernel/signal.h index 8dde973aaaf5..e00acb413934 100644 --- a/arch/powerpc/kernel/signal.h +++ b/arch/powerpc/kernel/signal.h | |||
@@ -10,13 +10,10 @@ | |||
10 | #ifndef _POWERPC_ARCH_SIGNAL_H | 10 | #ifndef _POWERPC_ARCH_SIGNAL_H |
11 | #define _POWERPC_ARCH_SIGNAL_H | 11 | #define _POWERPC_ARCH_SIGNAL_H |
12 | 12 | ||
13 | #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) | ||
14 | |||
15 | extern void do_notify_resume(struct pt_regs *regs, unsigned long thread_info_flags); | 13 | extern void do_notify_resume(struct pt_regs *regs, unsigned long thread_info_flags); |
16 | 14 | ||
17 | extern void __user * get_sigframe(struct k_sigaction *ka, struct pt_regs *regs, | 15 | extern void __user * get_sigframe(struct k_sigaction *ka, struct pt_regs *regs, |
18 | size_t frame_size, int is_32); | 16 | size_t frame_size, int is_32); |
19 | extern void restore_sigmask(sigset_t *set); | ||
20 | 17 | ||
21 | extern int handle_signal32(unsigned long sig, struct k_sigaction *ka, | 18 | extern int handle_signal32(unsigned long sig, struct k_sigaction *ka, |
22 | siginfo_t *info, sigset_t *oldset, | 19 | siginfo_t *info, sigset_t *oldset, |
diff --git a/arch/powerpc/kernel/signal_32.c b/arch/powerpc/kernel/signal_32.c index 61f6aff25edc..8b4c049aee20 100644 --- a/arch/powerpc/kernel/signal_32.c +++ b/arch/powerpc/kernel/signal_32.c | |||
@@ -919,7 +919,7 @@ static int do_setcontext(struct ucontext __user *ucp, struct pt_regs *regs, int | |||
919 | if (!access_ok(VERIFY_READ, mcp, sizeof(*mcp))) | 919 | if (!access_ok(VERIFY_READ, mcp, sizeof(*mcp))) |
920 | return -EFAULT; | 920 | return -EFAULT; |
921 | #endif | 921 | #endif |
922 | restore_sigmask(&set); | 922 | set_current_blocked(&set); |
923 | if (restore_user_regs(regs, mcp, sig)) | 923 | if (restore_user_regs(regs, mcp, sig)) |
924 | return -EFAULT; | 924 | return -EFAULT; |
925 | 925 | ||
@@ -1273,7 +1273,7 @@ long sys_sigreturn(int r3, int r4, int r5, int r6, int r7, int r8, | |||
1273 | set.sig[0] = sigctx.oldmask; | 1273 | set.sig[0] = sigctx.oldmask; |
1274 | set.sig[1] = sigctx._unused[3]; | 1274 | set.sig[1] = sigctx._unused[3]; |
1275 | #endif | 1275 | #endif |
1276 | restore_sigmask(&set); | 1276 | set_current_blocked(&set); |
1277 | 1277 | ||
1278 | sr = (struct mcontext __user *)from_user_ptr(sigctx.regs); | 1278 | sr = (struct mcontext __user *)from_user_ptr(sigctx.regs); |
1279 | addr = sr; | 1279 | addr = sr; |
diff --git a/arch/powerpc/kernel/signal_64.c b/arch/powerpc/kernel/signal_64.c index 2692efdb154e..d183f8719a50 100644 --- a/arch/powerpc/kernel/signal_64.c +++ b/arch/powerpc/kernel/signal_64.c | |||
@@ -335,7 +335,7 @@ int sys_swapcontext(struct ucontext __user *old_ctx, | |||
335 | 335 | ||
336 | if (__copy_from_user(&set, &new_ctx->uc_sigmask, sizeof(set))) | 336 | if (__copy_from_user(&set, &new_ctx->uc_sigmask, sizeof(set))) |
337 | do_exit(SIGSEGV); | 337 | do_exit(SIGSEGV); |
338 | restore_sigmask(&set); | 338 | set_current_blocked(&set); |
339 | if (restore_sigcontext(regs, NULL, 0, &new_ctx->uc_mcontext)) | 339 | if (restore_sigcontext(regs, NULL, 0, &new_ctx->uc_mcontext)) |
340 | do_exit(SIGSEGV); | 340 | do_exit(SIGSEGV); |
341 | 341 | ||
@@ -364,7 +364,7 @@ int sys_rt_sigreturn(unsigned long r3, unsigned long r4, unsigned long r5, | |||
364 | 364 | ||
365 | if (__copy_from_user(&set, &uc->uc_sigmask, sizeof(set))) | 365 | if (__copy_from_user(&set, &uc->uc_sigmask, sizeof(set))) |
366 | goto badframe; | 366 | goto badframe; |
367 | restore_sigmask(&set); | 367 | set_current_blocked(&set); |
368 | if (restore_sigcontext(regs, NULL, 1, &uc->uc_mcontext)) | 368 | if (restore_sigcontext(regs, NULL, 1, &uc->uc_mcontext)) |
369 | goto badframe; | 369 | goto badframe; |
370 | 370 | ||
diff --git a/arch/powerpc/mm/mmu_context_nohash.c b/arch/powerpc/mm/mmu_context_nohash.c index 5b63bd3da4a9..e779642c25e5 100644 --- a/arch/powerpc/mm/mmu_context_nohash.c +++ b/arch/powerpc/mm/mmu_context_nohash.c | |||
@@ -333,9 +333,7 @@ static int __cpuinit mmu_context_cpu_notify(struct notifier_block *self, | |||
333 | unsigned long action, void *hcpu) | 333 | unsigned long action, void *hcpu) |
334 | { | 334 | { |
335 | unsigned int cpu = (unsigned int)(long)hcpu; | 335 | unsigned int cpu = (unsigned int)(long)hcpu; |
336 | #ifdef CONFIG_HOTPLUG_CPU | 336 | |
337 | struct task_struct *p; | ||
338 | #endif | ||
339 | /* We don't touch CPU 0 map, it's allocated at aboot and kept | 337 | /* We don't touch CPU 0 map, it's allocated at aboot and kept |
340 | * around forever | 338 | * around forever |
341 | */ | 339 | */ |
@@ -358,12 +356,7 @@ static int __cpuinit mmu_context_cpu_notify(struct notifier_block *self, | |||
358 | stale_map[cpu] = NULL; | 356 | stale_map[cpu] = NULL; |
359 | 357 | ||
360 | /* We also clear the cpu_vm_mask bits of CPUs going away */ | 358 | /* We also clear the cpu_vm_mask bits of CPUs going away */ |
361 | read_lock(&tasklist_lock); | 359 | clear_tasks_mm_cpumask(cpu); |
362 | for_each_process(p) { | ||
363 | if (p->mm) | ||
364 | cpumask_clear_cpu(cpu, mm_cpumask(p->mm)); | ||
365 | } | ||
366 | read_unlock(&tasklist_lock); | ||
367 | break; | 360 | break; |
368 | #endif /* CONFIG_HOTPLUG_CPU */ | 361 | #endif /* CONFIG_HOTPLUG_CPU */ |
369 | } | 362 | } |
diff --git a/arch/powerpc/platforms/cell/spufs/inode.c b/arch/powerpc/platforms/cell/spufs/inode.c index 1d75c92ea8fb..66519d263da7 100644 --- a/arch/powerpc/platforms/cell/spufs/inode.c +++ b/arch/powerpc/platforms/cell/spufs/inode.c | |||
@@ -151,7 +151,7 @@ static void | |||
151 | spufs_evict_inode(struct inode *inode) | 151 | spufs_evict_inode(struct inode *inode) |
152 | { | 152 | { |
153 | struct spufs_inode_info *ei = SPUFS_I(inode); | 153 | struct spufs_inode_info *ei = SPUFS_I(inode); |
154 | end_writeback(inode); | 154 | clear_inode(inode); |
155 | if (ei->i_ctx) | 155 | if (ei->i_ctx) |
156 | put_spu_context(ei->i_ctx); | 156 | put_spu_context(ei->i_ctx); |
157 | if (ei->i_gang) | 157 | if (ei->i_gang) |