Re: [PATCH] mm: fix double page fault on arm64 if PTE_AF is cleared

2019-09-04 Thread Catalin Marinas
On Wed, 4 Sep 2019 at 04:20, Anshuman Khandual wrote: > On 09/04/2019 06:28 AM, Jia He wrote: > > @@ -2152,20 +2153,30 @@ static inline void cow_user_page(struct page *dst, > > struct page *src, unsigned lo > >*/ > > if (unlikely(!src)) { > > void *kaddr =

Re: [PATCH] mm: fix double page fault on arm64 if PTE_AF is cleared

2019-09-04 Thread Catalin Marinas
On Wed, 4 Sep 2019 at 01:59, Jia He wrote: > @@ -2152,20 +2153,30 @@ static inline void cow_user_page(struct page *dst, > struct page *src, unsigned lo > */ > if (unlikely(!src)) { > void *kaddr = kmap_atomic(dst); > - void __user *uaddr = (void

Re: [PATCH] mm: fix double page fault on arm64 if PTE_AF is cleared

2019-09-03 Thread Anshuman Khandual
On 09/04/2019 10:27 AM, Justin He (Arm Technology China) wrote: > Hi Anshuman, thanks for the comments, see below please > >> -Original Message- >> From: Anshuman Khandual >> Sent: 2019年9月4日 12:38 >> To: Justin He (Arm Technology China) ; Andrew >> Morton ; Matthew Wilcox >> ; Jérôme

Re: [PATCH] mm: fix double page fault on arm64 if PTE_AF is cleared

2019-09-03 Thread Anshuman Khandual
On 09/04/2019 08:49 AM, Anshuman Khandual wrote: > /* >* This really shouldn't fail, because the page is there >* in the page tables. But it might just be unreadable, >* in which case we just give up and fill the result with > -

Re: [PATCH] mm: fix double page fault on arm64 if PTE_AF is cleared

2019-09-03 Thread Anshuman Khandual
On 09/04/2019 06:28 AM, Jia He wrote: > When we tested pmdk unit test [1] vmmalloc_fork TEST1 in arm64 guest, there > will be a double page fault in __copy_from_user_inatomic of cow_user_page. > > Below call trace is from arm64 do_page_fault for debugging purpose > [ 110.016195] Call trace: > [

[PATCH] mm: fix double page fault on arm64 if PTE_AF is cleared

2019-09-03 Thread Jia He
When we tested pmdk unit test [1] vmmalloc_fork TEST1 in arm64 guest, there will be a double page fault in __copy_from_user_inatomic of cow_user_page. Below call trace is from arm64 do_page_fault for debugging purpose [ 110.016195] Call trace: [ 110.016826] do_page_fault+0x5a4/0x690 [