diff options
| author | Yonghong Song <yonghong.song@linux.dev> | 2026-08-18 22:53:14 -0700 |
|---|---|---|
| committer | Eduard Zingerman <eddyz87@gmail.com> | 2026-08-21 10:49:28 -0700 |
| commit | a2e98481a6396f919ad91ba9c2ff3ec61c4028b3 (patch) | |
| tree | 503f8d04e3dc7cfe26ba8540e901489bdaa53079 /scripts | |
| parent | 0630ad00d96d9cf600c5c340cdecb363caa9d1cc (diff) | |
| download | linux-next-a2e98481a6396f919ad91ba9c2ff3ec61c4028b3.tar.gz linux-next-a2e98481a6396f919ad91ba9c2ff3ec61c4028b3.zip | |
bpf: Enable aggregate return types up to 16 bytes
Relax btf_distill_func_proto() to accept a by-value struct or union that
the R0:R2 convention added in earlier patches can carry:
- a struct or union larger than 8 and up to 16 bytes, returned in the
R0:R2 register pair, matching what LLVM emits for the BPF target;
- a struct or union up to 8 bytes, returned in R0 alone.
A >8 byte scalar (__int128) was already accepted and is unchanged.
Everything else stays rejected: a return type larger than 16 bytes, and any
type that __get_type_size() cannot return in registers at all (e.g. an
array), which it already reports as ret < 0.
btf_validate_return_type() is relaxed as well, so that it accepts a
by-value struct or union up to 16 bytes in addition to void and scalars.
With btf_distill_func_proto() and btf_validate_return_type() relaxed, the
verifier, JIT, precision-backtracking and live-register support from the
earlier patches becomes reachable: <=16 byte aggregate return values now
work end to end.
Signed-off-by: Yonghong Song <yonghong.song@linux.dev>
Acked-by: Eduard Zingerman <eddyz87@gmail.com>
Link: https://patch.msgid.link/20260819055314.3298664-1-yonghong.song@linux.dev
Signed-off-by: Eduard Zingerman <eddyz87@gmail.com>
Diffstat (limited to 'scripts')
0 files changed, 0 insertions, 0 deletions
