]> git.baikalelectronics.ru Git - kernel.git/commit
arm64: IPI each CPU after invalidating the I-cache for kernel mappings
authorWill Deacon <will.deacon@arm.com>
Mon, 11 Jun 2018 13:22:09 +0000 (14:22 +0100)
committerWill Deacon <will.deacon@arm.com>
Thu, 5 Jul 2018 16:24:36 +0000 (17:24 +0100)
commit47c566802c605a2d346d68842962285a6398f7b7
treeb57aba6cc3433283aaf8e327e9f2a43d4eb9a2cf
parent270a37eba981f6dfe5516f0c1e30c8f8519c61fe
arm64: IPI each CPU after invalidating the I-cache for kernel mappings

When invalidating the instruction cache for a kernel mapping via
flush_icache_range(), it is also necessary to flush the pipeline for
other CPUs so that instructions fetched into the pipeline before the
I-cache invalidation are discarded. For example, if module 'foo' is
unloaded and then module 'bar' is loaded into the same area of memory,
a CPU could end up executing instructions from 'foo' when branching into
'bar' if these instructions were fetched into the pipeline before 'foo'
was unloaded.

Whilst this is highly unlikely to occur in practice, particularly as
any exception acts as a context-synchronizing operation, following the
letter of the architecture requires us to execute an ISB on each CPU
in order for the new instruction stream to be visible.

Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
arch/arm64/include/asm/cacheflush.h
arch/arm64/kernel/cpu_errata.c
arch/arm64/kernel/insn.c
arch/arm64/mm/cache.S