linux/arch/arm64/mm
Will Deacon 8ec4198743 arm64: mm: ensure patched kernel text is fetched from PoU
The arm64 booting document requires that the bootloader has cleaned the
kernel image to the PoC. However, when a CPU re-enters the kernel due to
either a CPU hotplug "on" event or resuming from a low-power state (e.g.
cpuidle), the kernel text may in-fact be dirty at the PoU due to things
like alternative patching or even module loading.

Thanks to I-cache speculation with the MMU off, stale instructions could
be fetched prior to enabling the MMU, potentially leading to crashes
when executing regions of code that have been modified at runtime.

This patch addresses the issue by ensuring that the local I-cache is
invalidated immediately after a CPU has enabled its MMU but before
jumping out of the identity mapping. Any stale instructions fetched from
the PoC will then be discarded and refetched correctly from the PoU.
Patching kernel text executed prior to the MMU being enabled is
prohibited, so the early entry code will always be clean.

Reviewed-by: Mark Rutland <mark.rutland@arm.com>
Tested-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
2015-08-05 10:05:20 +01:00
..
cache.S arm64: mm: Adopt new alternative assembler macros 2015-07-27 11:08:40 +01:00
context.c arm64: force CONFIG_SMP=y and remove redundant #ifdefs 2015-07-27 11:08:40 +01:00
copypage.c arm64: export __cpu_{clear,copy}_user_page functions 2014-07-08 17:30:51 +01:00
dma-mapping.c arm64: dma-mapping: Simplify pgprot handling 2015-08-03 13:17:38 +01:00
dump.c arm64: mm: Fix build error with CONFIG_SPARSEMEM_VMEMMAP disabled 2015-05-05 12:22:17 +01:00
extable.c arm64: MMU fault handling and page table management 2012-09-17 13:41:57 +01:00
fault.c arm64/BUG: Use BRK instruction for generic BUG traps 2015-07-27 11:08:42 +01:00
flush.c arm64: force CONFIG_SMP=y and remove redundant #ifdefs 2015-07-27 11:08:40 +01:00
hugetlbpage.c arm64: hugetlb: remove paragraph about writing to FSF 2015-07-27 11:08:40 +01:00
init.c arm64: mm: add __init section marker to free_initrd_mem 2015-07-27 18:29:18 +01:00
ioremap.c arm64: add ioremap physical address information 2015-01-23 15:29:06 +00:00
Makefile arm64: remove another unnecessary libfdt include path 2015-07-06 17:15:14 +01:00
mm.h arm64: add better page protections to arm64 2015-01-22 14:54:29 +00:00
mmap.c mm: expose arch_mmap_rnd when available 2015-04-14 16:49:05 -07:00
mmu.c arm64: mm: mark create_mapping as __init 2015-07-28 11:36:09 +01:00
pageattr.c arm64: mm: unexport set_memory_ro and set_memory_rw 2015-03-19 10:43:56 +00:00
pgd.c arm64: pgalloc: consistently use PGALLOC_GFP 2014-11-20 12:05:18 +00:00
proc-macros.S arm64: mm: increase VA range of identity map 2015-03-23 11:35:29 +00:00
proc.S arm64: mm: ensure patched kernel text is fetched from PoU 2015-08-05 10:05:20 +01:00