[PATCH v3 0/3] x86/alternative: Patch a single alternative location only once

Juergen Gross posted 3 patches 1 month, 1 week ago
There is a newer version of this series
arch/x86/kernel/alternative.c | 135 +++++++++++++++++++---------------
1 file changed, 76 insertions(+), 59 deletions(-)
[PATCH v3 0/3] x86/alternative: Patch a single alternative location only once
Posted by Juergen Gross 1 month, 1 week ago
Instead of patching a single location potentially multiple times in
case of nested ALTERNATIVE()s, do the patching only after having
evaluated all alt_instr instances for that location.

Changes in V2:
- complete rework (Boris Petkov)

Changes in V3:
- split former V2 patch into 2 by introducing a helper function (Boris Petkov)
- repost the small cleanup patch 1 which was taken before, but has somehow
  vanished from the tip x86/alternative branch (it is still in the tip
  master branch, but I couldn't find it in any other tip branch).

Juergen Gross (3):
  x86/alternative: Drop not needed test after call of alt_replace_call()
  x86/alternative: Use a helper function for patching alternatives
  x86/alternative: Patch a single alternative location only once

 arch/x86/kernel/alternative.c | 135 +++++++++++++++++++---------------
 1 file changed, 76 insertions(+), 59 deletions(-)

-- 
2.51.0
Re: [PATCH v3 0/3] x86/alternative: Patch a single alternative location only once
Posted by Borislav Petkov 1 month ago
On Mon, Nov 10, 2025 at 09:23:36AM +0100, Juergen Gross wrote:
> Changes in V3:
> - split former V2 patch into 2 by introducing a helper function (Boris Petkov)
> - repost the small cleanup patch 1 which was taken before, but has somehow
>   vanished from the tip x86/alternative branch (it is still in the tip
>   master branch, but I couldn't find it in any other tip branch).

You mean this one?

https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git/commit/?h=x86/core&id=ad74016b919cbad78d203fa1c459ae18e73ce586

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette
Re: [PATCH v3 0/3] x86/alternative: Patch a single alternative location only once
Posted by Jürgen Groß 1 month ago
On 16.11.25 13:42, Borislav Petkov wrote:
> On Mon, Nov 10, 2025 at 09:23:36AM +0100, Juergen Gross wrote:
>> Changes in V3:
>> - split former V2 patch into 2 by introducing a helper function (Boris Petkov)
>> - repost the small cleanup patch 1 which was taken before, but has somehow
>>    vanished from the tip x86/alternative branch (it is still in the tip
>>    master branch, but I couldn't find it in any other tip branch).
> 
> You mean this one?
> 
> https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git/commit/?h=x86/core&id=ad74016b919cbad78d203fa1c459ae18e73ce586
> 

Yes.


Juergen