aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/ia64/kernel/ia64_ksyms.c1
-rw-r--r--arch/ia64/kernel/kprobes.c2
-rw-r--r--arch/ia64/kernel/traps.c18
-rw-r--r--drivers/message/fusion/mptbase.c6
-rw-r--r--drivers/message/fusion/mptbase.h2
-rw-r--r--fs/exec.c12
-rw-r--r--include/asm-ia64/page.h3
-rw-r--r--include/linux/mm.h2
-rw-r--r--mm/fremap.c24
-rw-r--r--mm/memory.c48
10 files changed, 44 insertions, 74 deletions
diff --git a/arch/ia64/kernel/ia64_ksyms.c b/arch/ia64/kernel/ia64_ksyms.c
index 01572814abe4..5db9d3bcbbcb 100644
--- a/arch/ia64/kernel/ia64_ksyms.c
+++ b/arch/ia64/kernel/ia64_ksyms.c
@@ -42,6 +42,7 @@ EXPORT_SYMBOL(clear_page);
42 42
43#ifdef CONFIG_VIRTUAL_MEM_MAP 43#ifdef CONFIG_VIRTUAL_MEM_MAP
44#include <linux/bootmem.h> 44#include <linux/bootmem.h>
45EXPORT_SYMBOL(min_low_pfn); /* defined by bootmem.c, but not exported by generic code */
45EXPORT_SYMBOL(max_low_pfn); /* defined by bootmem.c, but not exported by generic code */ 46EXPORT_SYMBOL(max_low_pfn); /* defined by bootmem.c, but not exported by generic code */
46#endif 47#endif
47 48
diff --git a/arch/ia64/kernel/kprobes.c b/arch/ia64/kernel/kprobes.c
index 801eeaeaf3de..2895d6e6062f 100644
--- a/arch/ia64/kernel/kprobes.c
+++ b/arch/ia64/kernel/kprobes.c
@@ -740,7 +740,7 @@ int __kprobes kprobe_exceptions_notify(struct notifier_block *self,
740 switch(val) { 740 switch(val) {
741 case DIE_BREAK: 741 case DIE_BREAK:
742 /* err is break number from ia64_bad_break() */ 742 /* err is break number from ia64_bad_break() */
743 if (args->err == 0x80200 || args->err == 0x80300) 743 if (args->err == 0x80200 || args->err == 0x80300 || args->err == 0)
744 if (pre_kprobes_handler(args)) 744 if (pre_kprobes_handler(args))
745 ret = NOTIFY_STOP; 745 ret = NOTIFY_STOP;
746 break; 746 break;
diff --git a/arch/ia64/kernel/traps.c b/arch/ia64/kernel/traps.c
index fba5fdd1f968..d3e0ecb56d62 100644
--- a/arch/ia64/kernel/traps.c
+++ b/arch/ia64/kernel/traps.c
@@ -132,24 +132,6 @@ __kprobes ia64_bad_break (unsigned long break_num, struct pt_regs *regs)
132 siginfo_t siginfo; 132 siginfo_t siginfo;
133 int sig, code; 133 int sig, code;
134 134
135 /* break.b always sets cr.iim to 0, which causes problems for
136 * debuggers. Get the real break number from the original instruction,
137 * but only for kernel code. User space break.b is left alone, to
138 * preserve the existing behaviour. All break codings have the same
139 * format, so there is no need to check the slot type.
140 */
141 if (break_num == 0 && !user_mode(regs)) {
142 struct ia64_psr *ipsr = ia64_psr(regs);
143 unsigned long *bundle = (unsigned long *)regs->cr_iip;
144 unsigned long slot;
145 switch (ipsr->ri) {
146 case 0: slot = (bundle[0] >> 5); break;
147 case 1: slot = (bundle[0] >> 46) | (bundle[1] << 18); break;
148 default: slot = (bundle[1] >> 23); break;
149 }
150 break_num = ((slot >> 36 & 1) << 20) | (slot >> 6 & 0xfffff);
151 }
152
153 /* SIGILL, SIGFPE, SIGSEGV, and SIGBUS want these field initialized: */ 135 /* SIGILL, SIGFPE, SIGSEGV, and SIGBUS want these field initialized: */
154 siginfo.si_addr = (void __user *) (regs->cr_iip + ia64_psr(regs)->ri); 136 siginfo.si_addr = (void __user *) (regs->cr_iip + ia64_psr(regs)->ri);
155 siginfo.si_imm = break_num; 137 siginfo.si_imm = break_num;
diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c
index 74022316fc63..65c2ec5c421b 100644
--- a/drivers/message/fusion/mptbase.c
+++ b/drivers/message/fusion/mptbase.c
@@ -91,9 +91,9 @@ static int mfcounter = 0;
91 * Public data... 91 * Public data...
92 */ 92 */
93int mpt_lan_index = -1; 93int mpt_lan_index = -1;
94static int mpt_stm_index = -1; 94int mpt_stm_index = -1;
95 95
96static struct proc_dir_entry *mpt_proc_root_dir; 96struct proc_dir_entry *mpt_proc_root_dir;
97 97
98#define WHOINIT_UNKNOWN 0xAA 98#define WHOINIT_UNKNOWN 0xAA
99 99
@@ -6271,6 +6271,7 @@ EXPORT_SYMBOL(mpt_resume);
6271EXPORT_SYMBOL(mpt_suspend); 6271EXPORT_SYMBOL(mpt_suspend);
6272#endif 6272#endif
6273EXPORT_SYMBOL(ioc_list); 6273EXPORT_SYMBOL(ioc_list);
6274EXPORT_SYMBOL(mpt_proc_root_dir);
6274EXPORT_SYMBOL(mpt_register); 6275EXPORT_SYMBOL(mpt_register);
6275EXPORT_SYMBOL(mpt_deregister); 6276EXPORT_SYMBOL(mpt_deregister);
6276EXPORT_SYMBOL(mpt_event_register); 6277EXPORT_SYMBOL(mpt_event_register);
@@ -6288,6 +6289,7 @@ EXPORT_SYMBOL(mpt_verify_adapter);
6288EXPORT_SYMBOL(mpt_GetIocState); 6289EXPORT_SYMBOL(mpt_GetIocState);
6289EXPORT_SYMBOL(mpt_print_ioc_summary); 6290EXPORT_SYMBOL(mpt_print_ioc_summary);
6290EXPORT_SYMBOL(mpt_lan_index); 6291EXPORT_SYMBOL(mpt_lan_index);
6292EXPORT_SYMBOL(mpt_stm_index);
6291EXPORT_SYMBOL(mpt_HardResetHandler); 6293EXPORT_SYMBOL(mpt_HardResetHandler);
6292EXPORT_SYMBOL(mpt_config); 6294EXPORT_SYMBOL(mpt_config);
6293EXPORT_SYMBOL(mpt_toolbox); 6295EXPORT_SYMBOL(mpt_toolbox);
diff --git a/drivers/message/fusion/mptbase.h b/drivers/message/fusion/mptbase.h
index 8ad277a9afa1..5f5b3fb5b4d7 100644
--- a/drivers/message/fusion/mptbase.h
+++ b/drivers/message/fusion/mptbase.h
@@ -1006,8 +1006,10 @@ extern int mptbase_sas_persist_operation(MPT_ADAPTER *ioc, u8 persist_opcode);
1006 * Public data decl's... 1006 * Public data decl's...
1007 */ 1007 */
1008extern struct list_head ioc_list; 1008extern struct list_head ioc_list;
1009extern struct proc_dir_entry *mpt_proc_root_dir;
1009 1010
1010extern int mpt_lan_index; /* needed by mptlan.c */ 1011extern int mpt_lan_index; /* needed by mptlan.c */
1012extern int mpt_stm_index; /* needed by mptstm.c */
1011 1013
1012/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 1014/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
1013#endif /* } __KERNEL__ */ 1015#endif /* } __KERNEL__ */
diff --git a/fs/exec.c b/fs/exec.c
index 1f8a9fd2c9ed..22533cce0611 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -306,9 +306,6 @@ void install_arg_page(struct vm_area_struct *vma,
306 struct page *page, unsigned long address) 306 struct page *page, unsigned long address)
307{ 307{
308 struct mm_struct *mm = vma->vm_mm; 308 struct mm_struct *mm = vma->vm_mm;
309 pgd_t * pgd;
310 pud_t * pud;
311 pmd_t * pmd;
312 pte_t * pte; 309 pte_t * pte;
313 spinlock_t *ptl; 310 spinlock_t *ptl;
314 311
@@ -316,14 +313,7 @@ void install_arg_page(struct vm_area_struct *vma,
316 goto out; 313 goto out;
317 314
318 flush_dcache_page(page); 315 flush_dcache_page(page);
319 pgd = pgd_offset(mm, address); 316 pte = get_locked_pte(mm, address, &ptl);
320 pud = pud_alloc(mm, pgd, address);
321 if (!pud)
322 goto out;
323 pmd = pmd_alloc(mm, pud, address);
324 if (!pmd)
325 goto out;
326 pte = pte_alloc_map_lock(mm, pmd, address, &ptl);
327 if (!pte) 317 if (!pte)
328 goto out; 318 goto out;
329 if (!pte_none(*pte)) { 319 if (!pte_none(*pte)) {
diff --git a/include/asm-ia64/page.h b/include/asm-ia64/page.h
index 9dd9da105278..5e6362a786b7 100644
--- a/include/asm-ia64/page.h
+++ b/include/asm-ia64/page.h
@@ -110,8 +110,9 @@ extern int ia64_pfn_valid (unsigned long pfn);
110# define pfn_to_page(pfn) (mem_map + (pfn)) 110# define pfn_to_page(pfn) (mem_map + (pfn))
111#elif defined(CONFIG_DISCONTIGMEM) 111#elif defined(CONFIG_DISCONTIGMEM)
112extern struct page *vmem_map; 112extern struct page *vmem_map;
113extern unsigned long min_low_pfn;
113extern unsigned long max_low_pfn; 114extern unsigned long max_low_pfn;
114# define pfn_valid(pfn) (((pfn) < max_low_pfn) && ia64_pfn_valid(pfn)) 115# define pfn_valid(pfn) (((pfn) >= min_low_pfn) && ((pfn) < max_low_pfn) && ia64_pfn_valid(pfn))
115# define page_to_pfn(page) ((unsigned long) (page - vmem_map)) 116# define page_to_pfn(page) ((unsigned long) (page - vmem_map))
116# define pfn_to_page(pfn) (vmem_map + (pfn)) 117# define pfn_to_page(pfn) (vmem_map + (pfn))
117#endif 118#endif
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 74f90d7eb5ef..0e73f1539d08 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -742,6 +742,8 @@ struct shrinker;
742extern struct shrinker *set_shrinker(int, shrinker_t); 742extern struct shrinker *set_shrinker(int, shrinker_t);
743extern void remove_shrinker(struct shrinker *shrinker); 743extern void remove_shrinker(struct shrinker *shrinker);
744 744
745extern pte_t *FASTCALL(get_locked_pte(struct mm_struct *mm, unsigned long addr, spinlock_t **ptl));
746
745int __pud_alloc(struct mm_struct *mm, pgd_t *pgd, unsigned long address); 747int __pud_alloc(struct mm_struct *mm, pgd_t *pgd, unsigned long address);
746int __pmd_alloc(struct mm_struct *mm, pud_t *pud, unsigned long address); 748int __pmd_alloc(struct mm_struct *mm, pud_t *pud, unsigned long address);
747int __pte_alloc(struct mm_struct *mm, pmd_t *pmd, unsigned long address); 749int __pte_alloc(struct mm_struct *mm, pmd_t *pmd, unsigned long address);
diff --git a/mm/fremap.c b/mm/fremap.c
index f851775e09c2..9f381e58bf44 100644
--- a/mm/fremap.c
+++ b/mm/fremap.c
@@ -55,20 +55,10 @@ int install_page(struct mm_struct *mm, struct vm_area_struct *vma,
55 pgoff_t size; 55 pgoff_t size;
56 int err = -ENOMEM; 56 int err = -ENOMEM;
57 pte_t *pte; 57 pte_t *pte;
58 pmd_t *pmd;
59 pud_t *pud;
60 pgd_t *pgd;
61 pte_t pte_val; 58 pte_t pte_val;
62 spinlock_t *ptl; 59 spinlock_t *ptl;
63 60
64 pgd = pgd_offset(mm, addr); 61 pte = get_locked_pte(mm, addr, &ptl);
65 pud = pud_alloc(mm, pgd, addr);
66 if (!pud)
67 goto out;
68 pmd = pmd_alloc(mm, pud, addr);
69 if (!pmd)
70 goto out;
71 pte = pte_alloc_map_lock(mm, pmd, addr, &ptl);
72 if (!pte) 62 if (!pte)
73 goto out; 63 goto out;
74 64
@@ -110,20 +100,10 @@ int install_file_pte(struct mm_struct *mm, struct vm_area_struct *vma,
110{ 100{
111 int err = -ENOMEM; 101 int err = -ENOMEM;
112 pte_t *pte; 102 pte_t *pte;
113 pmd_t *pmd;
114 pud_t *pud;
115 pgd_t *pgd;
116 pte_t pte_val; 103 pte_t pte_val;
117 spinlock_t *ptl; 104 spinlock_t *ptl;
118 105
119 pgd = pgd_offset(mm, addr); 106 pte = get_locked_pte(mm, addr, &ptl);
120 pud = pud_alloc(mm, pgd, addr);
121 if (!pud)
122 goto out;
123 pmd = pmd_alloc(mm, pud, addr);
124 if (!pmd)
125 goto out;
126 pte = pte_alloc_map_lock(mm, pmd, addr, &ptl);
127 if (!pte) 107 if (!pte)
128 goto out; 108 goto out;
129 109
diff --git a/mm/memory.c b/mm/memory.c
index 990e7dc666f8..5bfa52a98630 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -1146,6 +1146,18 @@ int zeromap_page_range(struct vm_area_struct *vma,
1146 return err; 1146 return err;
1147} 1147}
1148 1148
1149pte_t *get_locked_pte(struct mm_struct *mm, unsigned long addr, spinlock_t **ptl)
1150{
1151 pgd_t * pgd = pgd_offset(mm, addr);
1152 pud_t * pud = pud_alloc(mm, pgd, addr);
1153 if (pud) {
1154 pmd_t * pmd = pmd_alloc(mm, pgd, addr);
1155 if (pmd)
1156 return pte_alloc_map_lock(mm, pmd, addr, ptl);
1157 }
1158 return NULL;
1159}
1160
1149/* 1161/*
1150 * This is the old fallback for page remapping. 1162 * This is the old fallback for page remapping.
1151 * 1163 *
@@ -1156,10 +1168,7 @@ int zeromap_page_range(struct vm_area_struct *vma,
1156static int insert_page(struct mm_struct *mm, unsigned long addr, struct page *page, pgprot_t prot) 1168static int insert_page(struct mm_struct *mm, unsigned long addr, struct page *page, pgprot_t prot)
1157{ 1169{
1158 int retval; 1170 int retval;
1159 pgd_t * pgd; 1171 pte_t *pte;
1160 pud_t * pud;
1161 pmd_t * pmd;
1162 pte_t * pte;
1163 spinlock_t *ptl; 1172 spinlock_t *ptl;
1164 1173
1165 retval = -EINVAL; 1174 retval = -EINVAL;
@@ -1167,14 +1176,7 @@ static int insert_page(struct mm_struct *mm, unsigned long addr, struct page *pa
1167 goto out; 1176 goto out;
1168 retval = -ENOMEM; 1177 retval = -ENOMEM;
1169 flush_dcache_page(page); 1178 flush_dcache_page(page);
1170 pgd = pgd_offset(mm, addr); 1179 pte = get_locked_pte(mm, addr, &ptl);
1171 pud = pud_alloc(mm, pgd, addr);
1172 if (!pud)
1173 goto out;
1174 pmd = pmd_alloc(mm, pud, addr);
1175 if (!pmd)
1176 goto out;
1177 pte = pte_alloc_map_lock(mm, pmd, addr, &ptl);
1178 if (!pte) 1180 if (!pte)
1179 goto out; 1181 goto out;
1180 retval = -EBUSY; 1182 retval = -EBUSY;
@@ -1392,8 +1394,15 @@ static inline void cow_user_page(struct page *dst, struct page *src, unsigned lo
1392 */ 1394 */
1393 if (unlikely(!src)) { 1395 if (unlikely(!src)) {
1394 void *kaddr = kmap_atomic(dst, KM_USER0); 1396 void *kaddr = kmap_atomic(dst, KM_USER0);
1395 unsigned long left = __copy_from_user_inatomic(kaddr, (void __user *)va, PAGE_SIZE); 1397 void __user *uaddr = (void __user *)(va & PAGE_MASK);
1396 if (left) 1398
1399 /*
1400 * This really shouldn't fail, because the page is there
1401 * in the page tables. But it might just be unreadable,
1402 * in which case we just give up and fill the result with
1403 * zeroes.
1404 */
1405 if (__copy_from_user_inatomic(kaddr, uaddr, PAGE_SIZE))
1397 memset(kaddr, 0, PAGE_SIZE); 1406 memset(kaddr, 0, PAGE_SIZE);
1398 kunmap_atomic(kaddr, KM_USER0); 1407 kunmap_atomic(kaddr, KM_USER0);
1399 return; 1408 return;
@@ -1424,12 +1433,11 @@ static int do_wp_page(struct mm_struct *mm, struct vm_area_struct *vma,
1424 unsigned long address, pte_t *page_table, pmd_t *pmd, 1433 unsigned long address, pte_t *page_table, pmd_t *pmd,
1425 spinlock_t *ptl, pte_t orig_pte) 1434 spinlock_t *ptl, pte_t orig_pte)
1426{ 1435{
1427 struct page *old_page, *src_page, *new_page; 1436 struct page *old_page, *new_page;
1428 pte_t entry; 1437 pte_t entry;
1429 int ret = VM_FAULT_MINOR; 1438 int ret = VM_FAULT_MINOR;
1430 1439
1431 old_page = vm_normal_page(vma, address, orig_pte); 1440 old_page = vm_normal_page(vma, address, orig_pte);
1432 src_page = old_page;
1433 if (!old_page) 1441 if (!old_page)
1434 goto gotten; 1442 goto gotten;
1435 1443
@@ -1457,7 +1465,7 @@ gotten:
1457 1465
1458 if (unlikely(anon_vma_prepare(vma))) 1466 if (unlikely(anon_vma_prepare(vma)))
1459 goto oom; 1467 goto oom;
1460 if (src_page == ZERO_PAGE(address)) { 1468 if (old_page == ZERO_PAGE(address)) {
1461 new_page = alloc_zeroed_user_highpage(vma, address); 1469 new_page = alloc_zeroed_user_highpage(vma, address);
1462 if (!new_page) 1470 if (!new_page)
1463 goto oom; 1471 goto oom;
@@ -1465,7 +1473,7 @@ gotten:
1465 new_page = alloc_page_vma(GFP_HIGHUSER, vma, address); 1473 new_page = alloc_page_vma(GFP_HIGHUSER, vma, address);
1466 if (!new_page) 1474 if (!new_page)
1467 goto oom; 1475 goto oom;
1468 cow_user_page(new_page, src_page, address); 1476 cow_user_page(new_page, old_page, address);
1469 } 1477 }
1470 1478
1471 /* 1479 /*
@@ -2001,6 +2009,8 @@ static int do_no_page(struct mm_struct *mm, struct vm_area_struct *vma,
2001 int anon = 0; 2009 int anon = 0;
2002 2010
2003 pte_unmap(page_table); 2011 pte_unmap(page_table);
2012 BUG_ON(vma->vm_flags & VM_PFNMAP);
2013
2004 if (vma->vm_file) { 2014 if (vma->vm_file) {
2005 mapping = vma->vm_file->f_mapping; 2015 mapping = vma->vm_file->f_mapping;
2006 sequence = mapping->truncate_count; 2016 sequence = mapping->truncate_count;
@@ -2033,7 +2043,7 @@ retry:
2033 page = alloc_page_vma(GFP_HIGHUSER, vma, address); 2043 page = alloc_page_vma(GFP_HIGHUSER, vma, address);
2034 if (!page) 2044 if (!page)
2035 goto oom; 2045 goto oom;
2036 cow_user_page(page, new_page, address); 2046 copy_user_highpage(page, new_page, address);
2037 page_cache_release(new_page); 2047 page_cache_release(new_page);
2038 new_page = page; 2048 new_page = page;
2039 anon = 1; 2049 anon = 1;