On OpenRISC I noticed our jump_label implementation based on arm64 uses
kick_all_cpus_sync() to force remote cores to pick up static_key updates. The
call to kick_all_cpus_sync() on OpenRISC does run IPIs on remote cores, but it
does not have any guarantees about instruction cache invalidation.
The jump_label code seems to work fine and passes tests, but I had suspicions
that this was incorrect. My suspicion was correct, and I was able to reproduce
issues where static_keys on remote cores were left stale after jump_label
updates using a custom test [0].
This series fixes the issues by triggering remote icache invalidation after
jump_label text patching is done.
[0] https://github.com/stffrdhrn/or1k-utils/tree/master/tests/smp_static_key_test
Stafford Horne (3):
openrisc: Cache invalidation cleanup
openrisc: Add full instruction cache invalidate functions
openrisc: Fix jump_label smp syncing
arch/openrisc/include/asm/cacheflush.h | 4 ++++
arch/openrisc/kernel/head.S | 10 ----------
arch/openrisc/kernel/jump_label.c | 2 +-
arch/openrisc/kernel/patching.c | 3 +++
arch/openrisc/kernel/smp.c | 21 +++++++++++++++++++++
arch/openrisc/mm/cache.c | 16 ++++++++++++++++
6 files changed, 45 insertions(+), 11 deletions(-)
--
2.53.0