Skip to content

x86/alternative: Make alternative patching more robust

Juergen Gross lkml 1 version Applied

Status from this message: The following commit has been merged into the x86/core branch of tip:

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 18 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/3x86/alternative: Drop not needed test after call of alt_replace_call()arch/x86/kernel/alternative.c+3 -60 replies
2/3x86/alternative: Refactor apply_alternatives()arch/x86/kernel/alternative.c+32 -280 replies
3/3x86/alternative: Patch a single alternative location only oncearch/x86/kernel/alternative.c+19 -818 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [PATCH 0/3] x86/alternative: Make alternative patching more robust

This small series makes alternative patching a little bit more robust for ALTERNATIVE_<n>() use cases by using a local buffer for merging multiple patch actions of the same location.

With this series applied intermediate patch results due to multiple features matching in a ALTERNATIVE_<n>() invocation won't be visible to e.g. interrupt handlers being invoked between the single patching operations.

Additionally any indirect call replacements with their direct call equivalents no longer need to be placed carefully to be the first executed patch action of an ALTERNATIVE_<n>() invocation, as the needed reference of the indirect call of the original instruction will still see the original code.

These patches have been sent before as part of my MSR paravirt rework series. I'm sending them now as an independent series, as V2 of the MSR series is no longer relying on them.

Juergen Gross (3):
x86/alternative: Drop not needed test after call of alt_replace_call() x86/alternative: Refactor apply_alternatives() x86/alternative: Patch a single alternative location only once

 arch/x86/kernel/alternative.c | 86 ++++++++++++++++++++---------------
 1 file changed, 49 insertions(+), 37 deletions(-)
Signature · 1 line
2.51.0