linux-stable/arch/arm64
Mark Rutland a3bba370c2 arm64: drop unnecessary cache+tlb maintenance
In paging_init, we call flush_cache_all, but this is backed by Set/Way
operations which may not achieve anything in the presence of cache line
migration and/or system caches. If the caches are already in an
inconsistent state at this point, there is nothing we can do (short of
flushing the entire physical address space by VA) to empty architected
and system caches. As such, flush_cache_all only serves to mask other
potential bugs. Hence, this patch removes the boot-time call to
flush_cache_all.

Immediately after the cache maintenance we flush the TLBs, but this is
also unnecessary. Before enabling the MMU, the TLBs are invalidated, and
thus are initially clean. When changing the contents of active tables
(e.g. in fixup_executable() for DEBUG_RODATA) we perform the required
TLB maintenance following the update, and therefore no additional
maintenance is required to ensure the new table entries are in effect.
Since activating the MMU we will not have modified system register
fields permitted to be cached in a TLB, and therefore do not need
maintenance for any cached system register fields. Hence, the TLB flush
is unnecessary.

Shortly after the unnecessary TLB flush, we update TTBR0 to point to an
empty zero page rather than the idmap, and flush the TLBs. This
maintenance is necessary to remove the global idmap entries from the
TLBs (as they would conflict with userspace mappings), and is retained.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Acked-by: Marc Zyngier <marc.zyngier@arm.com>
Acked-by: Steve Capper <steve.capper@linaro.org>
Cc: Will Deacon <will.deacon@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2015-01-28 14:26:48 +00:00
..
boot ARM64: SoC changes for 3.19 2014-12-09 17:17:47 -08:00
configs arm64: Enable CPU_IDLE in defconfig 2015-01-27 18:26:38 +00:00
crypto Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 2014-12-13 13:33:26 -08:00
include arm64:mm: free the useless initial page table 2015-01-28 12:07:28 +00:00
kernel arm64: kernel: remove ARM64_CPU_SUSPEND config option 2015-01-27 11:35:33 +00:00
kvm arm64: kvm: decode ESR_ELx.EC when reporting exceptions 2015-01-15 12:24:52 +00:00
lib arm64: __clear_user: handle exceptions on strb 2014-11-13 15:21:26 +00:00
mm arm64: drop unnecessary cache+tlb maintenance 2015-01-28 14:26:48 +00:00
net arm64: bpf: lift restriction on last instruction 2014-12-03 18:04:09 +00:00
xen
Kconfig arm64: kernel: remove ARM64_CPU_SUSPEND config option 2015-01-27 11:35:33 +00:00
Kconfig.debug arm64: add better page protections to arm64 2015-01-22 14:54:29 +00:00
Makefile arm64: kill off the libgcc dependency 2015-01-15 15:52:21 +00:00