Commit 7e00c01
x86/alternative: Optimize returns patching
commit d2408e0 upstream.
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) <[email protected]>
Acked-by: Peter Zijlstra (Intel) <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Pawan Gupta <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>1 parent c2bece0 commit 7e00c01
1 file changed
+10
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
778 | 778 | | |
779 | 779 | | |
780 | 780 | | |
| 781 | + | |
781 | 782 | | |
782 | | - | |
783 | | - | |
784 | | - | |
785 | 783 | | |
786 | 784 | | |
787 | 785 | | |
| 786 | + | |
788 | 787 | | |
789 | 788 | | |
790 | 789 | | |
| |||
797 | 796 | | |
798 | 797 | | |
799 | 798 | | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
800 | 807 | | |
801 | 808 | | |
802 | 809 | | |
| |||
0 commit comments