aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/mm/fault.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-05-21 14:17:05 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-05-21 14:17:05 -0400
commit79c4581262e225a7c96d88b632b05ab3b5e9a52c (patch)
tree8ef030c74ab7e0d0df27cf86195f915efd2832f7 /arch/powerpc/mm/fault.c
parent59534f7298c5e28aaa64e6ed550e247f64ee72ae (diff)
parent99ec28f183daa450faa7bdad6f932364ae325648 (diff)
Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc
* 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc: (92 commits) powerpc: Remove unused 'protect4gb' boot parameter powerpc: Build-in e1000e for pseries & ppc64_defconfig powerpc/pseries: Make request_ras_irqs() available to other pseries code powerpc/numa: Use ibm,architecture-vec-5 to detect form 1 affinity powerpc/numa: Set a smaller value for RECLAIM_DISTANCE to enable zone reclaim powerpc: Use smt_snooze_delay=-1 to always busy loop powerpc: Remove check of ibm,smt-snooze-delay OF property powerpc/kdump: Fix race in kdump shutdown powerpc/kexec: Fix race in kexec shutdown powerpc/kexec: Speedup kexec hash PTE tear down powerpc/pseries: Add hcall to read 4 ptes at a time in real mode powerpc: Use more accurate limit for first segment memory allocations powerpc/kdump: Use chip->shutdown to disable IRQs powerpc/kdump: CPUs assume the context of the oopsing CPU powerpc/crashdump: Do not fail on NULL pointer dereferencing powerpc/eeh: Fix oops when probing in early boot powerpc/pci: Check devices status property when scanning OF tree powerpc/vio: Switch VIO Bus PM to use generic helpers powerpc: Avoid bad relocations in iSeries code powerpc: Use common cpu_die (fixes SMP+SUSPEND build) ...
Diffstat (limited to 'arch/powerpc/mm/fault.c')
-rw-r--r--arch/powerpc/mm/fault.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/arch/powerpc/mm/fault.c b/arch/powerpc/mm/fault.c
index 26fb6b990b0a..1bd712c33ce2 100644
--- a/arch/powerpc/mm/fault.c
+++ b/arch/powerpc/mm/fault.c
@@ -151,13 +151,14 @@ int __kprobes do_page_fault(struct pt_regs *regs, unsigned long address,
151 if (!user_mode(regs) && (address >= TASK_SIZE)) 151 if (!user_mode(regs) && (address >= TASK_SIZE))
152 return SIGSEGV; 152 return SIGSEGV;
153 153
154#if !(defined(CONFIG_4xx) || defined(CONFIG_BOOKE)) 154#if !(defined(CONFIG_4xx) || defined(CONFIG_BOOKE) || \
155 defined(CONFIG_PPC_BOOK3S_64))
155 if (error_code & DSISR_DABRMATCH) { 156 if (error_code & DSISR_DABRMATCH) {
156 /* DABR match */ 157 /* DABR match */
157 do_dabr(regs, address, error_code); 158 do_dabr(regs, address, error_code);
158 return 0; 159 return 0;
159 } 160 }
160#endif /* !(CONFIG_4xx || CONFIG_BOOKE)*/ 161#endif
161 162
162 if (in_atomic() || mm == NULL) { 163 if (in_atomic() || mm == NULL) {
163 if (!user_mode(regs)) 164 if (!user_mode(regs))
@@ -307,7 +308,6 @@ good_area:
307 * make sure we exit gracefully rather than endlessly redo 308 * make sure we exit gracefully rather than endlessly redo
308 * the fault. 309 * the fault.
309 */ 310 */
310 survive:
311 ret = handle_mm_fault(mm, vma, address, is_write ? FAULT_FLAG_WRITE : 0); 311 ret = handle_mm_fault(mm, vma, address, is_write ? FAULT_FLAG_WRITE : 0);
312 if (unlikely(ret & VM_FAULT_ERROR)) { 312 if (unlikely(ret & VM_FAULT_ERROR)) {
313 if (ret & VM_FAULT_OOM) 313 if (ret & VM_FAULT_OOM)
@@ -359,15 +359,10 @@ bad_area_nosemaphore:
359 */ 359 */
360out_of_memory: 360out_of_memory:
361 up_read(&mm->mmap_sem); 361 up_read(&mm->mmap_sem);
362 if (is_global_init(current)) { 362 if (!user_mode(regs))
363 yield(); 363 return SIGKILL;
364 down_read(&mm->mmap_sem); 364 pagefault_out_of_memory();
365 goto survive; 365 return 0;
366 }
367 printk("VM: killing process %s\n", current->comm);
368 if (user_mode(regs))
369 do_group_exit(SIGKILL);
370 return SIGKILL;
371 366
372do_sigbus: 367do_sigbus:
373 up_read(&mm->mmap_sem); 368 up_read(&mm->mmap_sem);