Commit 44eebf9
create-diff-object: Add support for arm64 DYNAMIC_FTRACE_WITH_CALL_OPS
For arm64 this option uses -fpatchable-function-entry=M,2, so 2 NOPs
are placed before the function entry point (in order to store a pointer
to ftrace_ops). When calculating function padding, check for the
presence of the two NOPs, and adjust the padding size by 8 if they are
found.
This was merged in the upstream kernel in v6.8 with:
baaf553d3bc3 ("arm64: Implement HAVE_DYNAMIC_FTRACE_WITH_CALL_OPS")
With this into the equation, the entry of a function can look like one
of:
1. Without DYNAMIC_FTRACE_WITH_CALL_OPS and CONFIG_ARM64_BTI_KERNEL
-------------------------------------------------------------------
Disassembly of section .text.cmdline_proc_show:
0000000000000008 <cmdline_proc_show>:
8: d503201f nop
c: d503201f nop
2. Without DYNAMIC_FTRACE_WITH_CALL_OPS and with CONFIG_ARM64_BTI_KERNEL
------------------------------------------------------------------------
Disassembly of section .text.cmdline_proc_show:
0000000000000008 <cmdline_proc_show>:
0: d503245f bti c
4: d503201f nop
8: d503201f nop
3. With DYNAMIC_FTRACE_WITH_CALL_OPS and without CONFIG_ARM64_BTI_KERNEL
------------------------------------------------------------------------
Disassembly of section .text.cmdline_proc_show:
0000000000000000 <cmdline_proc_show-0x8>:
0: d503201f nop
4: d503201f nop
0000000000000008 <cmdline_proc_show>:
8: d503201f nop
c: d503201f nop
4. With DYNAMIC_FTRACE_WITH_CALL_OPS and with CONFIG_ARM64_BTI_KERNEL
---------------------------------------------------------------------
Disassembly of section .text.cmdline_proc_show:
0000000000000000 <cmdline_proc_show-0x8>:
0: d503201f nop
4: d503201f nop
0000000000000008 <cmdline_proc_show>:
8: d503245f bti c
c: d503201f nop
10: d503201f nop
make create-diff-object aware of DYNAMIC_FTRACE_WITH_CALL_OPS and its
quirks.
Signed-off-by: Dylan Hatch <dylanbhatch@google.com>
Signed-off-by: Puranjay Mohan <pjy@amazon.com>1 parent 0db9999 commit 44eebf9
1 file changed
+38
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
255 | 255 | | |
256 | 256 | | |
257 | 257 | | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
258 | 289 | | |
259 | 290 | | |
260 | 291 | | |
| |||
271 | 302 | | |
272 | 303 | | |
273 | 304 | | |
| 305 | + | |
| 306 | + | |
274 | 307 | | |
275 | 308 | | |
276 | 309 | | |
| |||
3808 | 3841 | | |
3809 | 3842 | | |
3810 | 3843 | | |
| 3844 | + | |
| 3845 | + | |
| 3846 | + | |
| 3847 | + | |
| 3848 | + | |
3811 | 3849 | | |
3812 | 3850 | | |
3813 | 3851 | | |
| |||
0 commit comments