pahole: Fix arm64 argument register allocation
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest3 patches 4 repliesIn review
- v12 patches 3 repliesSuperseded
Changes in v2 from the cover letter
- v1: https://lore.kernel.org/bpf/[email protected]/
- add commit "Do not align the argument register index for FP arguments".
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/3 | dwarf_loader: Skip the argument register the arm64 ABI leaves as a holedwarf_loader.c dwarves.h | +51 | 0 replies | |
| 2/3 | dwarf_loader: Do not align the argument register index for FP argumentsdwarf_loader.c dwarves.h | +30 | 0 replies | |
| 3/3 | tests: tests: Add test for 16-byte aligned arguments on arm64tests/ tests/ | +78 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.
Cover letter [PATCH dwarves v2 0/3] pahole: Fix arm64 argument register allocation
The arm64 ABI starts an argument twice the register size on an even-numbered argument register, leaving a hole when the next free register is an odd one:
u64 f(u64 a, __int128 v, u64 b);
passes a in x0, v in x2:x3 -- skipping x1 -- and b in x4. pahole did not model the hole, so b looked like it was in an unexpected register and the whole function was dropped from BTF. Patch 1 skips the register the ABI leaves behind, patch 3 adds a test for it. Only arm64 has this rule; the other architectures are unaffected.
Patch 2 is a small follow-up. Floating point and vector arguments are allocated from a register bank of their own -- v0-v7 on arm64, xmm0-xmm7 on x86-64 -- so a wide one never occupies a general purpose register pair and must not trigger the even-register rule either. It does not change the BTF emitted today, because such an argument still advances the general purpose register index by its own size, so it comes with no test of its own; it keeps the alignment rule scoped to the bank it applies to.
Changelog:
v1 -> v2:
- v1: https://lore.kernel.org/bpf/[email protected]/
- add commit "Do not align the argument register index for FP arguments".
Yonghong Song (3):
dwarf_loader: Skip the argument register the arm64 ABI leaves as a
hole
dwarf_loader: Do not align the argument register index for FP
arguments
tests: tests: Add test for 16-byte aligned arguments on arm64
dwarf_loader.c | 72 ++++++++++++++++++++++++++++++++-- dwarves.h | 11 ++++++ tests/clang_parm_align16.sh | 77 +++++++++++++++++++++++++++++++++++++ tests/test_lib.sh | 3 +- 4 files changed, 158 insertions(+), 5 deletions(-) create mode 100755 tests/clang_parm_align16.sh
Signature · 1 line
2.53.0-Meta