search for: nouveau_svmm_interval_find

Displaying 6 results from an estimated 6 matches for "nouveau_svmm_interval_find".

2020 Jan 14
2
[PATCH v6 5/6] nouveau: use new mmu interval notifiers
...ier_seq = mmu_interval_read_begin(range.notifier); > - range.default_flags = 0; > - range.pfn_flags_mask = -1UL; > down_read(&mm->mmap_sem); mmap sem doesn't have to be held for the interval search, and again we have lifetime issues with the membership here. > + ret = nouveau_svmm_interval_find(svmm, &range); > + if (ret) { > + up_read(&mm->mmap_sem); > + return ret; > + } > + range.notifier_seq = mmu_interval_read_begin(range.notifier); > ret = hmm_range_fault(&range, 0); > up_read(&mm->mmap_sem); > if (ret <= 0) { I'm...
2020 Jan 16
2
[PATCH v6 5/6] nouveau: use new mmu interval notifiers
...hip issue. The driver is the only thing > that allocates, inserts, or removes struct mmu_interval_notifier and thus > completely controls the lifetime. If the returned value is on the defered list it could be freed at any moment. The existing locks do not prevent it. > > > + ret = nouveau_svmm_interval_find(svmm, &range); > > > + if (ret) { > > > + up_read(&mm->mmap_sem); > > > + return ret; > > > + } > > > + range.notifier_seq = mmu_interval_read_begin(range.notifier); > > > ret = hmm_range_fault(&range, 0); > > &gt...
2020 Jan 13
0
[PATCH v6 5/6] nouveau: use new mmu interval notifiers
...l_release, }; +/* + * Find or create a mmu_interval_notifier for the given range. + * Although mmu_interval_notifier_insert_safe() can handle overlapping + * intervals, we only create non-overlapping intervals, shrinking the hmm_range + * if it spans more than one svmm_interval. + */ +static int nouveau_svmm_interval_find(struct nouveau_svmm *svmm, + struct hmm_range *range) +{ + struct mmu_interval_notifier *mni; + struct svmm_interval *smi; + struct vm_area_struct *vma; + unsigned long start = range->start; + unsigned long last = range->end - 1; + int ret; + + mutex_lock(&svmm->mutex); + mni = mmu...
2020 Jan 16
0
[PATCH v6 5/6] nouveau: use new mmu interval notifiers
...nly thing >> that allocates, inserts, or removes struct mmu_interval_notifier and thus >> completely controls the lifetime. > > If the returned value is on the defered list it could be freed at any > moment. The existing locks do not prevent it. > >>>> + ret = nouveau_svmm_interval_find(svmm, &range); >>>> + if (ret) { >>>> + up_read(&mm->mmap_sem); >>>> + return ret; >>>> + } >>>> + range.notifier_seq = mmu_interval_read_begin(range.notifier); >>>> ret = hmm_range_fault(&range, 0);...
2020 Jan 15
0
[PATCH v6 5/6] nouveau: use new mmu interval notifiers
...If an arbitrary size interval was created instead, then mmap_sem wouldn't be needed. I don't understand the lifetime/membership issue. The driver is the only thing that allocates, inserts, or removes struct mmu_interval_notifier and thus completely controls the lifetime. >> + ret = nouveau_svmm_interval_find(svmm, &range); >> + if (ret) { >> + up_read(&mm->mmap_sem); >> + return ret; >> + } >> + range.notifier_seq = mmu_interval_read_begin(range.notifier); >> ret = hmm_range_fault(&range, 0); >> up_read(&mm->mmap_sem); >&...
2020 Jan 13
9
[PATCH v6 0/6] mm/hmm/test: add self tests for HMM
This series adds new functions to the mmu interval notifier API to allow device drivers with MMUs to dynamically mirror a process' page tables based on device faults and invalidation callbacks. The Nouveau driver is updated to use the extended API and a set of stand alone self tests is added to help validate and maintain correctness. The patches are based on linux-5.5.0-rc6 and are for