aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/arm/mm/idmap.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/arch/arm/mm/idmap.c b/arch/arm/mm/idmap.c
index 8e0e52eb76b5..d7a0ee898d24 100644
--- a/arch/arm/mm/idmap.c
+++ b/arch/arm/mm/idmap.c
@@ -25,6 +25,13 @@ static void idmap_add_pmd(pud_t *pud, unsigned long addr, unsigned long end,
25 pr_warning("Failed to allocate identity pmd.\n"); 25 pr_warning("Failed to allocate identity pmd.\n");
26 return; 26 return;
27 } 27 }
28 /*
29 * Copy the original PMD to ensure that the PMD entries for
30 * the kernel image are preserved.
31 */
32 if (!pud_none(*pud))
33 memcpy(pmd, pmd_offset(pud, 0),
34 PTRS_PER_PMD * sizeof(pmd_t));
28 pud_populate(&init_mm, pud, pmd); 35 pud_populate(&init_mm, pud, pmd);
29 pmd += pmd_index(addr); 36 pmd += pmd_index(addr);
30 } else 37 } else