1
0
Fork 0
alistair23-linux/arch/arm64
Mark Rutland 068a17a580 arm64: mm: create new fine-grained mappings at boot
At boot we may change the granularity of the tables mapping the kernel
(by splitting or making sections). This may happen when we create the
linear mapping (in __map_memblock), or at any point we try to apply
fine-grained permissions to the kernel (e.g. fixup_executable,
mark_rodata_ro, fixup_init).

Changing the active page tables in this manner may result in multiple
entries for the same address being allocated into TLBs, risking problems
such as TLB conflict aborts or issues derived from the amalgamation of
TLB entries. Generally, a break-before-make (BBM) approach is necessary
to avoid conflicts, but we cannot do this for the kernel tables as it
risks unmapping text or data being used to do so.

Instead, we can create a new set of tables from scratch in the safety of
the existing mappings, and subsequently migrate over to these using the
new cpu_replace_ttbr1 helper, which avoids the two sets of tables being
active simultaneously.

To avoid issues when we later modify permissions of the page tables
(e.g. in fixup_init), we must create the page tables at a granularity
such that later modification does not result in splitting of tables.

This patch applies this strategy, creating a new set of fine-grained
page tables from scratch, and safely migrating to them. The existing
fixmap and kasan shadow page tables are reused in the new fine-grained
tables.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Cc: Andrey Ryabinin <ryabinin.a.a@gmail.com>
Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Tested-by: Jeremy Linton <jeremy.linton@arm.com>
Cc: Laura Abbott <labbott@fedoraproject.org>
Cc: Will Deacon <will.deacon@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2016-02-16 15:10:46 +00:00
..
boot ARM: SoC fixes for v4.5-rc 2016-02-07 15:23:20 -08:00
configs arm64: defconfig: updates for 4.5 2016-01-26 11:24:41 +00:00
crypto arm64: crypto: reduce priority of core AES cipher 2015-11-18 12:09:08 +00:00
include arm64: mm: create new fine-grained mappings at boot 2016-02-16 15:10:46 +00:00
kernel arm64: ensure _stext and _etext are page-aligned 2016-02-16 15:10:46 +00:00
kvm arm64: KVM: Fix guest dead loop when register accessor returns false 2016-01-24 21:56:01 +00:00
lib arm64: add KASAN support 2015-10-12 17:46:36 +01:00
mm arm64: mm: create new fine-grained mappings at boot 2016-02-16 15:10:46 +00:00
net arm64: bpf: add extra pass to handle faulty codegen 2016-01-17 19:15:26 -05:00
xen xen/arm: introduce HYPERVISOR_platform_op on arm and arm64 2015-12-21 14:40:56 +00:00
Kconfig dma-mapping: always provide the dma_map_ops based implementation 2016-01-20 17:09:18 -08:00
Kconfig.debug arch: consolidate CONFIG_STRICT_DEVM in lib/Kconfig.debug 2016-01-09 06:30:49 -08:00
Kconfig.platforms ARM: SoC support for Tegra platforms for v4.5 2016-01-22 17:30:52 -08:00
Makefile arm64: errata: Add -mpc-relative-literal-loads to build flags 2016-01-26 11:17:23 +00:00