Re: [PATCH 2/2] mm/hmm: hmm_range_fault() infinite loop

2019-08-28 Thread Jason Gunthorpe
On Tue, Aug 27, 2019 at 01:16:13PM -0700, Ralph Campbell wrote: > > On 8/27/19 11:41 AM, Jason Gunthorpe wrote: > > On Fri, Aug 23, 2019 at 03:17:53PM -0700, Ralph Campbell wrote: > > > > > Signed-off-by: Ralph Campbell > > > mm/hmm.c | 3 +++ > > > 1 file changed, 3 insertions(+) > > > > >

Re: [PATCH 2/2] mm/hmm: hmm_range_fault() infinite loop

2019-08-27 Thread Ralph Campbell
On 8/27/19 11:41 AM, Jason Gunthorpe wrote: On Fri, Aug 23, 2019 at 03:17:53PM -0700, Ralph Campbell wrote: Signed-off-by: Ralph Campbell mm/hmm.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mm/hmm.c b/mm/hmm.c index 29371485fe94..4882b83aeccb 100644 +++ b/mm/hmm.c @@ -292,6 +29

Re: [PATCH 2/2] mm/hmm: hmm_range_fault() infinite loop

2019-08-27 Thread Jason Gunthorpe
On Fri, Aug 23, 2019 at 03:17:53PM -0700, Ralph Campbell wrote: > Signed-off-by: Ralph Campbell > mm/hmm.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/mm/hmm.c b/mm/hmm.c > index 29371485fe94..4882b83aeccb 100644 > +++ b/mm/hmm.c > @@ -292,6 +292,9 @@ static int hmm_vma_walk_hol

Re: [PATCH 2/2] mm/hmm: hmm_range_fault() infinite loop

2019-08-26 Thread Christoph Hellwig
On Fri, Aug 23, 2019 at 03:17:53PM -0700, Ralph Campbell wrote: > Normally, callers to handle_mm_fault() are supposed to check the > vma->vm_flags first. hmm_range_fault() checks for VM_READ but doesn't > check for VM_WRITE if the caller requests a page to be faulted in > with write permission (via

[PATCH 2/2] mm/hmm: hmm_range_fault() infinite loop

2019-08-23 Thread Ralph Campbell
Normally, callers to handle_mm_fault() are supposed to check the vma->vm_flags first. hmm_range_fault() checks for VM_READ but doesn't check for VM_WRITE if the caller requests a page to be faulted in with write permission (via the hmm_range.pfns[] value). If the vma is write protected, this can re