arm64: mm: Pass origial fault address to handle_mm_fault()
PATCH 1/1 arm64: mm: Pass origial fault address to handle_mm_fault()
Currently, the lower bits of fault address is cleared before it's passed to handle_mm_fault(). It's unnecessary since generic code does same thing since the commit 1a29d85eb0f19 ("mm: use vmf->address instead of of vmf->virtual_address").
This passes the original fault address to handle_mm_fault() in case the generic code needs to know the exact fault address.
--- arch/arm64/mm/fault.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/mm/fault.c +1 -1
@@ -504,7 +504,7 @@ static vm_fault_t __do_page_fault(struct mm_struct *mm, unsigned long addr,*/ if (!(vma->vm_flags & vm_flags))return VM_FAULT_BADACCESS ; -return handle_mm_fault (vma, addr &PAGE_MASK , mm_flags, regs); +return handle_mm_fault (vma, addr, mm_flags, regs); }static bool is_el0_instruction_abort (unsigned int esr)
Signature · 1 line
2.23.0
Quoted 18 lines · Gavin Shan
Currently, the lower bits of fault address is cleared before it's passed to
handle_mm_fault(). It's unnecessary since generic code does same thing since the commit1a29d85eb0f19("mm: usevmf->addressinstead of ofvmf->virtual_address").This passes the original fault address to
handle_mm_fault()in case the generic code needs to know the exact fault address.Signed-off-by Gavin Shan <[email protected]>--- arch/arm64/mm/fault.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/arm64/mm/fault.c +0
-0
arch/arm64/mm/fault.c static vm_fault_t __do_page_fault(struct mm_struct *mm, unsigned long addr, · line 507
Quoted 5 lines
arch/arm64/mm/fault.c +1
-1@@ -504,7 +504,7 @@ static vm_fault_t __do_page_fault(struct mm_struct *mm, unsigned long addr,*/ if (!(vma->vm_flags & vm_flags))return VM_FAULT_BADACCESS ; -return handle_mm_fault (vma, addr &PAGE_MASK , mm_flags, regs); +return handle_mm_fault (vma, addr, mm_flags, regs);
This seems to match most of the other architectures (arch/arm also masks out the bottom bits). So:
Quoted 19 lines · Gavin Shan
Currently, the lower bits of fault address is cleared before it's passed to
handle_mm_fault(). It's unnecessary since generic code does same thing since the commit1a29d85eb0f19("mm: usevmf->addressinstead of ofvmf->virtual_address").This passes the original fault address to
handle_mm_fault()in case the generic code needs to know the exact fault address.Signed-off-by Gavin Shan <[email protected]>--- arch/arm64/mm/fault.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/arm64/mm/fault.c +0
-0
arch/arm64/mm/fault.c static vm_fault_t __do_page_fault(struct mm_struct *mm, unsigned long addr, · line 510
Quoted 8 lines
arch/arm64/mm/fault.c +1
-1@@ -504,7 +504,7 @@ static vm_fault_t __do_page_fault(struct mm_struct *mm, unsigned long addr,*/ if (!(vma->vm_flags & vm_flags))return VM_FAULT_BADACCESS ; -return handle_mm_fault (vma, addr &PAGE_MASK , mm_flags, regs); +return handle_mm_fault (vma, addr, mm_flags, regs); }static bool is_el0_instruction_abort (unsigned int esr)
FWIW
Quoted 7 lines · Gavin Shan
Currently, the lower bits of fault address is cleared before it's passed to
handle_mm_fault(). It's unnecessary since generic code does same thing since the commit1a29d85eb0f19("mm: usevmf->addressinstead of ofvmf->virtual_address").This passes the original fault address to
handle_mm_fault()in case the generic code needs to know the exact fault address.
Applied to arm64 (for-next/mm), thanks!
[1/1] arm64: mm: Pass origial fault address to handle_mm_fault()
https://git.kernel.org/arm64/c/84c5e23edecd
Cheers,
Signature · 5 lines
Will https://fixes.arm64.dev https://next.arm64.dev https://will.arm64.dev