]> git.baikalelectronics.ru Git - kernel.git/commit
arm64: remove unnecessary cache flush at boot
authorMark Rutland <mark.rutland@arm.com>
Wed, 14 Aug 2013 08:54:54 +0000 (09:54 +0100)
committerCatalin Marinas <catalin.marinas@arm.com>
Tue, 4 Mar 2014 01:07:22 +0000 (01:07 +0000)
commit2de3ab2ea3ed8b5b10147f50c49f3f281a1feba5
tree3c962f6ba12e9d3172720b2a81c14adf89f48264
parent8a31e7ddf9f6fdf46d65ad9a53357e0babf78036
arm64: remove unnecessary cache flush at boot

Currently we flush the entire dcache at boot within __cpu_setup, but
this is unnecessary as the booting protocol demands that the dcache is
invalid and off upon entering the kernel. The presence of the cache
flush only serves to hide bugs in bootloaders, and is not safe in the
presence of SMP.

In an SMP boot scenario the CPUs enter coherency outside of the kernel,
and the primary CPU enables its caches before bringing up secondary
CPUs. Therefore if any secondary CPU has an entry in its cache (in
violation of the boot protocol), the primary CPU might snoop it even if
the secondary CPU's cache is disabled. The boot-time cache flush only
serves to hide a firmware bug, and slows down a cpu boot unnecessarily.

This patch removes the unnecessary boot-time cache flush.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Acked-by: Will Deacon <will.deacon@arm.com>
[catalin.marinas@arm.com: make __flush_dcache_all local only]
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/mm/cache.S
arch/arm64/mm/proc.S