aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/mm
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/mm')
-rw-r--r--arch/x86/mm/fault.c3
-rw-r--r--arch/x86/mm/gup.c9
-rw-r--r--arch/x86/mm/init_64.c2
3 files changed, 9 insertions, 5 deletions
diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c
index baa0e86adfbc..c403526d5d15 100644
--- a/arch/x86/mm/fault.c
+++ b/arch/x86/mm/fault.c
@@ -952,8 +952,6 @@ do_page_fault(struct pt_regs *regs, unsigned long error_code)
952 tsk = current; 952 tsk = current;
953 mm = tsk->mm; 953 mm = tsk->mm;
954 954
955 prefetchw(&mm->mmap_sem);
956
957 /* Get the faulting address: */ 955 /* Get the faulting address: */
958 address = read_cr2(); 956 address = read_cr2();
959 957
@@ -963,6 +961,7 @@ do_page_fault(struct pt_regs *regs, unsigned long error_code)
963 */ 961 */
964 if (kmemcheck_active(regs)) 962 if (kmemcheck_active(regs))
965 kmemcheck_hide(regs); 963 kmemcheck_hide(regs);
964 prefetchw(&mm->mmap_sem);
966 965
967 if (unlikely(kmmio_fault(regs, address))) 966 if (unlikely(kmmio_fault(regs, address)))
968 return; 967 return;
diff --git a/arch/x86/mm/gup.c b/arch/x86/mm/gup.c
index 2d1d784ad3f7..71da1bca13cb 100644
--- a/arch/x86/mm/gup.c
+++ b/arch/x86/mm/gup.c
@@ -303,11 +303,16 @@ int get_user_pages_fast(unsigned long start, int nr_pages, int write,
303 start &= PAGE_MASK; 303 start &= PAGE_MASK;
304 addr = start; 304 addr = start;
305 len = (unsigned long) nr_pages << PAGE_SHIFT; 305 len = (unsigned long) nr_pages << PAGE_SHIFT;
306
306 end = start + len; 307 end = start + len;
307 if (unlikely(!access_ok(write ? VERIFY_WRITE : VERIFY_READ, 308 if (end < start)
308 (void __user *)start, len)))
309 goto slow_irqon; 309 goto slow_irqon;
310 310
311#ifdef CONFIG_X86_64
312 if (end >> __VIRTUAL_MASK_SHIFT)
313 goto slow_irqon;
314#endif
315
311 /* 316 /*
312 * XXX: batch / limit 'nr', to avoid large irq off latency 317 * XXX: batch / limit 'nr', to avoid large irq off latency
313 * needs some instrumenting to determine the common sizes used by 318 * needs some instrumenting to determine the common sizes used by
diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
index 9c543290a813..c4378f4fd4a5 100644
--- a/arch/x86/mm/init_64.c
+++ b/arch/x86/mm/init_64.c
@@ -527,7 +527,7 @@ phys_pud_update(pgd_t *pgd, unsigned long addr, unsigned long end,
527 return phys_pud_init(pud, addr, end, page_size_mask); 527 return phys_pud_init(pud, addr, end, page_size_mask);
528} 528}
529 529
530unsigned long __init 530unsigned long __meminit
531kernel_physical_mapping_init(unsigned long start, 531kernel_physical_mapping_init(unsigned long start,
532 unsigned long end, 532 unsigned long end,
533 unsigned long page_size_mask) 533 unsigned long page_size_mask)