Discussion:
[PATCH v3 0/6] mips: system call table generation support
(too old to reply)
Maciej W. Rozycki
2018-12-06 12:15:41 UTC
Permalink
Could you review this patch series. I would appreciate if you can
perform the boot test on the actual platform.
This is looking pretty good to me, so I look forward to v4 with Arnd's
comments addressed.
I've verified that the sys call tables are identical for both
32r2el_defconfig & 64r6el_defconfig before & after this series, and that
both still boot fine.
I believe this file is used by the glibc build process to retrieve
syscall numbers for glibc's own use as well for <sys/syscall.h>. Has the
change been verified not to break this process?

Cc-ing <libc-***@sourceware.org> for information and possible further
input.

Maciej
Joseph Myers
2018-12-06 16:19:19 UTC
Permalink
Post by Maciej W. Rozycki
I believe this file is used by the glibc build process to retrieve
syscall numbers for glibc's own use as well for <sys/syscall.h>. Has the
change been verified not to break this process?
input.
I'm not sure what "this file" is. The glibc build uses the installed
<asm/unistd.h> (the results of #including it, not any other kind of
processing the file).
--
Joseph S. Myers
***@codesourcery.com
Maciej W. Rozycki
2018-12-06 17:02:28 UTC
Permalink
Post by Joseph Myers
Post by Maciej W. Rozycki
I believe this file is used by the glibc build process to retrieve
syscall numbers for glibc's own use as well for <sys/syscall.h>. Has the
change been verified not to break this process?
input.
I'm not sure what "this file" is. The glibc build uses the installed
<asm/unistd.h> (the results of #including it, not any other kind of
processing the file).
So how are `SYS_<name>' macros generated that land in <bits/syscall.h>?

Maciej
Joseph Myers
2018-12-06 17:20:37 UTC
Permalink
Post by Maciej W. Rozycki
Post by Joseph Myers
Post by Maciej W. Rozycki
I believe this file is used by the glibc build process to retrieve
syscall numbers for glibc's own use as well for <sys/syscall.h>. Has the
change been verified not to break this process?
input.
I'm not sure what "this file" is. The glibc build uses the installed
<asm/unistd.h> (the results of #including it, not any other kind of
processing the file).
So how are `SYS_<name>' macros generated that land in <bits/syscall.h>?
By gen-syscall-h.awk, which generates #ifdef conditionals for each
possible __NR_* name (as listed in syscall-names.list in glibc).
--
Joseph S. Myers
***@codesourcery.com
Maciej W. Rozycki
2018-12-06 17:43:27 UTC
Permalink
Post by Joseph Myers
Post by Maciej W. Rozycki
So how are `SYS_<name>' macros generated that land in <bits/syscall.h>?
By gen-syscall-h.awk, which generates #ifdef conditionals for each
possible __NR_* name (as listed in syscall-names.list in glibc).
I seem to remember having to take extra care with how the three MIPS ABIs
wire the syscalls to get it right in glibc, but I take it then this has
been now addressed reliably enough for the glibc not to care how exactly
<asm/unistd.h> has been arranged.

Given my current level of involvement with the MIPS architecture I take
your word for it and will not investigate it any further. Thanks for your
input.

Maciej
Florian Weimer
2018-12-06 18:10:57 UTC
Permalink
Post by Maciej W. Rozycki
Post by Joseph Myers
Post by Maciej W. Rozycki
So how are `SYS_<name>' macros generated that land in <bits/syscall.h>?
By gen-syscall-h.awk, which generates #ifdef conditionals for each
possible __NR_* name (as listed in syscall-names.list in glibc).
I seem to remember having to take extra care with how the three MIPS ABIs
wire the syscalls to get it right in glibc, but I take it then this has
been now addressed reliably enough for the glibc not to care how exactly
<asm/unistd.h> has been arranged.
This is a fairly recent change (commit
2dba5ce7b8115d6a2789bf279892263621088e74, "<bits/syscall.h>: Use an
arch-independent system call list on Linux", first release with it is
glibc 2.27). This patch is quite backportable; we have put it into our
2.17-derived glibc, and the upstream work was originally driven by
downstream ordering requirements of kernel header and glibc builds.
Glad to see it's useful elsewhere.

The test retains the old <asm/unistd.h>-based macro extraction for
testing purposes, but it needs that only for the actual target
architecture and only the *names*, so it's easy to implement. Before
that, the generation would have to carefully take into account multiple
sub-targets (i386/x86-64/x32 is one of the more complicated scenarios).
Presumably, you saw problem with that part.

Even if you introduce breakage here, it will only affect older glibc
builds. It's not something that application developers would see.

Thanks,
Florian
Maciej W. Rozycki
2018-12-07 14:33:17 UTC
Permalink
Post by Florian Weimer
Post by Maciej W. Rozycki
I seem to remember having to take extra care with how the three MIPS ABIs
wire the syscalls to get it right in glibc, but I take it then this has
been now addressed reliably enough for the glibc not to care how exactly
<asm/unistd.h> has been arranged.
This is a fairly recent change (commit
2dba5ce7b8115d6a2789bf279892263621088e74, "<bits/syscall.h>: Use an
arch-independent system call list on Linux", first release with it is
glibc 2.27). This patch is quite backportable; we have put it into our
2.17-derived glibc, and the upstream work was originally driven by
downstream ordering requirements of kernel header and glibc builds.
Glad to see it's useful elsewhere.
Thanks for the pointer, and the work you have done to make this more
robust; it was that that I missed.
Post by Florian Weimer
The test retains the old <asm/unistd.h>-based macro extraction for
testing purposes, but it needs that only for the actual target
architecture and only the *names*, so it's easy to implement. Before
that, the generation would have to carefully take into account multiple
sub-targets (i386/x86-64/x32 is one of the more complicated scenarios).
Presumably, you saw problem with that part.
Yeah, the MIPS o32/n64/n32 ABI set is a corresponding situation, except
that somewhat longer-lived as we've had support for these three ABIs since
2001, including the ability to concurrently run user executables built for
any of these ABIs under a single 64-bit Linux kernel.

Maciej

Loading...