Linux OpenRISC platform development
 help / color / mirror / Atom feed
From: Stafford Horne <shorne@gmail.com>
To: LKML <linux-kernel@vger.kernel.org>
Cc: Linux OpenRISC <linux-openrisc@vger.kernel.org>,
	Stafford Horne <shorne@gmail.com>
Subject: [PATCH 0/3] OpenRISC Fixes for jump_label SMP Syncing
Date: Sat, 23 May 2026 06:36:15 +0100	[thread overview]
Message-ID: <20260523053624.630443-1-shorne@gmail.com> (raw)

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


             reply	other threads:[~2026-05-23  5:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-23  5:36 Stafford Horne [this message]
2026-05-23  5:36 ` [PATCH 1/3] openrisc: Cache invalidation cleanup Stafford Horne
2026-05-23  5:36 ` [PATCH 2/3] openrisc: Add full instruction cache invalidate functions Stafford Horne
2026-05-23  5:36 ` [PATCH 3/3] openrisc: Fix jump_label smp syncing Stafford Horne

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260523053624.630443-1-shorne@gmail.com \
    --to=shorne@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-openrisc@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox