[PATCH] ARM: Move PGD kernel page table initialisation
authorRussell King <rmk@dyn-67.arm.linux.org.uk>
Mon, 27 Jun 2005 13:08:56 +0000 (14:08 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Mon, 27 Jun 2005 13:08:56 +0000 (14:08 +0100)
It doesn't make sense to have the PGD kernel pointers initialisation
separate from the PGD user pointers, especially when we clean the
data cache over the whole range.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/mm/mm-armv.c

index 2c2b93d77d433248dba64b6a1dd525eae51277fc..d79864a0dfa61d9d575a0b13b144bfe3c7c1d80d 100644 (file)
@@ -169,7 +169,14 @@ pgd_t *get_pgd_slow(struct mm_struct *mm)
 
        memzero(new_pgd, FIRST_KERNEL_PGD_NR * sizeof(pgd_t));
 
+       /*
+        * Copy over the kernel and IO PGD entries
+        */
        init_pgd = pgd_offset_k(0);
+       memcpy(new_pgd + FIRST_KERNEL_PGD_NR, init_pgd + FIRST_KERNEL_PGD_NR,
+                      (PTRS_PER_PGD - FIRST_KERNEL_PGD_NR) * sizeof(pgd_t));
+
+       clean_dcache_area(new_pgd, PTRS_PER_PGD * sizeof(pgd_t));
 
        if (!vectors_high()) {
                /*
@@ -198,14 +205,6 @@ pgd_t *get_pgd_slow(struct mm_struct *mm)
                spin_unlock(&mm->page_table_lock);
        }
 
-       /*
-        * Copy over the kernel and IO PGD entries
-        */
-       memcpy(new_pgd + FIRST_KERNEL_PGD_NR, init_pgd + FIRST_KERNEL_PGD_NR,
-                      (PTRS_PER_PGD - FIRST_KERNEL_PGD_NR) * sizeof(pgd_t));
-
-       clean_dcache_area(new_pgd, PTRS_PER_PGD * sizeof(pgd_t));
-
        return new_pgd;
 
 no_pte: