fault.c (ecb41832bd2a7a3f8ac93527cec5e51e3827daed) fault.c (b98cca444d287a63dd96df04af7fb9793567599e)
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * S390 version
4 * Copyright IBM Corp. 1999
5 * Author(s): Hartmut Penner (hp@de.ibm.com)
6 * Ulrich Weigand (uweigand@de.ibm.com)
7 *
8 * Derived from "arch/i386/mm/fault.c"

--- 53 unchanged lines hidden (view full) ---

62static int __init fault_init(void)
63{
64 if (test_facility(75))
65 store_indication = 0xc00;
66 return 0;
67}
68early_initcall(fault_init);
69
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * S390 version
4 * Copyright IBM Corp. 1999
5 * Author(s): Hartmut Penner (hp@de.ibm.com)
6 * Ulrich Weigand (uweigand@de.ibm.com)
7 *
8 * Derived from "arch/i386/mm/fault.c"

--- 53 unchanged lines hidden (view full) ---

62static int __init fault_init(void)
63{
64 if (test_facility(75))
65 store_indication = 0xc00;
66 return 0;
67}
68early_initcall(fault_init);
69
70static inline int notify_page_fault(struct pt_regs *regs)
71{
72 int ret = 0;
73
74 /* kprobe_running() needs smp_processor_id() */
75 if (kprobes_built_in() && !user_mode(regs)) {
76 preempt_disable();
77 if (kprobe_running() && kprobe_fault_handler(regs, 14))
78 ret = 1;
79 preempt_enable();
80 }
81 return ret;
82}
83
84/*
85 * Find out which address space caused the exception.
86 */
87static enum fault_type get_fault_type(struct pt_regs *regs)
88{
89 unsigned long trans_exc_code;
90
91 trans_exc_code = regs->int_parm_long & 3;

--- 151 unchanged lines hidden (view full) ---

243/*
244 * Send SIGSEGV to task. This is an external routine
245 * to keep the stack usage of do_page_fault small.
246 */
247static noinline void do_sigsegv(struct pt_regs *regs, int si_code)
248{
249 report_user_fault(regs, SIGSEGV, 1);
250 force_sig_fault(SIGSEGV, si_code,
70/*
71 * Find out which address space caused the exception.
72 */
73static enum fault_type get_fault_type(struct pt_regs *regs)
74{
75 unsigned long trans_exc_code;
76
77 trans_exc_code = regs->int_parm_long & 3;

--- 151 unchanged lines hidden (view full) ---

229/*
230 * Send SIGSEGV to task. This is an external routine
231 * to keep the stack usage of do_page_fault small.
232 */
233static noinline void do_sigsegv(struct pt_regs *regs, int si_code)
234{
235 report_user_fault(regs, SIGSEGV, 1);
236 force_sig_fault(SIGSEGV, si_code,
251 (void __user *)(regs->int_parm_long & __FAIL_ADDR_MASK),
252 current);
237 (void __user *)(regs->int_parm_long & __FAIL_ADDR_MASK));
253}
254
255const struct exception_table_entry *s390_search_extables(unsigned long addr)
256{
257 const struct exception_table_entry *fixup;
258
259 fixup = search_extable(__start_dma_ex_table,
260 __stop_dma_ex_table - __start_dma_ex_table,

--- 44 unchanged lines hidden (view full) ---

305
306static noinline void do_sigbus(struct pt_regs *regs)
307{
308 /*
309 * Send a sigbus, regardless of whether we were in kernel
310 * or user mode.
311 */
312 force_sig_fault(SIGBUS, BUS_ADRERR,
238}
239
240const struct exception_table_entry *s390_search_extables(unsigned long addr)
241{
242 const struct exception_table_entry *fixup;
243
244 fixup = search_extable(__start_dma_ex_table,
245 __stop_dma_ex_table - __start_dma_ex_table,

--- 44 unchanged lines hidden (view full) ---

290
291static noinline void do_sigbus(struct pt_regs *regs)
292{
293 /*
294 * Send a sigbus, regardless of whether we were in kernel
295 * or user mode.
296 */
297 force_sig_fault(SIGBUS, BUS_ADRERR,
313 (void __user *)(regs->int_parm_long & __FAIL_ADDR_MASK),
314 current);
298 (void __user *)(regs->int_parm_long & __FAIL_ADDR_MASK));
315}
316
317static noinline int signal_return(struct pt_regs *regs)
318{
319 u16 instruction;
320 int rc;
321
322 rc = __get_user(instruction, (u16 __user *) regs->psw.addr);

--- 86 unchanged lines hidden (view full) ---

409
410 tsk = current;
411 /*
412 * The instruction that caused the program check has
413 * been nullified. Don't signal single step via SIGTRAP.
414 */
415 clear_pt_regs_flag(regs, PIF_PER_TRAP);
416
299}
300
301static noinline int signal_return(struct pt_regs *regs)
302{
303 u16 instruction;
304 int rc;
305
306 rc = __get_user(instruction, (u16 __user *) regs->psw.addr);

--- 86 unchanged lines hidden (view full) ---

393
394 tsk = current;
395 /*
396 * The instruction that caused the program check has
397 * been nullified. Don't signal single step via SIGTRAP.
398 */
399 clear_pt_regs_flag(regs, PIF_PER_TRAP);
400
417 if (notify_page_fault(regs))
401 if (kprobe_page_fault(regs, 14))
418 return 0;
419
420 mm = tsk->mm;
421 trans_exc_code = regs->int_parm_long;
422
423 /*
424 * Verify that the fault happened in user space, that
425 * we are not in an interrupt and that there is a

--- 406 unchanged lines hidden ---
402 return 0;
403
404 mm = tsk->mm;
405 trans_exc_code = regs->int_parm_long;
406
407 /*
408 * Verify that the fault happened in user space, that
409 * we are not in an interrupt and that there is a

--- 406 unchanged lines hidden ---