diff options
Diffstat (limited to 'arch/s390/mm')
-rw-r--r-- | arch/s390/mm/fault.c | 28 | ||||
-rw-r--r-- | arch/s390/mm/init.c | 2 | ||||
-rw-r--r-- | arch/s390/mm/pgtable.c | 6 |
3 files changed, 9 insertions, 27 deletions
diff --git a/arch/s390/mm/fault.c b/arch/s390/mm/fault.c index 4d537205e83c..833e8366c351 100644 --- a/arch/s390/mm/fault.c +++ b/arch/s390/mm/fault.c | |||
@@ -200,29 +200,6 @@ static void do_low_address(struct pt_regs *regs, unsigned long error_code) | |||
200 | do_no_context(regs, error_code, 0); | 200 | do_no_context(regs, error_code, 0); |
201 | } | 201 | } |
202 | 202 | ||
203 | /* | ||
204 | * We ran out of memory, or some other thing happened to us that made | ||
205 | * us unable to handle the page fault gracefully. | ||
206 | */ | ||
207 | static int do_out_of_memory(struct pt_regs *regs, unsigned long error_code, | ||
208 | unsigned long address) | ||
209 | { | ||
210 | struct task_struct *tsk = current; | ||
211 | struct mm_struct *mm = tsk->mm; | ||
212 | |||
213 | up_read(&mm->mmap_sem); | ||
214 | if (is_global_init(tsk)) { | ||
215 | yield(); | ||
216 | down_read(&mm->mmap_sem); | ||
217 | return 1; | ||
218 | } | ||
219 | printk("VM: killing process %s\n", tsk->comm); | ||
220 | if (regs->psw.mask & PSW_MASK_PSTATE) | ||
221 | do_group_exit(SIGKILL); | ||
222 | do_no_context(regs, error_code, address); | ||
223 | return 0; | ||
224 | } | ||
225 | |||
226 | static void do_sigbus(struct pt_regs *regs, unsigned long error_code, | 203 | static void do_sigbus(struct pt_regs *regs, unsigned long error_code, |
227 | unsigned long address) | 204 | unsigned long address) |
228 | { | 205 | { |
@@ -367,7 +344,6 @@ good_area: | |||
367 | goto bad_area; | 344 | goto bad_area; |
368 | } | 345 | } |
369 | 346 | ||
370 | survive: | ||
371 | if (is_vm_hugetlb_page(vma)) | 347 | if (is_vm_hugetlb_page(vma)) |
372 | address &= HPAGE_MASK; | 348 | address &= HPAGE_MASK; |
373 | /* | 349 | /* |
@@ -378,8 +354,8 @@ survive: | |||
378 | fault = handle_mm_fault(mm, vma, address, write); | 354 | fault = handle_mm_fault(mm, vma, address, write); |
379 | if (unlikely(fault & VM_FAULT_ERROR)) { | 355 | if (unlikely(fault & VM_FAULT_ERROR)) { |
380 | if (fault & VM_FAULT_OOM) { | 356 | if (fault & VM_FAULT_OOM) { |
381 | if (do_out_of_memory(regs, error_code, address)) | 357 | up_read(&mm->mmap_sem); |
382 | goto survive; | 358 | pagefault_out_of_memory(); |
383 | return; | 359 | return; |
384 | } else if (fault & VM_FAULT_SIGBUS) { | 360 | } else if (fault & VM_FAULT_SIGBUS) { |
385 | do_sigbus(regs, error_code, address); | 361 | do_sigbus(regs, error_code, address); |
diff --git a/arch/s390/mm/init.c b/arch/s390/mm/init.c index f0258ca3b17e..c634dfbe92e9 100644 --- a/arch/s390/mm/init.c +++ b/arch/s390/mm/init.c | |||
@@ -40,7 +40,9 @@ | |||
40 | DEFINE_PER_CPU(struct mmu_gather, mmu_gathers); | 40 | DEFINE_PER_CPU(struct mmu_gather, mmu_gathers); |
41 | 41 | ||
42 | pgd_t swapper_pg_dir[PTRS_PER_PGD] __attribute__((__aligned__(PAGE_SIZE))); | 42 | pgd_t swapper_pg_dir[PTRS_PER_PGD] __attribute__((__aligned__(PAGE_SIZE))); |
43 | |||
43 | char empty_zero_page[PAGE_SIZE] __attribute__((__aligned__(PAGE_SIZE))); | 44 | char empty_zero_page[PAGE_SIZE] __attribute__((__aligned__(PAGE_SIZE))); |
45 | EXPORT_SYMBOL(empty_zero_page); | ||
44 | 46 | ||
45 | /* | 47 | /* |
46 | * paging_init() sets up the page tables | 48 | * paging_init() sets up the page tables |
diff --git a/arch/s390/mm/pgtable.c b/arch/s390/mm/pgtable.c index 6b6ddc4ea02b..be6c1cf4ad5a 100644 --- a/arch/s390/mm/pgtable.c +++ b/arch/s390/mm/pgtable.c | |||
@@ -258,6 +258,10 @@ int s390_enable_sie(void) | |||
258 | struct task_struct *tsk = current; | 258 | struct task_struct *tsk = current; |
259 | struct mm_struct *mm, *old_mm; | 259 | struct mm_struct *mm, *old_mm; |
260 | 260 | ||
261 | /* Do we have switched amode? If no, we cannot do sie */ | ||
262 | if (!switch_amode) | ||
263 | return -EINVAL; | ||
264 | |||
261 | /* Do we have pgstes? if yes, we are done */ | 265 | /* Do we have pgstes? if yes, we are done */ |
262 | if (tsk->mm->context.has_pgste) | 266 | if (tsk->mm->context.has_pgste) |
263 | return 0; | 267 | return 0; |
@@ -292,7 +296,7 @@ int s390_enable_sie(void) | |||
292 | tsk->mm = tsk->active_mm = mm; | 296 | tsk->mm = tsk->active_mm = mm; |
293 | preempt_disable(); | 297 | preempt_disable(); |
294 | update_mm(mm, tsk); | 298 | update_mm(mm, tsk); |
295 | cpu_set(smp_processor_id(), mm->cpu_vm_mask); | 299 | cpumask_set_cpu(smp_processor_id(), mm_cpumask(mm)); |
296 | preempt_enable(); | 300 | preempt_enable(); |
297 | task_unlock(tsk); | 301 | task_unlock(tsk); |
298 | mmput(old_mm); | 302 | mmput(old_mm); |