aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorJoerg Roedel <jroedel@suse.de>2014-11-12 21:46:09 -0500
committerOded Gabbay <oded.gabbay@amd.com>2014-11-12 21:46:09 -0500
commit34ee645e83b60ae3d5955f70ab9ab9a159136673 (patch)
tree49aa485f580cd9594f89f0b761dd685b2c2981af /include/linux
parent1897bdc4d33167e9036460631d1349e59d841f2d (diff)
mmu_notifier: call mmu_notifier_invalidate_range() from VMM
Add calls to the new mmu_notifier_invalidate_range() function to all places in the VMM that need it. Signed-off-by: Joerg Roedel <jroedel@suse.de> Reviewed-by: Andrea Arcangeli <aarcange@redhat.com> Reviewed-by: Jérôme Glisse <jglisse@redhat.com> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Rik van Riel <riel@redhat.com> Cc: Hugh Dickins <hughd@google.com> Cc: Mel Gorman <mgorman@suse.de> Cc: Johannes Weiner <jweiner@redhat.com> Cc: Jay Cornwall <Jay.Cornwall@amd.com> Cc: Oded Gabbay <Oded.Gabbay@amd.com> Cc: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com> Cc: Jesse Barnes <jbarnes@virtuousgeek.org> Cc: David Woodhouse <dwmw2@infradead.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Oded Gabbay <oded.gabbay@amd.com>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/mmu_notifier.h41
1 files changed, 41 insertions, 0 deletions
diff --git a/include/linux/mmu_notifier.h b/include/linux/mmu_notifier.h
index 17907908d1df..966da2b4b803 100644
--- a/include/linux/mmu_notifier.h
+++ b/include/linux/mmu_notifier.h
@@ -284,6 +284,44 @@ static inline void mmu_notifier_mm_destroy(struct mm_struct *mm)
284 __young; \ 284 __young; \
285}) 285})
286 286
287#define ptep_clear_flush_notify(__vma, __address, __ptep) \
288({ \
289 unsigned long ___addr = __address & PAGE_MASK; \
290 struct mm_struct *___mm = (__vma)->vm_mm; \
291 pte_t ___pte; \
292 \
293 ___pte = ptep_clear_flush(__vma, __address, __ptep); \
294 mmu_notifier_invalidate_range(___mm, ___addr, \
295 ___addr + PAGE_SIZE); \
296 \
297 ___pte; \
298})
299
300#define pmdp_clear_flush_notify(__vma, __haddr, __pmd) \
301({ \
302 unsigned long ___haddr = __haddr & HPAGE_PMD_MASK; \
303 struct mm_struct *___mm = (__vma)->vm_mm; \
304 pmd_t ___pmd; \
305 \
306 ___pmd = pmdp_clear_flush(__vma, __haddr, __pmd); \
307 mmu_notifier_invalidate_range(___mm, ___haddr, \
308 ___haddr + HPAGE_PMD_SIZE); \
309 \
310 ___pmd; \
311})
312
313#define pmdp_get_and_clear_notify(__mm, __haddr, __pmd) \
314({ \
315 unsigned long ___haddr = __haddr & HPAGE_PMD_MASK; \
316 pmd_t ___pmd; \
317 \
318 ___pmd = pmdp_get_and_clear(__mm, __haddr, __pmd); \
319 mmu_notifier_invalidate_range(__mm, ___haddr, \
320 ___haddr + HPAGE_PMD_SIZE); \
321 \
322 ___pmd; \
323})
324
287/* 325/*
288 * set_pte_at_notify() sets the pte _after_ running the notifier. 326 * set_pte_at_notify() sets the pte _after_ running the notifier.
289 * This is safe to start by updating the secondary MMUs, because the primary MMU 327 * This is safe to start by updating the secondary MMUs, because the primary MMU
@@ -362,6 +400,9 @@ static inline void mmu_notifier_mm_destroy(struct mm_struct *mm)
362 400
363#define ptep_clear_flush_young_notify ptep_clear_flush_young 401#define ptep_clear_flush_young_notify ptep_clear_flush_young
364#define pmdp_clear_flush_young_notify pmdp_clear_flush_young 402#define pmdp_clear_flush_young_notify pmdp_clear_flush_young
403#define ptep_clear_flush_notify ptep_clear_flush
404#define pmdp_clear_flush_notify pmdp_clear_flush
405#define pmdp_get_and_clear_notify pmdp_get_and_clear
365#define set_pte_at_notify set_pte_at 406#define set_pte_at_notify set_pte_at
366 407
367#endif /* CONFIG_MMU_NOTIFIER */ 408#endif /* CONFIG_MMU_NOTIFIER */