On Thu, Apr 24, 2025 at 6:38 AM Alexis Lothoré <alexis.loth...@bootlin.com> wrote: > > Hi Xu, > > On Thu Apr 24, 2025 at 2:00 PM CEST, Xu Kuohai wrote: > > On 4/24/2025 3:24 AM, Alexis Lothoré wrote: > >> Hi Andrii, > >> > >> On Wed Apr 23, 2025 at 7:15 PM CEST, Andrii Nakryiko wrote: > >>> On Thu, Apr 17, 2025 at 12:14 AM Alexis Lothoré > >>> <alexis.loth...@bootlin.com> wrote: > >>>> > >>>> Hi Andrii, > >>>> > >>>> On Wed Apr 16, 2025 at 11:24 PM CEST, Andrii Nakryiko wrote: > >>>>> On Fri, Apr 11, 2025 at 1:32 PM Alexis Lothoré (eBPF Foundation) > >>>>> <alexis.loth...@bootlin.com> wrote: > > [...] > > >> Thanks for the pointer, I'll take a look at it. The more we discuss this > >> series, the less member size sounds relevant for what I'm trying to achieve > >> here. > >> > >> Following Xu's comments, I have been thinking about how I could detect the > >> custom alignments and packing on structures, and I was wondering if I could > >> somehow benefit from __attribute__ encoding in BTF info ([1]). But > >> following your hint, I also see some btf_is_struct_packed() in > >> tools/lib/bpf/btf_dump.c that could help. I'll dig this further and see if > >> I can manage to make something work with all of this. > >> > > > > With DWARF info, we might not need to detect the structure alignment > > anymore, > > since the DW_AT_location attribute tells us where the structure parameter is > > located on the stack, and DW_AT_byte_size gives us the size of the > > structure. > > I am not sure to follow you here, because DWARF info is not accessible > from kernel at runtime, right ? Or are you meaning that we could, at build > time, enrich the BTF info embedded in the kernel thanks to DWARF info ?
Sounds like arm64 has complicated rules for stack alignment and stack offset computation for passing 9th+ argument. Since your analysis shows: "there are about 200 functions accept 9 to 12 arguments, so adding support for up to 12 function arguments." I say, let's keep the existing limitation: if (nregs > 8) return -ENOTSUPP; If there is a simple and dumb way to detect that arg9+ are scalars with simple stack passing rules, then, sure, let's support those too, but fancy packed/align(x)/etc let's ignore.