qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Warner Losh <imp@bsdimp.com>
To: qemu-devel@nongnu.org
Cc: jrtc27@jrtc27.com, riastradh@netbsd.org,
	Kyle Evans <kevans@freebsd.org>, Ryo ONODERA <ryoon@netbsd.org>,
	Brad Smith <brad@comstyle.com>, Warner Losh <imp@bsdimp.com>,
	reinoud@netbsd.org
Subject: [PATCH v2 00/19] bsd-user 2023 Q2 first batch
Date: Mon, 10 Apr 2023 12:20:37 -0600	[thread overview]
Message-ID: <20230410182056.320-1-imp@bsdimp.com> (raw)

This series is a number of misc cleanups.

First, this replaces my plans to remove netbsd and openbsd code entirely. I've
been in contact with the NetBSD folks that would like to make things work. The
plan is that I'll not remove it in qemu-project, and restore them in bsd-user
fork. These changes clean up some of the mess that's here: I've moved the bits
that make sense here, and removed the ones that don't (but upstream I've moved
them when it makes sense). My intention is to work with the NetBSD folks (and
OpenBSD too if they want) to cope with the structural issues I'm aware of in
bsd-user fork. Future contributions should go via that route at a rate of
contributions (I have little time to do the work, but will commit to finding
time to do the coordination and review work).

Next I've #ifdef'd some mmap handling based on certain flags being defined or
not. This was something I'd removed before, and were in what Taylor sent me, so
I've restored the relevant ones. The rest of the patch that Taylor sent me
conflicts with bsd-user and needs some work to get it in upstream. I removed a
few unused mmap defines as well. And I cleanup mmap.c to remove gratuitous
differences and pass checkpatch.pl.

Next, I've made unimplmeneted system calls generate SIGSYS. For the moment, this
is the best we should do since so much is unimplemented and as things get
implemented this will allow controlled testing of code to ensure it doesn't
silently succeed, giving the impression things are working when they aren't. I
also add SIGSYS to the uncaught coredump signal list, to match FreeBSD's
behavior. I only do this on arm, though, because the signal implementation on
x86 is incomplete (even upstream) and I didn't want to take chances.

Finally, I've included the core dump code. There's about 600 lines of sysctl
support that I've included as separate commits of ~150 lines each (and
incidentlaly, added the translation to os-sys.c for those bits). The core dump
code itself is largely copied from linux-user/elfload.c by sson (so he gets the
author credit). I moved it to elfcore.c when I was upstremaing in the past and
upstreamed a stub. One of the patches in this series replaces elfcore.c and is
1300 lines long. It's not easily sliced up into smaller bits that compile, but
I'm open to suggestions. It's known to "work" in the sense that it will generate
core files that gdb can read and intelligently parse.

This patch series is for after 8.0 is done, but before any GSoC projects start,
and will be independent of any GSoC contribution tasks.

v2: A few more 'high line count, easy to review' changes:
- Remove a few more files
- Regenerate FreeBSD system calls
- Remove host-os.h, since we no longer plan to support multiple BSDs in one
  binary.
- Review comments: Remove USE_ELF_CORE_DUMP and change ifdefs for MAP_

Need reviews for parts 2, 17, 18, 19 for sure. Parts 3 and 14 just have Acked-by.

Stacey Son (6):
  bsd-user: h2g_rusage
  bsd-user: Implement do_sysctl_kern_getprocs
  bsd-user: Implement do_sysctl_kern_proc_filedesc
  bsd-user: Implement do_sysctl_kern_proc_vmmap
  bsd-user: Implement sysctl kern.proc, except kern.proc.full_path
  bsd-user: Implement core dumps

