mbox series

[0/9] 2023 Q1 bsd-user upstreaming: bugfixes and sysctl

Message ID 20230210231829.39476-1-imp@bsdimp.com (mailing list archive)
Headers show
Series 2023 Q1 bsd-user upstreaming: bugfixes and sysctl | expand

Message

Warner Losh Feb. 10, 2023, 11:18 p.m. UTC
This group of patches gets the basic framework for sysctl upstreamed. There's a
lot more to translate far too many binary blobs the kernel publishes via
sysctls, but I'm leaving those out in the name of simplicity.

There's also a bug fix from Doug Rabson that fixes a long int confusion leading
to a trunctation of addresses (oops)

I've added a new command line arg -strict for debugging when you want to stop
dead in the tracks when there's something unimplemented (like system calls)
rather than trying one's best to cope. It will also let whoever is working on
upstreaming to get something working to run it this way and find the missing
bits more easily. sysctl happens to be the first unimplemented system call for a
dynamically linked hello world.

There's a fix for the -static option, since clang hates -no-pie and needs only
-fno-pie.

Finally, I'm changing how I'm upstreaming a little. I'm doing a little deeper
dives into our rather chaotic repo to find a couple of authors I might have
missed. From here on out, I'll be using the original author's name as the git
author. I'll also tag the co-authors better as well when there's multiple people
that did something (other than reformat and/or move code around). I've
discovered more code moved about than I'd previously known. This seems more in
line with standard practice. Also, I've reviewed all these changes, but I don't
know if I need to add Reviewed-by: or not, so I've done it for one or two and
will make it consistent before the pull request. git log suggests maintainers
are inconsistent about this (or I've not discovered the rules they follow).

check-patch gives some line lenght warnings, but should otherwise be OK. There's
several static functions that aren't used until the end of the patch
series... Not sure the best way to suppress the build warnings there (but since
they are just warnings...).

Doug Rabson (1):
  bsd-user: Don't truncate the return value from freebsd_syscall

Juergen Lock (2):
  bsd-user: sysctl helper funtions: sysctl_name2oid and sysctl_oidfmt
  bsd-user: common routine do_freebsd_sysctl_oid for all sysctl variants

Kyle Evans (2):
  bsd-user: do_freebsd_sysctl helper for sysctl(2)
  bsd-user: implement sysctlbyname(2)

Stacey Son (2):
  bsd-user: Add sysarch syscall
  bsd-user: Two helper routines oidfmt and sysctl_oldcvt

Warner Losh (2):
  build: Don't specify -no-pie for --static user-mode programs
  bsd-user: Add -strict

 bsd-user/freebsd/os-sys.c     | 432 ++++++++++++++++++++++++++++++++++
 bsd-user/freebsd/os-syscall.c |  21 +-
 bsd-user/main.c               |   5 +-
 bsd-user/qemu.h               |   6 +
 configure                     |   2 +-
 5 files changed, 463 insertions(+), 3 deletions(-)

Comments

Richard Henderson Feb. 11, 2023, 7:30 p.m. UTC | #1
On 2/10/23 13:18, Warner Losh wrote:
> There's
> several static functions that aren't used until the end of the patch
> series... Not sure the best way to suppress the build warnings there (but since
> they are just warnings...).

Are they just warnings?  --enable-werror is default...

Anyway, I've used

static type G_GNUC_UNUSED function(args...)

in the past to ensure bisection, removing the UNUSED marker when they become used.


r~
Warner Losh Feb. 11, 2023, 10:20 p.m. UTC | #2
On Sat, Feb 11, 2023 at 12:30 PM Richard Henderson <
richard.henderson@linaro.org> wrote:

> On 2/10/23 13:18, Warner Losh wrote:
> > There's
> > several static functions that aren't used until the end of the patch
> > series... Not sure the best way to suppress the build warnings there
> (but since
> > they are just warnings...).
>
> Are they just warnings?  --enable-werror is default...
>
> Anyway, I've used
>
> static type G_GNUC_UNUSED function(args...)
>
> in the past to ensure bisection, removing the UNUSED marker when they
> become used.
>

I like that suggestion, and it's easy to implement. Thanks for this and the
reviews so far. I've
updated things with your comments, but will give it another day or two
before I send v2 for
others to comment.

Warner