linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] arm64: mm: Pass origial fault address to handle_mm_fault()
@ 2021-06-14 12:27 Gavin Shan
  2021-06-14 15:42 ` Catalin Marinas
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Gavin Shan @ 2021-06-14 12:27 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: linux-kernel, catalin.marinas, will, mark.rutland, shan.gavin

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.

Signed-off-by: Gavin Shan <gshan@redhat.com>
---
 arch/arm64/mm/fault.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c
index 871c82ab0a30..e2883237216d 100644
--- a/arch/arm64/mm/fault.c
+++ b/arch/arm64/mm/fault.c
@@ -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)
-- 
2.23.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] arm64: mm: Pass origial fault address to handle_mm_fault()
  2021-06-14 12:27 [PATCH] arm64: mm: Pass origial fault address to handle_mm_fault() Gavin Shan
@ 2021-06-14 15:42 ` Catalin Marinas
  2021-06-15 11:11 ` Anshuman Khandual
  2021-06-15 12:06 ` Will Deacon
  2 siblings, 0 replies; 4+ messages in thread
From: Catalin Marinas @ 2021-06-14 15:42 UTC (permalink / raw)
  To: Gavin Shan; +Cc: linux-arm-kernel, linux-kernel, will, mark.rutland, shan.gavin

On Mon, Jun 14, 2021 at 08:27:01PM +0800, Gavin Shan wrote:
> 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.
> 
> Signed-off-by: Gavin Shan <gshan@redhat.com>
> ---
>  arch/arm64/mm/fault.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c
> index 871c82ab0a30..e2883237216d 100644
> --- a/arch/arm64/mm/fault.c
> +++ b/arch/arm64/mm/fault.c
> @@ -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:

Acked-by: Catalin Marinas <catalin.marinas@arm.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] arm64: mm: Pass origial fault address to handle_mm_fault()
  2021-06-14 12:27 [PATCH] arm64: mm: Pass origial fault address to handle_mm_fault() Gavin Shan
  2021-06-14 15:42 ` Catalin Marinas
@ 2021-06-15 11:11 ` Anshuman Khandual
  2021-06-15 12:06 ` Will Deacon
  2 siblings, 0 replies; 4+ messages in thread
From: Anshuman Khandual @ 2021-06-15 11:11 UTC (permalink / raw)
  To: Gavin Shan, linux-arm-kernel
  Cc: linux-kernel, catalin.marinas, will, mark.rutland, shan.gavin



On 6/14/21 5:57 PM, Gavin Shan wrote:
> 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.
> 
> Signed-off-by: Gavin Shan <gshan@redhat.com>
> ---
>  arch/arm64/mm/fault.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c
> index 871c82ab0a30..e2883237216d 100644
> --- a/arch/arm64/mm/fault.c
> +++ b/arch/arm64/mm/fault.c
> @@ -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

Reviewed-by: Anshuman Khandual <anshuman.khandual@arm.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] arm64: mm: Pass origial fault address to handle_mm_fault()
  2021-06-14 12:27 [PATCH] arm64: mm: Pass origial fault address to handle_mm_fault() Gavin Shan
  2021-06-14 15:42 ` Catalin Marinas
  2021-06-15 11:11 ` Anshuman Khandual
@ 2021-06-15 12:06 ` Will Deacon
  2 siblings, 0 replies; 4+ messages in thread
From: Will Deacon @ 2021-06-15 12:06 UTC (permalink / raw)
  To: linux-arm-kernel, Gavin Shan
  Cc: catalin.marinas, kernel-team, Will Deacon, linux-kernel,
	shan.gavin, mark.rutland

On Mon, 14 Jun 2021 20:27:01 +0800, Gavin Shan wrote:
> 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.

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,
-- 
Will

https://fixes.arm64.dev
https://next.arm64.dev
https://will.arm64.dev

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-06-15 12:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-14 12:27 [PATCH] arm64: mm: Pass origial fault address to handle_mm_fault() Gavin Shan
2021-06-14 15:42 ` Catalin Marinas
2021-06-15 11:11 ` Anshuman Khandual
2021-06-15 12:06 ` Will Deacon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).