Skip to content

x86/alternatives: Do NOPs optimization on a temporary buffer

Borislav Petkov lkml 2 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest4 patches 0 repliesNew
  2. v14 patches 2 repliesApplied

Changelog from the cover letter

=========

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4x86/alternatives: Use a temporary buffer when optimizing NOPsarch/x86/include/asm/text-patching.h arch/x86/kernel/alternative.c arch/x86/kernel/callthunks.c+49 -460 replies
2/4x86/alternatives: Get rid of __optimize_nops()arch/x86/kernel/alternative.c+16 -430 replies
3/4x86/alternatives: Optimize optimize_nops()arch/x86/kernel/alternative.c+4 -00 replies
4/4x86/alternatives: Sort local vars in apply_alternatives()arch/x86/kernel/alternative.c+2 -20 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 0/4] x86/alternatives: Do NOPs optimization on a temporary buffer

From: "Borislav Petkov (AMD)" <[email protected]>

Hi,

here's v2 of the set to do NOPs optimizations on a temporary buffer after the last-minute conflict and resulting breakage before the last merge window which made me retract those.

This v2 has been extensively tested on 6.9-rc1.

Thx.

Changelog:
=========

v0:

here's a small set which sprang out from my reacting to the fact that NOPs optimization in the alternatives code needs to happen on a temporary buffer like the other alternative operations - not in-place and cause all kinds of fun.

The result is this, which makes the alternatives code simpler and it is a net win, size-wise:

 1 file changed, 50 insertions(+), 72 deletions(-)

Constructive feedback is always welcome!

Borislav Petkov (AMD) (4):
x86/alternatives: Use a temporary buffer when optimizing NOPs x86/alternatives: Get rid of __optimize_nops() x86/alternatives: Optimize optimize_nops() x86/alternatives: Sort local vars in apply_alternatives()

 arch/x86/include/asm/text-patching.h |   2 +-
 arch/x86/kernel/alternative.c        | 133 ++++++++++++---------------
 arch/x86/kernel/callthunks.c         |   9 +-
 3 files changed, 62 insertions(+), 82 deletions(-)
Signature · 1 line
2.43.0