Commit 2d65f41
committed
powerpc64/modules: replace stub allocation sentinel with an explicit counter
JIRA: https://issues.redhat.com/browse/RHEL-113085
commit b137312
Author: Joe Lawrence <joe.lawrence@redhat.com>
Date: Fri Sep 12 10:27:40 2025 -0400
powerpc64/modules: replace stub allocation sentinel with an explicit counter
The logic for allocating ppc64_stub_entry trampolines in the .stubs
section relies on an inline sentinel, where a NULL .funcdata member
indicates an available slot.
While preceding commits fixed the initialization bugs that led to ftrace
stub corruption, the sentinel-based approach remains fragile: it depends
on an implicit convention between subsystems modifying different
struct types in the same memory area.
Replace the sentinel with an explicit counter, module->arch.num_stubs.
Instead of iterating through memory to find a NULL marker, the module
loader uses this counter as the boundary for the next free slot.
This simplifies the allocation code, hardens it against future changes
to stub structures, and removes the need for an extra relocation slot
previously reserved to terminate the sentinel search.
Signed-off-by: Joe Lawrence <joe.lawrence@redhat.com>
Acked-by: Naveen N Rao (AMD) <naveen@kernel.org>
Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com>
Link: https://patch.msgid.link/20250912142740.3581368-4-joe.lawrence@redhat.com
Signed-off-by: Joe Lawrence <joe.lawrence@redhat.com>1 parent 4b693d3 commit 2d65f41
2 files changed
+9
-18
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
209 | 209 | | |
210 | 210 | | |
211 | 211 | | |
212 | | - | |
213 | | - | |
| 212 | + | |
214 | 213 | | |
215 | 214 | | |
216 | 215 | | |
| |||
685 | 684 | | |
686 | 685 | | |
687 | 686 | | |
688 | | - | |
| 687 | + | |
689 | 688 | | |
690 | 689 | | |
691 | 690 | | |
| |||
696 | 695 | | |
697 | 696 | | |
698 | 697 | | |
| 698 | + | |
699 | 699 | | |
700 | 700 | | |
701 | 701 | | |
| |||
1098 | 1098 | | |
1099 | 1099 | | |
1100 | 1100 | | |
1101 | | - | |
| 1101 | + | |
1102 | 1102 | | |
1103 | 1103 | | |
1104 | 1104 | | |
1105 | 1105 | | |
1106 | 1106 | | |
1107 | 1107 | | |
1108 | | - | |
1109 | | - | |
1110 | | - | |
1111 | | - | |
1112 | | - | |
1113 | | - | |
1114 | | - | |
| 1108 | + | |
1115 | 1109 | | |
1116 | 1110 | | |
1117 | | - | |
1118 | | - | |
1119 | | - | |
1120 | | - | |
1121 | | - | |
1122 | | - | |
1123 | | - | |
| 1111 | + | |
| 1112 | + | |
| 1113 | + | |
1124 | 1114 | | |
1125 | 1115 | | |
1126 | 1116 | | |
| |||
0 commit comments