diff options
Diffstat (limited to 'arch/powerpc/mm/fault.c')
-rw-r--r-- | arch/powerpc/mm/fault.c | 19 |
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 | */ |
360 | out_of_memory: | 360 | out_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 | ||
372 | do_sigbus: | 367 | do_sigbus: |
373 | up_read(&mm->mmap_sem); | 368 | up_read(&mm->mmap_sem); |