Gitweb: http://git.kernel.org/linus/f2f13a8535174dbb813a0607a9d4737cfba98f6c
Commit: f2f13a8535174dbb813a0607a9d4737cfba98f6c
Parent: b18018126f422f5b706fd750373425e10e84b486
Author: Ingo Molnar <mingo@elte.hu>
AuthorDate: Fri Feb 20 22:50:24 2009 +0100
Committer: Ingo Molnar <mingo@elte.hu>
CommitDate: Sat Feb 21 00:09:43 2009 +0100
x86, mm: fault.c, reorder functions
Impact: cleanup
Avoid a couple more #ifdefs by moving fundamentally non-unifiable
functions into a single #ifdef 32-bit / #else / #endif block in
fault.c: vmalloc*(), dump_pagetable(), check_vm8086_mode().
No code changed:
text data bss dec hex filename
4618 32 24 4674 1242 fault.o.before
4618 32 24 4674 1242 fault.o.after
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
arch/x86/mm/fault.c | 474 ++++++++++++++++++++++++++-------------------------
1 files changed, 239 insertions(+), 235 deletions(-)
diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c
index 379beae..4ce62fb 100644
--- a/arch/x86/mm/fault.c
+++ b/arch/x86/mm/fault.c
@@ -191,18 +191,124 @@ force_sig_info_fault(int si_signo, int si_code, unsigned long address,
force_sig_info(si_signo, &info, tsk);
}
-#ifdef CONFIG_X86_64
-static int bad_address(void *p)
+DEFINE_SPINLOCK(pgd_lock);
+LIST_HEAD(pgd_list);
+
+#ifdef CONFIG_X86_32
+static inline pmd_t *vmalloc_sync_one(pgd_t *pgd, unsigned long address)
{
- unsigned long dummy;
+ unsigned index = pgd_index(address);
+ pgd_t *pgd_k;
+ pud_t *pud, *pud_k;
+ pmd_t *pmd, *pmd_k;
- return probe_kernel_address((unsigned long *)p, dummy);
+ pgd += index;
+ pgd_k = init_mm.pgd + index;
+
+ if (!pgd_present(*pgd_k))
+ return NULL;
+
+ /*
+ * set_pgd(pgd, *pgd_k); here would be useless on PAE
+ * and redundant with the set_pmd() on non-PAE. As would
+ * set_pud.
+ */
+ pud = ...