提交 9ea3a974 编写于 作者: E Eric W. Biederman

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: NCatalin Marinas <catalin.marinas@arm.com>
Tested-by: NCatalin Marinas <catalin.marinas@arm.com>
Signed-off-by: N"Eric W. Biederman" <ebiederm@xmission.com>
上级 f29ad209
......@@ -577,16 +577,16 @@ static int __kprobes do_page_fault(unsigned long addr, unsigned int esr,
*/
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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册