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

2019-09-10 Thread Kirill A. Shutemov
On Fri, Sep 06, 2019 at 09:57:47PM +0800, 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 > [

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

2019-09-10 Thread Catalin Marinas
On Fri, Sep 06, 2019 at 07:57:42AM -0700, Matthew Wilcox wrote: > On Fri, Sep 06, 2019 at 09:57:47PM +0800, Jia He wrote: > > * This really shouldn't fail, because the page is there > > * in the page tables. But it might just be unreadable, > > * in which

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

2019-09-10 Thread Catalin Marinas
On Mon, Sep 09, 2019 at 02:27:12PM -0700, Matthew Wilcox wrote: > On Fri, Sep 06, 2019 at 09:57:47PM +0800, Jia He wrote: > > + if (!pte_young(vmf->orig_pte)) { > > + entry = pte_mkyoung(vmf->orig_pte); > > + if (ptep_set_access_flags(vmf->vma,

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

2019-09-09 Thread Matthew Wilcox
On Fri, Sep 06, 2019 at 09:57:47PM +0800, Jia He wrote: > + if (!pte_young(vmf->orig_pte)) { > + entry = pte_mkyoung(vmf->orig_pte); > + if (ptep_set_access_flags(vmf->vma, vmf->address, > + vmf->pte, entry, 0)) > +

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

2019-09-06 Thread Matthew Wilcox
On Fri, Sep 06, 2019 at 09:57:47PM +0800, Jia He 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 > - *

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

2019-09-06 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 [