search for: hmm_range_fault

Displaying 20 results from an estimated 181 matches for "hmm_range_fault".

2020 Apr 22
0
[PATCH hmm 2/5] mm/hmm: make hmm_range_fault return 0 or -1
From: Jason Gunthorpe <jgg at mellanox.com> hmm_vma_walk->last is supposed to be updated after every write to the pfns, so that it can be returned by hmm_range_fault(). However, this is not done consistently. Fortunately nothing checks the return code of hmm_range_fault() for anything other than error. More importantly last must be set before returning -EBUSY as it is used to prevent reading an output pfn as an input flags when the loop restarts. For clarity...
2020 Apr 22
1
[PATCH hmm 2/5] mm/hmm: make hmm_range_fault return 0 or -1
On Tue, Apr 21, 2020 at 09:21:43PM -0300, Jason Gunthorpe wrote: > From: Jason Gunthorpe <jgg at mellanox.com> > > hmm_vma_walk->last is supposed to be updated after every write to the > pfns, so that it can be returned by hmm_range_fault(). However, this is > not done consistently. Fortunately nothing checks the return code of > hmm_range_fault() for anything other than error. > > More importantly last must be set before returning -EBUSY as it is used to > prevent reading an output pfn as an input flags when the loo...
2020 May 01
0
[PATCH hmm v2 2/5] mm/hmm: make hmm_range_fault return 0 or -1
From: Jason Gunthorpe <jgg at mellanox.com> hmm_vma_walk->last is supposed to be updated after every write to the pfns, so that it can be returned by hmm_range_fault(). However, this is not done consistently. Fortunately nothing checks the return code of hmm_range_fault() for anything other than error. More importantly last must be set before returning -EBUSY as it is used to prevent reading an output pfn as an input flags when the loop restarts. For clarity...
2019 May 20
3
[PATCH] drm/nouveau/svm: Convert to use hmm_range_fault()
Convert to use hmm_range_fault(). Signed-off-by: Souptick Joarder <jrdr.linux at gmail.com> --- drivers/gpu/drm/nouveau/nouveau_svm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_svm.c b/drivers/gpu/drm/nouveau/nouveau_svm.c index 93ed43c..8d56bd6 100644 --- a/driver...
2019 Aug 23
6
[PATCH 0/2] mm/hmm: two bug fixes for hmm_range_fault()
...o be posted as a patch. I'm posting the fixes now since I thought they shouldn't wait. They should probably have a fixes line but with all the HMM changes, I wasn't sure exactly which commit to use. These are based on top of Jason's latest hmm branch. Ralph Campbell (2): mm/hmm: hmm_range_fault() NULL pointer bug mm/hmm: hmm_range_fault() infinite loop mm/hmm.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) -- 2.20.1
2019 Aug 26
1
[PATCH 1/2] mm/hmm: hmm_range_fault() NULL pointer bug
On Mon, Aug 26, 2019 at 11:02:12AM -0700, Ralph Campbell wrote: > > On 8/24/19 3:37 PM, Christoph Hellwig wrote: > > On Fri, Aug 23, 2019 at 03:17:52PM -0700, Ralph Campbell wrote: > > > Although hmm_range_fault() calls find_vma() to make sure that a vma exists > > > before calling walk_page_range(), hmm_vma_walk_hole() can still be called > > > with walk->vma == NULL if the start and end address are not contained > > > within the vma range. > > > > Should we conv...
2019 Aug 24
2
[PATCH 1/2] mm/hmm: hmm_range_fault() NULL pointer bug
On Fri, Aug 23, 2019 at 03:17:52PM -0700, Ralph Campbell wrote: > Although hmm_range_fault() calls find_vma() to make sure that a vma exists > before calling walk_page_range(), hmm_vma_walk_hole() can still be called > with walk->vma == NULL if the start and end address are not contained > within the vma range. Should we convert to walk_vma_range instead? Or keep walk_page_...
2019 Jul 26
13
[PATCH v2 0/7] mm/hmm: more HMM clean up
Here are seven more patches for things I found to clean up. This was based on top of Christoph's seven patches: "hmm_range_fault related fixes and legacy API removal v3". I assume this will go into Jason's tree since there will likely be more HMM changes in this cycle. Changes from v1 to v2: Added AMD GPU to hmm_update removal. Added 2 patches from Christoph. Added 2 patches as a result of Jason's suggestions....
2019 Jul 30
0
[PATCH 01/13] amdgpu: remove -EAGAIN handling for hmm_range_fault
hmm_range_fault can only return -EAGAIN if called with the block argument set to false, so remove the special handling for it. Signed-off-by: Christoph Hellwig <hch at lst.de> --- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-) diff --...
2020 Jun 26
2
[PATCH] nouveau: fix page fault on device private memory
If system memory is migrated to device private memory and no GPU MMU page table entry exists, the GPU will fault and call hmm_range_fault() to get the PFN for the page. Since the .dev_private_owner pointer in struct hmm_range is not set, hmm_range_fault returns an error which results in the GPU program stopping with a fatal fault. Fix this by setting .dev_private_owner appropriately. Fixes: 08ddddda667b ("mm/hmm: check the devi...
2020 May 26
1
[PATCH 4/6] mm/hmm: add output flag for compound page mapping
On 8 May 2020, at 16:06, Ralph Campbell wrote: > On 5/8/20 12:51 PM, Christoph Hellwig wrote: >> On Fri, May 08, 2020 at 12:20:07PM -0700, Ralph Campbell wrote: >>> hmm_range_fault() returns an array of page frame numbers and flags for >>> how the pages are mapped in the requested process' page tables. The PFN >>> can be used to get the struct page with hmm_pfn_to_page() and the page size >>> order can be determined with compound_order(page) but...
2020 Mar 20
2
[PATCH 4/4] mm: check the device private page owner in hmm_range_fault
..._entry(struct hmm_range *range, > + swp_entry_t entry) > +{ > + return is_device_private_entry(entry) && > + device_private_entry_to_page(entry)->pgmap->owner == > + range->dev_private_owner; > +} Thinking about this some more, does the locking work out here? hmm_range_fault() runs with mmap_sem in read, and does not lock any of the page table levels. So it relies on accessing stale pte data being safe, and here we introduce for the first time a page pointer dereference and a pgmap dereference without any locking/refcounting. The get_dev_pagemap() worked on the PFN a...
2020 May 05
1
[PATCH hmm v2 5/5] mm/hmm: remove the customizable pfn format from hmm_range_fault
On 2020-05-01 11:20, Jason Gunthorpe wrote: > From: Jason Gunthorpe <jgg at mellanox.com> > > Presumably the intent here was that hmm_range_fault() could put the data > into some HW specific format and thus avoid some work. However, nothing > actually does that, and it isn't clear how anything actually could do that > as hmm_range_fault() provides CPU addresses which must be DMA mapped. > > Perhaps there is some special H...
2019 May 27
0
[PATCH] drm/nouveau/svm: Convert to use hmm_range_fault()
On Tue, May 21, 2019 at 12:27 AM Souptick Joarder <jrdr.linux at gmail.com> wrote: > > Convert to use hmm_range_fault(). Any comment on this patch ? > > Signed-off-by: Souptick Joarder <jrdr.linux at gmail.com> > --- > drivers/gpu/drm/nouveau/nouveau_svm.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/nouveau/nouveau_svm.c b/drivers/gpu/drm/n...
2019 Jun 07
0
[PATCH] drm/nouveau/svm: Convert to use hmm_range_fault()
Hi Jason, On Tue, May 21, 2019 at 12:27 AM Souptick Joarder <jrdr.linux at gmail.com> wrote: > > Convert to use hmm_range_fault(). > > Signed-off-by: Souptick Joarder <jrdr.linux at gmail.com> Would you like to take it through your new hmm tree or do I need to resend it ? > --- > drivers/gpu/drm/nouveau/nouveau_svm.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drive...
2019 Aug 23
0
[PATCH 1/2] mm/hmm: hmm_range_fault() NULL pointer bug
Although hmm_range_fault() calls find_vma() to make sure that a vma exists before calling walk_page_range(), hmm_vma_walk_hole() can still be called with walk->vma == NULL if the start and end address are not contained within the vma range. hmm_range_fault() /* calls find_vma() but no range check */ walk_page_range(...
2019 Aug 23
0
[PATCH 2/2] mm/hmm: hmm_range_fault() infinite loop
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 result in an infinite loop: hmm_range_fault() walk_page_range() ... hmm_vma_walk_h...
2019 Aug 26
0
[PATCH 1/2] mm/hmm: hmm_range_fault() NULL pointer bug
On 8/24/19 3:37 PM, Christoph Hellwig wrote: > On Fri, Aug 23, 2019 at 03:17:52PM -0700, Ralph Campbell wrote: >> Although hmm_range_fault() calls find_vma() to make sure that a vma exists >> before calling walk_page_range(), hmm_vma_walk_hole() can still be called >> with walk->vma == NULL if the start and end address are not contained >> within the vma range. > > Should we convert to walk_vma_range instea...
2020 Mar 16
0
[PATCH 2/2] mm: remove device private page support from hmm_range_fault
...tches to map GPU memory after being >>> migrated and this change would conflict with that. >> >> Can you explain me how we actually invoke this code? >> >> For that we'd need HMM_PFN_DEVICE_PRIVATE NVIF_VMM_PFNMAP_V0_VRAM >> set in ->pfns before calling hmm_range_fault, which isn't happening. > > Oh, I got tripped on this too > > The logic is backwards from what you'd think.. If you *set* > HMM_PFN_DEVICE_PRIVATE then this triggers: > > hmm_pte_need_fault(): > if ((cpu_flags & range->flags[HMM_PFN_DEVICE_PRIVATE])) { &gt...
2020 May 08
2
[PATCH 4/6] mm/hmm: add output flag for compound page mapping
On Fri, May 08, 2020 at 12:20:07PM -0700, Ralph Campbell wrote: > hmm_range_fault() returns an array of page frame numbers and flags for > how the pages are mapped in the requested process' page tables. The PFN > can be used to get the struct page with hmm_pfn_to_page() and the page size > order can be determined with compound_order(page) but if the page is larger &...