search for: mmu_interval_notifier_last

Displaying 5 results from an estimated 5 matches for "mmu_interval_notifier_last".

2020 Jan 13
0
[PATCH v6 5/6] nouveau: use new mmu interval notifiers
..._unmap(struct mmu_interval_notifier *mni, + const struct mmu_notifier_range *range) +{ + struct svmm_interval *smi = + container_of(mni, struct svmm_interval, notifier); + struct nouveau_svmm *svmm = smi->svmm; + unsigned long start = mmu_interval_notifier_start(mni); + unsigned long last = mmu_interval_notifier_last(mni); + + if (start >= range->start) { + /* Remove the whole interval or keep the right-hand part. */ + if (last <= range->end) + mmu_interval_notifier_put(mni); + else + mmu_interval_notifier_update(mni, range->end, last); + return; + } + + /* Keep the left-hand part of the...
2020 Jan 14
2
[PATCH v6 5/6] nouveau: use new mmu interval notifiers
...*mni, > + const struct mmu_notifier_range *range) > +{ > + struct svmm_interval *smi = > + container_of(mni, struct svmm_interval, notifier); > + struct nouveau_svmm *svmm = smi->svmm; > + unsigned long start = mmu_interval_notifier_start(mni); > + unsigned long last = mmu_interval_notifier_last(mni); This whole algorithm only works if it is protected by the read side of the interval tree lock. Deserves at least a comment if not an assertion too. > static int nouveau_range_fault(struct nouveau_svmm *svmm, > struct nouveau_drm *drm, void *data, u32 size, > -...
2020 Jan 13
0
[PATCH v6 4/6] mm/mmu_notifier: add mmu_interval_notifier_find()
..._find(struct mm_struct *mm, + const struct mmu_interval_notifier_ops *ops, + unsigned long start, unsigned long last); + +static inline unsigned long mmu_interval_notifier_start( + struct mmu_interval_notifier *mni) +{ + return mni->interval_tree.start; +} + +static inline unsigned long mmu_interval_notifier_last( + struct mmu_interval_notifier *mni) +{ + return mni->interval_tree.last; +} /** * mmu_interval_set_seq - Save the invalidation sequence diff --git a/mm/mmu_notifier.c b/mm/mmu_notifier.c index 47ad9cc89aab..4efecc0f13cb 100644 --- a/mm/mmu_notifier.c +++ b/mm/mmu_notifier.c @@ -1171,6...
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
2020 Jan 15
0
[PATCH v6 5/6] nouveau: use new mmu interval notifiers
...struct mmu_notifier_range *range) >> +{ >> + struct svmm_interval *smi = >> + container_of(mni, struct svmm_interval, notifier); >> + struct nouveau_svmm *svmm = smi->svmm; >> + unsigned long start = mmu_interval_notifier_start(mni); >> + unsigned long last = mmu_interval_notifier_last(mni); > > This whole algorithm only works if it is protected by the read side of > the interval tree lock. Deserves at least a comment if not an > assertion too. This is called from the invalidate() callback and while holding the driver page table lock so the struct mmu_interval_notif...