Commit 6f0ecd5
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 01db546 commit 6f0ecd5
1 file changed
Lines changed: 47 additions & 1 deletion
| 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 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
258 | 294 | | |
259 | 295 | | |
260 | 296 | | |
| |||
271 | 307 | | |
272 | 308 | | |
273 | 309 | | |
| 310 | + | |
| 311 | + | |
274 | 312 | | |
275 | 313 | | |
276 | 314 | | |
| |||
3898 | 3936 | | |
3899 | 3937 | | |
3900 | 3938 | | |
| 3939 | + | |
3901 | 3940 | | |
3902 | 3941 | | |
| 3942 | + | |
| 3943 | + | |
| 3944 | + | |
| 3945 | + | |
| 3946 | + | |
| 3947 | + | |
3903 | 3948 | | |
3904 | 3949 | | |
3905 | 3950 | | |
| |||
3909 | 3954 | | |
3910 | 3955 | | |
3911 | 3956 | | |
3912 | | - | |
| 3957 | + | |
| 3958 | + | |
3913 | 3959 | | |
3914 | 3960 | | |
3915 | 3961 | | |
| |||
0 commit comments