Commit d2408e0
committed
x86/alternative: Optimize returns patching
Instead of decoding each instruction in the return sites range only to
realize that that return site is a jump to the default return thunk
which is needed - X86_FEATURE_RETHUNK is enabled - lift that check
before the loop and get rid of that loop overhead.
Add comments about what gets patched, while at it.
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lore.kernel.org/r/20230512120952.7924-1-bp@alien8.de1 parent b6c881b commit d2408e0
1 file changed
Lines changed: 10 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
693 | 693 | | |
694 | 694 | | |
695 | 695 | | |
| 696 | + | |
696 | 697 | | |
697 | | - | |
698 | | - | |
699 | | - | |
700 | 698 | | |
701 | 699 | | |
702 | 700 | | |
| 701 | + | |
703 | 702 | | |
704 | 703 | | |
705 | 704 | | |
| |||
712 | 711 | | |
713 | 712 | | |
714 | 713 | | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
715 | 722 | | |
716 | 723 | | |
717 | 724 | | |
| |||
0 commit comments