ARM: btc: avoid invalidating the branch target cache on kernel TLB maintanence
commit4348810a241a330d3d143d62d7c988ec8b2e6629
authorRussell King <rmk+kernel@arm.linux.org.uk>
Tue, 5 Jul 2011 08:01:13 +0000 (5 09:01 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Tue, 19 Jul 2011 10:44:06 +0000 (19 11:44 +0100)
tree057e8799eb71e35702f39dc276bceb5d93567000
parenteb96c925152fc289311e5d7e956b919e9b60ab53
ARM: btc: avoid invalidating the branch target cache on kernel TLB maintanence

Kernel space needs very little in the way of BTC maintanence as most
mappings which are created and destroyed are non-executable, and so
could never enter the instruction stream.

The case which does warrant BTC maintanence is when a module is loaded.
This creates a new executable mapping, but at that point the pages have
not been initialized with code and data, so at that point they contain
unpredictable information.  Invalidating the BTC at this stage serves
little useful purpose.

Before we execute module code, we call flush_icache_range(), which deals
with the BTC maintanence requirements.  This ensures that we have a BTC
maintanence operation before we execute code via the newly created
mapping.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/include/asm/tlbflush.h
arch/arm/mm/tlb-fa.S
arch/arm/mm/tlb-v6.S
arch/arm/mm/tlb-v7.S