aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mm/idmap.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mm/idmap.c')
-rw-r--r--arch/arm/mm/idmap.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/arch/arm/mm/idmap.c b/arch/arm/mm/idmap.c
index 8e0e52eb76b5..c447ec70e868 100644
--- a/arch/arm/mm/idmap.c
+++ b/arch/arm/mm/idmap.c
@@ -9,6 +9,11 @@
9#include <asm/sections.h> 9#include <asm/sections.h>
10#include <asm/system_info.h> 10#include <asm/system_info.h>
11 11
12/*
13 * Note: accesses outside of the kernel image and the identity map area
14 * are not supported on any CPU using the idmap tables as its current
15 * page tables.
16 */
12pgd_t *idmap_pgd; 17pgd_t *idmap_pgd;
13phys_addr_t (*arch_virt_to_idmap) (unsigned long x); 18phys_addr_t (*arch_virt_to_idmap) (unsigned long x);
14 19
@@ -25,6 +30,13 @@ static void idmap_add_pmd(pud_t *pud, unsigned long addr, unsigned long end,
25 pr_warning("Failed to allocate identity pmd.\n"); 30 pr_warning("Failed to allocate identity pmd.\n");
26 return; 31 return;
27 } 32 }
33 /*
34 * Copy the original PMD to ensure that the PMD entries for
35 * the kernel image are preserved.
36 */
37 if (!pud_none(*pud))
38 memcpy(pmd, pmd_offset(pud, 0),
39 PTRS_PER_PMD * sizeof(pmd_t));
28 pud_populate(&init_mm, pud, pmd); 40 pud_populate(&init_mm, pud, pmd);
29 pmd += pmd_index(addr); 41 pmd += pmd_index(addr);
30 } else 42 } else