]> git.ipfire.org Git - thirdparty/linux.git/commit
openrisc: Add full instruction cache invalidate functions
authorStafford Horne <shorne@gmail.com>
Fri, 22 May 2026 15:56:03 +0000 (16:56 +0100)
committerStafford Horne <shorne@gmail.com>
Sat, 23 May 2026 05:34:35 +0000 (06:34 +0100)
commit1be031de802ba486a7605b52eda825f128b026e2
tree9dcf379128a6514debb61b757a81b1ceccf929d5
parentcf40e2cee8fe86d54f7eeb38944366d5c23e42dc
openrisc: Add full instruction cache invalidate functions

Add functions to invalidate all cache lines which we will use for
static_key patching.

On OpenRISC there is no instruction to invalidate an entire cache so we
loop and invalidate cache lines one by one.  This is not extremely
expensive on OpenRISC as we usually have only a few hundred cache lines.

I considered using the invalidate cache page or range functions.
However, tracking which ranges need invalidation would have been more
expensive than flushing all pages.

Cc: stable@vger.kernel.org
Signed-off-by: Stafford Horne <shorne@gmail.com>
arch/openrisc/include/asm/cacheflush.h
arch/openrisc/kernel/smp.c
arch/openrisc/mm/cache.c