Warner Losh (13):
  bsd-user: Make print_* public
  bsd-user: Ifdef a few MAP_ constants for NetBSD / OpenBSD.
  bsd-user: Cleanup style.
  bsd-user: Move system FreeBSD call table to freebsd/os-syscall.c
  bsd-user: Remove NetBSD specific syscall printing
  bsd-user: Remove OpenBSD specific syscall printing
  bsd-user: Move system call include to os-syscall.h
  bsd-user: Remove useless mmap definitions
  bsd-user: Add SIGSYS to core dump signals.
  bsd-user: Implement SIGSYS on arm
  bsd-user: Remove host-os.h
  bsd-user: Update system call list
  bsd-user: Eliminate USE_ELF_CORE_DUMP

 bsd-user/arm/target_arch_cpu.h             |    8 +
 bsd-user/arm/target_arch_elf.h             |    1 -
 bsd-user/bsd-proc.c                        |   48 +
 bsd-user/elfcore.c                         | 1315 +++++++++++++++++++-
 bsd-user/elfload.c                         |    5 -
 bsd-user/freebsd/os-sys.c                  |  508 +++++++-
 bsd-user/freebsd/os-syscall.c              |   19 +
 bsd-user/freebsd/os-syscall.h              |   23 +
 bsd-user/freebsd/syscall_nr.h              | 1035 +++++++--------
 bsd-user/i386/target_arch_elf.h            |    1 -
 bsd-user/main.c                            |    1 -
 bsd-user/meson.build                       |    1 +
 bsd-user/mmap.c                            |  105 +-
 bsd-user/netbsd/host-os.h                  |   25 -
 bsd-user/netbsd/os-syscall.h               |   16 +
 bsd-user/openbsd/host-os.h                 |   25 -
 bsd-user/openbsd/os-syscall.h              |   16 +
 bsd-user/{freebsd/host-os.h => qemu-bsd.h} |   15 +-
 bsd-user/qemu.h                            |   44 +-
 bsd-user/signal.c                          |   13 +-
 bsd-user/strace.c                          |   88 +-
 bsd-user/syscall_defs.h                    |   69 +-
 bsd-user/x86_64/target_arch_elf.h          |    1 -
 23 files changed, 2616 insertions(+), 766 deletions(-)
 create mode 100644 bsd-user/bsd-proc.c
 create mode 100644 bsd-user/freebsd/os-syscall.h
 delete mode 100644 bsd-user/netbsd/host-os.h
 create mode 100644 bsd-user/netbsd/os-syscall.h
 delete mode 100644 bsd-user/openbsd/host-os.h
 create mode 100644 bsd-user/openbsd/os-syscall.h
 rename bsd-user/{freebsd/host-os.h => qemu-bsd.h} (72%)

-- 
2.40.0



             reply	other threads:[~2023-04-10 18:21 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-10 18:20 Warner Losh [this message]
2023-04-10 18:20 ` [PATCH v2 01/19] bsd-user: Make print_* public Warner Losh
2023-04-10 18:20 ` [PATCH v2 02/19] bsd-user: Ifdef a few MAP_ constants for NetBSD / OpenBSD Warner Losh
2023-04-11  1:31   ` Richard Henderson
2023-04-10 18:20 ` [PATCH v2 03/19] bsd-user: Cleanup style Warner Losh
2023-04-10 18:20 ` [PATCH v2 04/19] bsd-user: Move system FreeBSD call table to freebsd/os-syscall.c Warner Losh
2023-04-10 18:20 ` [PATCH v2 05/19] bsd-user: Remove NetBSD specific syscall printing Warner Losh
2023-04-10 18:20 ` [PATCH v2 06/19] bsd-user: Remove OpenBSD " Warner Losh
2023-04-10 18:20 ` [PATCH v2 07/19] bsd-user: Move system call include to os-syscall.h Warner Losh
2023-04-10 18:20 ` [PATCH v2 08/19] bsd-user: Remove useless mmap definitions Warner Losh
2023-04-10 18:20 ` [PATCH v2 09/19] bsd-user: h2g_rusage Warner Losh
2023-04-10 18:20 ` [PATCH v2 10/19] bsd-user: Implement do_sysctl_kern_getprocs Warner Losh
2023-04-10 18:20 ` [PATCH v2 11/19] bsd-user: Implement do_sysctl_kern_proc_filedesc Warner Losh
2023-04-10 18:20 ` [PATCH v2 12/19] bsd-user: Implement do_sysctl_kern_proc_vmmap Warner Losh
2023-04-10 18:20 ` [PATCH v2 13/19] bsd-user: Implement sysctl kern.proc, except kern.proc.full_path Warner Losh
2023-04-10 18:20 ` [PATCH v2 14/19] bsd-user: Implement core dumps Warner Losh
2023-04-10 18:20 ` [PATCH v2 15/19] bsd-user: Add SIGSYS to core dump signals Warner Losh
2023-04-10 18:20 ` [PATCH v2 16/19] bsd-user: Implement SIGSYS on arm Warner Losh
2023-04-10 18:20 ` [PATCH v2 17/19] bsd-user: Remove host-os.h Warner Losh
2023-04-11  1:32   ` Richard Henderson
2023-04-10 18:20 ` [PATCH v2 18/19] bsd-user: Update system call list Warner Losh
2023-04-11  1:37   ` Richard Henderson
2023-04-11  2:37     ` Warner Losh
2023-04-11 17:03     ` Warner Losh
2023-04-10 18:20 ` [PATCH v2 19/19] bsd-user: Eliminate USE_ELF_CORE_DUMP Warner Losh
2023-04-11  1:37   ` Richard Henderson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230410182056.320-1-imp@bsdimp.com \
    --to=imp@bsdimp.com \
    --cc=brad@comstyle.com \
    --cc=jrtc27@jrtc27.com \
    --cc=kevans@freebsd.org \
    --cc=qemu-devel@nongnu.org \
    --cc=reinoud@netbsd.org \
    --cc=riastradh@netbsd.org \
    --cc=ryoon@netbsd.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).