git: 2e5c2a2d29 - main - bsd-user status report

From: Warner Losh <>
Date: Sat, 15 Apr 2023 15:30:02 UTC
The branch main has been updated by imp:


commit 2e5c2a2d29f672f4553738f4686f3c41707e51ed
Author:     Warner Losh <>
AuthorDate: 2023-04-15 15:29:52 +0000
Commit:     Warner Losh <>
CommitDate: 2023-04-15 15:29:52 +0000

    bsd-user status report
    Reviewed by:            salvadore
    Differential Revision:
 .../en/status/report-2023-01-2023-03/bsd-user.adoc | 55 ++++++++++++++++++++++
 1 file changed, 55 insertions(+)

diff --git a/website/content/en/status/report-2023-01-2023-03/bsd-user.adoc b/website/content/en/status/report-2023-01-2023-03/bsd-user.adoc
new file mode 100644
index 0000000000..f9ce76c0e4
--- /dev/null
+++ b/website/content/en/status/report-2023-01-2023-03/bsd-user.adoc
@@ -0,0 +1,55 @@
+=== bsd-user: Upstreaming and Status Report
+Links: +
+link:[QEMU Project] URL: link:[] +
+link:[FreeBSD bsd-user qemu fork] URL: link:[] +
+link:[QEMU Project's gitlab mirror] URL: link:[]
+Contact: Warner Losh <>
+In this quarter, Warner upstreamed patche sets in the qemu-project repo (with a third pending).
+Doug Rabson submitted some optimizations to save a handle to the qemu-user emulator in the kernel for future exec.
+Contact has been made with some folks interested in getting bsd-user working on NetBSD.
+Summer of Code project to upstream shows some interest.
+==== Upstreaming Efforts
+The sysctl system call was upstreamed this quarter.
+Doug's changes were also upstreamed (see below).
+Some cleanups around NetBSD and OpenBSD and to generate syscalls on the fly are pending
+==== Doug Rabson's Changes
+As part of his container work, Doug submitted changes that allows the kernel to cache the emulator used to run programs.
+This allows it to directly exec the new binary with that cached emulator.
+This simplifies bsd-user and removes one source of difference between it and linux-user.
+Doug also provided an important fix that prevented aarch64 from running.
+==== Bug Fixes and Improvements
+In addition to Doug's fixes, Warner cleaned up things a bit this quarter.
+* Warner removed the final bits of 'run on any BSD code' that was present in the emulator.
+* While the basic system calls could be emulated between all the BSDs, their system call interface has diverged too much, and it is too feature rich for this to be feasible any time soon.
+* Warner had planned to just remove the NetBSD and OpenBSD bits, but there's some interest from at least the NetBSD folks for making things build.
+* Now that they have contact information, and know direction, Warner hopes they will submit a pull request to build bsd-user on NetBSD for NetBSD.
+* Warner added SIGSYS support so that we can catch unimplemented system calls sooner, and improved reporting of them to get more data about what fails.
+* Warner cleaned up some code in the `blitz` branch.
+* We're merged up to 8.0rc1 in upstream in the `blitz` branch we're using to stay current.
+==== Summer of Code Projects
+There's much interest in the bsd-user upstreaming task Warner added to Qemu's project list.
+With luck, we'll have a student to fund to do the job of upstreaming all the system calls needed to run simple programs.
+With a lot of luck, we'll be able to run any program that does the same thing(s) that clang does (one goal is to have it compile hello world).
+Future quarterly reports will provide details, should we be fortunate enough to get a slot for this.
+==== Help Needed
+We can always use help with bsd-user.
+* Pull requests for new system calls are welcome.
+* Automation in generating many of the things we do by hand would be helpful (like system call argument tracing)
+* Enthusiastic volunteers who want to help me with the upstreaming (many tasks are easy and quick if you don't want to commit).
+* Coordination with the NetBSD folks and cleanup they come up with.
+* Bug fixes (especially thread bugs) are needed.