Commit edf2d54
riscv: patch: Flush the icache right after patching to avoid illegal insns
We cannot delay the icache flush after patching some functions as we may
have patched a function that will get called before the icache flush.
The only way to completely avoid such scenario is by flushing the icache
as soon as we patch a function. This will probably be costly as we don't
batch the icache maintenance anymore.
Fixes: 6ca445d ("riscv: Fix early ftrace nop patching")
Reported-by: Conor Dooley <[email protected]>
Closes: https://lore.kernel.org/linux-riscv/20240613-lubricant-breath-061192a9489a@wendy/
Signed-off-by: Alexandre Ghiti <[email protected]>
Reviewed-by: Andy Chiu <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Palmer Dabbelt <[email protected]>1 parent 04a2aef commit edf2d54
2 files changed
+20
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | 123 | | |
127 | 124 | | |
128 | 125 | | |
| |||
156 | 153 | | |
157 | 154 | | |
158 | 155 | | |
159 | | - | |
160 | 156 | | |
161 | | - | |
| 157 | + | |
| 158 | + | |
162 | 159 | | |
163 | 160 | | |
164 | 161 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
92 | 100 | | |
93 | 101 | | |
94 | 102 | | |
| |||
135 | 143 | | |
136 | 144 | | |
137 | 145 | | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
138 | 154 | | |
139 | 155 | | |
140 | 156 | | |
| |||
189 | 205 | | |
190 | 206 | | |
191 | 207 | | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | 208 | | |
196 | 209 | | |
197 | 210 | | |
| |||
224 | 237 | | |
225 | 238 | | |
226 | 239 | | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | 240 | | |
231 | 241 | | |
232 | 242 | | |
| |||
253 | 263 | | |
254 | 264 | | |
255 | 265 | | |
256 | | - | |
257 | 266 | | |
258 | | - | |
| 267 | + | |
| 268 | + | |
259 | 269 | | |
260 | 270 | | |
261 | 271 | | |
| |||
0 commit comments