x86/alternatives: Use a temporary buffer when optimizing NOPs
authorBorislav Petkov (AMD) <bp@alien8.de>
Tue, 30 Jan 2024 10:59:38 +0000 (11:59 +0100)
committerBorislav Petkov (AMD) <bp@alien8.de>
Tue, 9 Apr 2024 16:08:11 +0000 (18:08 +0200)
commitf796c75837623058db1ff93252b9f1681306b83d
tree8c66dac0c85884b6b09b4d160d1e5d7f29528476
parentee8962082a4413dba1a1b3d3d23490c5221f3b8a
x86/alternatives: Use a temporary buffer when optimizing NOPs

Instead of optimizing NOPs in-place, use a temporary buffer like the
usual alternatives patching flow does. This obviates the need to grab
locks when patching, see

  6778977590da ("x86/alternatives: Disable interrupts and sync when optimizing NOPs in place")

While at it, add nomenclature definitions clarifying and simplifying the
naming of function-local variables in the alternatives code.

Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Link: https://lore.kernel.org/r/20240130105941.19707-2-bp@alien8.de
arch/x86/include/asm/text-patching.h
arch/x86/kernel/alternative.c
arch/x86/kernel/callthunks.c