diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2018-09-22 09:46:39 +0200 |
---|---|---|
committer | Eric W. Biederman <ebiederm@xmission.com> | 2018-09-27 21:54:02 +0200 |
commit | 9ea3a9743cac4fd2e296223ae6a95bf11d7365d0 (patch) | |
tree | 60f521c31b02b32d416e657b724db6734f668cdd /arch/arm64/mm/fault.c | |
parent | signal/arm64: Factor set_thread_esr out of __do_user_fault (diff) | |
download | linux-9ea3a9743cac4fd2e296223ae6a95bf11d7365d0.tar.xz linux-9ea3a9743cac4fd2e296223ae6a95bf11d7365d0.zip |
signal/arm64: Consolidate the two hwpoison cases in do_page_fault
These two cases are practically the same and use siginfo differently
from the other signals sent from do_page_fault. So consolidate them
to make future changes easier.
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Tested-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Diffstat (limited to 'arch/arm64/mm/fault.c')
-rw-r--r-- | arch/arm64/mm/fault.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c index 654a861c4bd0..0ddc8c6ba53b 100644 --- a/arch/arm64/mm/fault.c +++ b/arch/arm64/mm/fault.c @@ -577,16 +577,16 @@ retry: */ si.si_signo = SIGBUS; si.si_code = BUS_ADRERR; - } else if (fault & VM_FAULT_HWPOISON_LARGE) { - unsigned int hindex = VM_FAULT_GET_HINDEX(fault); + } else if (fault & (VM_FAULT_HWPOISON_LARGE | VM_FAULT_HWPOISON)) { + unsigned int lsb; + + lsb = PAGE_SHIFT; + if (fault & VM_FAULT_HWPOISON_LARGE) + lsb = hstate_index_to_shift(VM_FAULT_GET_HINDEX(fault)); si.si_signo = SIGBUS; si.si_code = BUS_MCEERR_AR; - si.si_addr_lsb = hstate_index_to_shift(hindex); - } else if (fault & VM_FAULT_HWPOISON) { - si.si_signo = SIGBUS; - si.si_code = BUS_MCEERR_AR; - si.si_addr_lsb = PAGE_SHIFT; + si.si_addr_lsb = lsb; } else { /* * Something tried to access memory that isn't in our memory |