All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ard Biesheuvel <ardb@kernel.org>
To: linux-kernel@vger.kernel.org
Cc: Ard Biesheuvel <ardb@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
	Heiko Carstens <hca@linux.ibm.com>,
	Vasily Gorbik <gor@linux.ibm.com>,
	Alexander Gordeev <agordeev@linux.ibm.com>,
	Christian Borntraeger <borntraeger@linux.ibm.com>,
	Sven Schnelle <svens@linux.ibm.com>,
	linux-mips@vger.kernel.org, linux-s390@vger.kernel.org
Subject: [PATCH v2 0/3] jump_label: get rid of NOP patching where possible
Date: Wed, 15 Jun 2022 17:41:39 +0200	[thread overview]
Message-ID: <20220615154142.1574619-1-ardb@kernel.org> (raw)

The only architecture that actually needs to convert compiler generated
jump label NOP encodings into something else at runtime is MIPS, because
the assembler cannot be trusted to emit a sequence that can be safely
patched into a branch instruction.

All other architectures either do nothing with jump label NOPs at load
time, or patch a perfectly good NOP into a different one, or into the same
one - none of this seems very useful, so let's get rid of it where we
can.

Changes since v1:
- use a default implementation of arch_jump_label_transform_static()
  instead of an empty macro in patch #3
- fix MIPS with CONFIG_MODULES=n
- add acks from Mark and Peter to patch #3

Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: Heiko Carstens <hca@linux.ibm.com>
Cc: Vasily Gorbik <gor@linux.ibm.com>
Cc: Alexander Gordeev <agordeev@linux.ibm.com>
Cc: Christian Borntraeger <borntraeger@linux.ibm.com>
Cc: Sven Schnelle <svens@linux.ibm.com>
Cc: linux-mips@vger.kernel.org
Cc: linux-s390@vger.kernel.org

Ard Biesheuvel (3):
  jump_label: s390: avoid pointless initial NOP patching
  jump_label: mips: move module NOP patching into arch code
  jump_label: make initial NOP patching the special case

 Documentation/staging/static-keys.rst |  3 --
 arch/arc/kernel/jump_label.c          | 13 -------
 arch/arm/kernel/jump_label.c          |  6 ---
 arch/arm64/kernel/jump_label.c        | 11 ------
 arch/mips/include/asm/jump_label.h    |  2 +
 arch/mips/kernel/jump_label.c         | 19 +++++++++
 arch/mips/kernel/module.c             |  5 ++-
 arch/parisc/kernel/jump_label.c       | 11 ------
 arch/riscv/kernel/jump_label.c        | 12 ------
 arch/s390/include/asm/jump_label.h    |  5 +--
 arch/s390/kernel/jump_label.c         | 28 +++----------
 arch/s390/kernel/module.c             |  1 -
 arch/sparc/kernel/module.c            |  3 --
 arch/x86/kernel/jump_label.c          | 13 -------
 arch/x86/kernel/module.c              |  3 --
 include/linux/jump_label.h            |  7 +---
 kernel/jump_label.c                   | 41 +++-----------------
 17 files changed, 38 insertions(+), 145 deletions(-)

-- 
2.35.1


             reply	other threads:[~2022-06-15 15:41 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-15 15:41 Ard Biesheuvel [this message]
2022-06-15 15:41 ` [PATCH v2 1/3] jump_label: s390: avoid pointless initial NOP patching Ard Biesheuvel
2022-06-26  7:57   ` Alexander Gordeev
2022-06-28  7:09   ` [tip: locking/core] " tip-bot2 for Ard Biesheuvel
2022-06-15 15:41 ` [PATCH v2 2/3] jump_label: mips: move module NOP patching into arch code Ard Biesheuvel
2022-06-26  8:03   ` Alexander Gordeev
2022-06-28  7:09   ` [tip: locking/core] " tip-bot2 for Ard Biesheuvel
2022-06-15 15:41 ` [PATCH v2 3/3] jump_label: make initial NOP patching the special case Ard Biesheuvel
2022-06-16 11:25   ` Ard Biesheuvel
2022-06-17 13:40     ` Peter Zijlstra
2022-06-26  8:04   ` Alexander Gordeev
2022-06-28  7:09   ` [tip: locking/core] " tip-bot2 for Ard Biesheuvel

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=20220615154142.1574619-1-ardb@kernel.org \
    --to=ardb@kernel.org \
    --cc=agordeev@linux.ibm.com \
    --cc=borntraeger@linux.ibm.com \
    --cc=gor@linux.ibm.com \
    --cc=hca@linux.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=peterz@infradead.org \
    --cc=svens@linux.ibm.com \
    --cc=tsbogend@alpha.franken.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.