diff options
Diffstat (limited to 'arch/x86/mm/fault.c')
-rw-r--r-- | arch/x86/mm/fault.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c index 58e4f1f00bbc..794f364cb882 100644 --- a/arch/x86/mm/fault.c +++ b/arch/x86/mm/fault.c | |||
@@ -760,8 +760,7 @@ no_context(struct pt_regs *regs, unsigned long error_code, | |||
760 | set_signal_archinfo(address, error_code); | 760 | set_signal_archinfo(address, error_code); |
761 | 761 | ||
762 | /* XXX: hwpoison faults will set the wrong code. */ | 762 | /* XXX: hwpoison faults will set the wrong code. */ |
763 | force_sig_fault(signal, si_code, (void __user *)address, | 763 | force_sig_fault(signal, si_code, (void __user *)address); |
764 | tsk); | ||
765 | } | 764 | } |
766 | 765 | ||
767 | /* | 766 | /* |
@@ -922,7 +921,7 @@ __bad_area_nosemaphore(struct pt_regs *regs, unsigned long error_code, | |||
922 | if (si_code == SEGV_PKUERR) | 921 | if (si_code == SEGV_PKUERR) |
923 | force_sig_pkuerr((void __user *)address, pkey); | 922 | force_sig_pkuerr((void __user *)address, pkey); |
924 | 923 | ||
925 | force_sig_fault(SIGSEGV, si_code, (void __user *)address, tsk); | 924 | force_sig_fault(SIGSEGV, si_code, (void __user *)address); |
926 | 925 | ||
927 | return; | 926 | return; |
928 | } | 927 | } |
@@ -1019,8 +1018,6 @@ static void | |||
1019 | do_sigbus(struct pt_regs *regs, unsigned long error_code, unsigned long address, | 1018 | do_sigbus(struct pt_regs *regs, unsigned long error_code, unsigned long address, |
1020 | vm_fault_t fault) | 1019 | vm_fault_t fault) |
1021 | { | 1020 | { |
1022 | struct task_struct *tsk = current; | ||
1023 | |||
1024 | /* Kernel mode? Handle exceptions or die: */ | 1021 | /* Kernel mode? Handle exceptions or die: */ |
1025 | if (!(error_code & X86_PF_USER)) { | 1022 | if (!(error_code & X86_PF_USER)) { |
1026 | no_context(regs, error_code, address, SIGBUS, BUS_ADRERR); | 1023 | no_context(regs, error_code, address, SIGBUS, BUS_ADRERR); |
@@ -1035,6 +1032,7 @@ do_sigbus(struct pt_regs *regs, unsigned long error_code, unsigned long address, | |||
1035 | 1032 | ||
1036 | #ifdef CONFIG_MEMORY_FAILURE | 1033 | #ifdef CONFIG_MEMORY_FAILURE |
1037 | if (fault & (VM_FAULT_HWPOISON|VM_FAULT_HWPOISON_LARGE)) { | 1034 | if (fault & (VM_FAULT_HWPOISON|VM_FAULT_HWPOISON_LARGE)) { |
1035 | struct task_struct *tsk = current; | ||
1038 | unsigned lsb = 0; | 1036 | unsigned lsb = 0; |
1039 | 1037 | ||
1040 | pr_err( | 1038 | pr_err( |
@@ -1044,11 +1042,11 @@ do_sigbus(struct pt_regs *regs, unsigned long error_code, unsigned long address, | |||
1044 | lsb = hstate_index_to_shift(VM_FAULT_GET_HINDEX(fault)); | 1042 | lsb = hstate_index_to_shift(VM_FAULT_GET_HINDEX(fault)); |
1045 | if (fault & VM_FAULT_HWPOISON) | 1043 | if (fault & VM_FAULT_HWPOISON) |
1046 | lsb = PAGE_SHIFT; | 1044 | lsb = PAGE_SHIFT; |
1047 | force_sig_mceerr(BUS_MCEERR_AR, (void __user *)address, lsb, tsk); | 1045 | force_sig_mceerr(BUS_MCEERR_AR, (void __user *)address, lsb); |
1048 | return; | 1046 | return; |
1049 | } | 1047 | } |
1050 | #endif | 1048 | #endif |
1051 | force_sig_fault(SIGBUS, BUS_ADRERR, (void __user *)address, tsk); | 1049 | force_sig_fault(SIGBUS, BUS_ADRERR, (void __user *)address); |
1052 | } | 1050 | } |
1053 | 1051 | ||
1054 | static noinline void | 1052 | static noinline void |