mm: device exclusive memory access
[sfrench/cifs-2.6.git] / mm / hmm.c
index 11df3ca30b82f094cb12fd8f890698fb5bfc0dcb..fad6be2bf07274b20ba5ec3e4749f9f80985a21d 100644 (file)
--- a/mm/hmm.c
+++ b/mm/hmm.c
@@ -26,6 +26,8 @@
 #include <linux/mmu_notifier.h>
 #include <linux/memory_hotplug.h>
 
+#include "internal.h"
+
 struct hmm_vma_walk {
        struct hmm_range        *range;
        unsigned long           last;
@@ -271,6 +273,9 @@ static int hmm_vma_handle_pte(struct mm_walk *walk, unsigned long addr,
                if (!non_swap_entry(entry))
                        goto fault;
 
+               if (is_device_exclusive_entry(entry))
+                       goto fault;
+
                if (is_migration_entry(entry)) {
                        pte_unmap(ptep);
                        hmm_vma_walk->last = addr;