]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - arch/x86/mm/gup.c
Merge branch 'perfcounters-fixes-for-linus' of git://git.kernel.org/pub/scm/linux...
[karo-tx-linux.git] / arch / x86 / mm / gup.c
index 2d1d784ad3f789aa250e86ba418013c8010484f3..71da1bca13cbb9fde26f59100f1b9b3b30f3a8e5 100644 (file)
@@ -303,11 +303,16 @@ int get_user_pages_fast(unsigned long start, int nr_pages, int write,
        start &= PAGE_MASK;
        addr = start;
        len = (unsigned long) nr_pages << PAGE_SHIFT;
+
        end = start + len;
-       if (unlikely(!access_ok(write ? VERIFY_WRITE : VERIFY_READ,
-                                       (void __user *)start, len)))
+       if (end < start)
                goto slow_irqon;
 
+#ifdef CONFIG_X86_64
+       if (end >> __VIRTUAL_MASK_SHIFT)
+               goto slow_irqon;
+#endif
+
        /*
         * XXX: batch / limit 'nr', to avoid large irq off latency
         * needs some instrumenting to determine the common sizes used by