mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Imre Kaloz <kaloz@kernel.org>
To: Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
	linux-mips@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Andrii Nakryiko <andrii@kernel.org>,
	Eduard Zingerman <eddyz87@gmail.com>,
	Kumar Kartikeya Dwivedi <memxor@gmail.com>,
	Martin KaFai Lau <martin.lau@linux.dev>,
	Song Liu <song@kernel.org>,
	Yonghong Song <yonghong.song@linux.dev>,
	Jiri Olsa <jolsa@kernel.org>,
	Emil Tsalapatis <emil@etsalapatis.com>,
	Ihor Solodrai <ihor.solodrai@linux.dev>,
	Johan Almbladh <johan.almbladh@anyfinetworks.com>,
	Paul Burton <paulburton@kernel.org>,
	bpf@vger.kernel.org
Subject: [PATCH 0/5] MIPS: Select the R10000 LL/SC workaround at boot
Date: Mon, 26 Oct 2026 14:41:40 +0100	[thread overview]
Message-ID: <20261026134147.15988-1-kaloz@kernel.org> (raw)

Kernels for IP27, IP28 and IP30 select CONFIG_WAR_R10000_LLSC, which
retries ll/sc sequences with a branch-likely that only R10000s before
revision 3.0 need. On an R12000 Octane, dropping it makes fork, pipe,
futex and file creation 1-4% faster.

This series keeps it built in and decides at boot. Unless an affected
CPU is present, sc branches become beqz, modules are patched at load,
and tlbex and the BPF JIT emit beqz.

Patch 3 conflicts in context with the IP35 series' "MIPS: SGI-IP27:
give each CPU its own topology package id"; it resolves in one line.

Patch 5 depends on patch 2, so I'd like the whole series to go through
the MIPS tree, with an Acked-by from the BPF maintainers on patch 5.

Tested on an R12000 Octane, and the BPF JIT with test_bpf on QEMU
64-bit Malta. No R10000 before revision 3.0 was available.

Imre Kaloz (5):
  MIPS: Use SC_BEQZ in the futex and sysmips ll/sc loops
  MIPS: Select the R10000 LL/SC workaround at boot
  MIPS: SGI-IP27: Report all CPUs to the R10000 LL/SC workaround
  MIPS: tlbex: Follow the boot-time R10000 LL/SC choice
  bpf, mips: Follow the boot-time R10000 LL/SC choice

 arch/mips/Kconfig                 |   5 +-
 arch/mips/include/asm/asm.h       |   7 +-
 arch/mips/include/asm/futex.h     |   5 +-
 arch/mips/include/asm/r10k-llsc.h |  29 ++++++++
 arch/mips/kernel/Makefile         |   1 +
 arch/mips/kernel/module.c         |   5 ++
 arch/mips/kernel/r10k-llsc.c      | 111 ++++++++++++++++++++++++++++++
 arch/mips/kernel/setup.c          |   2 +
 arch/mips/kernel/smp.c            |   2 +
 arch/mips/kernel/syscall.c        |   2 +-
 arch/mips/kernel/vmlinux.lds.S    |   8 +++
 arch/mips/mm/tlbex.c              |   3 +-
 arch/mips/net/bpf_jit_comp.c      |   5 +-
 arch/mips/net/bpf_jit_comp.h      |  12 ++--
 arch/mips/net/bpf_jit_comp32.c    |   1 +
 arch/mips/net/bpf_jit_comp64.c    |   5 +-
 arch/mips/sgi-ip27/ip27-smp.c     |   2 +
 17 files changed, 188 insertions(+), 17 deletions(-)
 create mode 100644 arch/mips/include/asm/r10k-llsc.h
 create mode 100644 arch/mips/kernel/r10k-llsc.c


base-commit: 24a19b953e2a3d0ea5a8c4951a0ab8f32720c907
-- 
2.47.3


             reply	other threads:[~2026-10-26 13:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-26 13:41 Imre Kaloz [this message]
2026-10-26 13:41 ` [PATCH 1/5] MIPS: Use SC_BEQZ in the futex and sysmips ll/sc loops Imre Kaloz
2026-10-26 13:41 ` [PATCH 2/5] MIPS: Select the R10000 LL/SC workaround at boot Imre Kaloz
2026-10-26 13:41 ` [PATCH 3/5] MIPS: SGI-IP27: Report all CPUs to the R10000 LL/SC workaround Imre Kaloz
2026-10-26 13:41 ` [PATCH 4/5] MIPS: tlbex: Follow the boot-time R10000 LL/SC choice Imre Kaloz
2026-10-26 13:41 ` [PATCH 5/5] bpf, mips: " Imre Kaloz

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=20261026134147.15988-1-kaloz@kernel.org \
    --to=kaloz@kernel.org \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=eddyz87@gmail.com \
    --cc=emil@etsalapatis.com \
    --cc=ihor.solodrai@linux.dev \
    --cc=johan.almbladh@anyfinetworks.com \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=martin.lau@linux.dev \
    --cc=memxor@gmail.com \
    --cc=paulburton@kernel.org \
    --cc=song@kernel.org \
    --cc=tsbogend@alpha.franken.de \
    --cc=yonghong.song@linux.dev \
    /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

all inboxes | Powered by JetHome®