]> git.hungrycats.org Git - linux/commit
ARM: 8115/1: LPAE: reduce damage caused by idmap to virtual memory layout
authorKonstantin Khlebnikov <k.khlebnikov@samsung.com>
Fri, 25 Jul 2014 08:17:12 +0000 (09:17 +0100)
committerJiri Slaby <jslaby@suse.cz>
Tue, 19 Aug 2014 12:23:34 +0000 (14:23 +0200)
commit8e49be939c5868035f26a77e997cab2e4f6b5d13
tree444d7327e2081099d1bae29b022d062a9a08f8e9
parent06bcee7de7ca6b3bd122437d9d4181ef399e7847
ARM: 8115/1: LPAE: reduce damage caused by idmap to virtual memory layout

commit 811a2407a3cf7bbd027fbe92d73416f17485a3d8 upstream.

On LPAE, each level 1 (pgd) page table entry maps 1GiB, and the level 2
(pmd) entries map 2MiB.

When the identity mapping is created on LPAE, the pgd pointers are copied
from the swapper_pg_dir.  If we find that we need to modify the contents
of a pmd, we allocate a new empty pmd table and insert it into the
appropriate 1GB slot, before then filling it with the identity mapping.

However, if the 1GB slot covers the kernel lowmem mappings, we obliterate
those mappings.

When replacing a PMD, first copy the old PMD contents to the new PMD, so
that we preserve the existing mappings, particularly the mappings of the
kernel itself.

[rewrote commit message and added code comment -- rmk]

Fixes: ae2de101739c ("ARM: LPAE: Add identity mapping support for the 3-level page table format")
Signed-off-by: Konstantin Khlebnikov <k.khlebnikov@samsung.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
arch/arm/mm/idmap.c