* [PATCH 00/14] bsd-user: Upstream a few fixes
@ 2026-09-20 5:20 Warner Losh
2026-09-20 5:20 ` [PATCH 01/14] bsd-user: HOST_BIG_ENDIAN and TARGET_BIG_ENDIAN are always Warner Losh
` (13 more replies)
0 siblings, 14 replies; 32+ messages in thread
From: Warner Losh @ 2026-09-20 5:20 UTC (permalink / raw)
To: qemu-devel; +Cc: Kyle Evans, Warner Losh, Rick Richard, Maksym Sobolyev
Signed-off-by: Warner Losh <imp@bsdimp.com>
---
Maksym Sobolyev (1):
bsd-user: Fix non-PIE binaries
Rick Richard (1):
bsd-user: HOST_BIG_ENDIAN and TARGET_BIG_ENDIAN are always
Warner Losh (12):
bsd-user: Drop support for FreeBSD 12
bsd-user: Flag shared memory as needing atomics
bsd-user: Add gdb for system calls
bsd-user: Initialize per-arch child registers
bsd-user: Fix crazy bug with mmap
bsd-user: Move tb_flush stuff to begin_parallel_context
bsd-user: Fix MAP_TYPE definition.
bsd-user: Implement exterrctl(2)
bsd-user: Implement sigfastblock
bsd-user: Eliminate unused regs arg in load_elf_binary
bsd-user: #ifdef sockopt that aren't in 14
bsd-user: Remove host-os.h
bsd-user/bsd-file.h | 2 +-
bsd-user/bsd-mem.h | 8 ++++++++
bsd-user/bsdload.c | 2 +-
bsd-user/elfload.c | 11 ++++++-----
bsd-user/freebsd/host-os.h | 25 -------------------------
bsd-user/freebsd/os-misc.h | 18 +++++++++++++++++-
bsd-user/freebsd/os-sockopt.h | 2 ++
bsd-user/freebsd/os-syscall.c | 19 ++++++++++++++++++-
bsd-user/freebsd/os-thread.c | 9 ++++-----
bsd-user/freebsd/os-thread.h | 13 ++++++++++++-
bsd-user/freebsd/target_os_user.h | 5 -----
bsd-user/main.c | 2 --
bsd-user/mmap.c | 25 +++++++++++++++++++------
bsd-user/qemu.h | 21 +++++++++++++++++++--
bsd-user/syscall_defs.h | 9 ++++++++-
15 files changed, 115 insertions(+), 56 deletions(-)
---
base-commit: f8aef8a9aed7438083c400da10acabdec485dc9b
change-id: 20260919-misc-2025q4-6875b032dac7
Best regards,
--
Warner Losh <imp@bsdimp.com>
^ permalink raw reply [flat|nested] 32+ messages in thread
* [PATCH 01/14] bsd-user: HOST_BIG_ENDIAN and TARGET_BIG_ENDIAN are always
2026-09-20 5:20 [PATCH 00/14] bsd-user: Upstream a few fixes Warner Losh
@ 2026-09-20 5:20 ` Warner Losh
2026-09-20 21:57 ` Richard Henderson
2026-09-20 5:20 ` [PATCH 02/14] bsd-user: Drop support for FreeBSD 12 Warner Losh
` (12 subsequent siblings)
13 siblings, 1 reply; 32+ messages in thread
From: Warner Losh @ 2026-09-20 5:20 UTC (permalink / raw)
To: qemu-devel; +Cc: Kyle Evans, Warner Losh, Rick Richard
From: Rick Richard <rick@sloservers.com>
TARGET_BIG_ENDIAN and HOST_BIG_ENDIAN are always defined.
lseek and target_offset64() transpose upper and lower halves
on 32-bit ABIs, -strace prints wrong off_t.
Signed-off-by: Rick Richard <rick@sloservers.com>
[ fixed defined() too ]
Reviewed-by: Warner Losh <imp@bsdimp.com>
Signed-off-by: Warner Losh <imp@bsdimp.com>
---
bsd-user/bsd-file.h | 2 +-
bsd-user/freebsd/os-misc.h | 2 +-
bsd-user/freebsd/os-thread.h | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/bsd-user/bsd-file.h b/bsd-user/bsd-file.h
index 0fefc07232..a2c2e38e50 100644
--- a/bsd-user/bsd-file.h
+++ b/bsd-user/bsd-file.h
@@ -986,7 +986,7 @@ static abi_long do_bsd_lseek(CPUArchState *env, abi_long arg1, abi_long arg2,
ret = get_errno(res);
set_second_rval(env, 0xFFFFFFFF);
} else {
-#ifdef TARGET_BIG_ENDIAN
+#if TARGET_BIG_ENDIAN
ret = ((res >> 32) & 0xFFFFFFFF);
set_second_rval(env, res & 0xFFFFFFFF);
#else
diff --git a/bsd-user/freebsd/os-misc.h b/bsd-user/freebsd/os-misc.h
index 0f87b21cc8..e9f9eed4b4 100644
--- a/bsd-user/freebsd/os-misc.h
+++ b/bsd-user/freebsd/os-misc.h
@@ -336,7 +336,7 @@ static inline abi_long do_freebsd_kldsym(abi_long fileid, abi_long cmd,
#if TARGET_ABI_BITS == 32
static inline uint64_t target_offset64(uint32_t word0, uint32_t word1)
{
-#ifdef TARGET_BIG_ENDIAN
+#if TARGET_BIG_ENDIAN
return ((uint64_t)word0 << 32) | word1;
#else
return ((uint64_t)word1 << 32) | word0;
diff --git a/bsd-user/freebsd/os-thread.h b/bsd-user/freebsd/os-thread.h
index 4258b24095..6552c60337 100644
--- a/bsd-user/freebsd/os-thread.h
+++ b/bsd-user/freebsd/os-thread.h
@@ -18,7 +18,7 @@
int safe_thr_suspend(struct timespec *timeout);
int safe__umtx_op(void *, int, unsigned long, void *, void *);
-#if defined(HOST_BIG_ENDIAN) == defined(TARGET_BIG_ENDIAN) && \
+#if HOST_BIG_ENDIAN == TARGET_BIG_ENDIAN && \
(TARGET_ABI_BITS == HOST_LONG_BITS || defined(UMTX_OP__32BIT))
#define _UMTX_OPTIMIZED
#if defined(TARGET_ABI32)
--
2.55.0
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [PATCH 02/14] bsd-user: Drop support for FreeBSD 12
2026-09-20 5:20 [PATCH 00/14] bsd-user: Upstream a few fixes Warner Losh
2026-09-20 5:20 ` [PATCH 01/14] bsd-user: HOST_BIG_ENDIAN and TARGET_BIG_ENDIAN are always Warner Losh
@ 2026-09-20 5:20 ` Warner Losh
2026-09-21 18:35 ` Pierrick Bouvier
2026-09-20 5:20 ` [PATCH 03/14] bsd-user: Flag shared memory as needing atomics Warner Losh
` (11 subsequent siblings)
13 siblings, 1 reply; 32+ messages in thread
From: Warner Losh @ 2026-09-20 5:20 UTC (permalink / raw)
To: qemu-devel; +Cc: Kyle Evans, Warner Losh
All supported branches have these, so we don't need ifdefs anymore.
Signed-off-by: Warner Losh <imp@bsdimp.com>
---
bsd-user/freebsd/target_os_user.h | 5 -----
1 file changed, 5 deletions(-)
diff --git a/bsd-user/freebsd/target_os_user.h b/bsd-user/freebsd/target_os_user.h
index 9703b9a61a..688da6c81a 100644
--- a/bsd-user/freebsd/target_os_user.h
+++ b/bsd-user/freebsd/target_os_user.h
@@ -297,17 +297,12 @@ struct target_kinfo_vmentry {
uint32_t kve_vn_rdev_freebsd11; /* Device id if device. */
uint16_t kve_vn_mode; /* File mode. */
uint16_t kve_status; /* Status flags. */
-#if (__FreeBSD_version >= 1300501 && __FreeBSD_version < 1400000) || \
- __FreeBSD_version >= 1400009
union {
uint64_t _kve_vn_fsid; /* dev_t of vnode location */
uint64_t _kve_obj; /* handle of anon obj */
} kve_type_spec;
#define kve_vn_fsid kve_type_spec._kve_vn_fsid
#define kve_obj kve_type_spec._kve_obj
-#else
- uint64_t kve_vn_fsid; /* dev_t of vnode location */
-#endif
uint64_t kve_vn_rdev; /* Device id if device. */
int _kve_ispare[8]; /* Space for more stuff. */
/* Truncated before copyout in sysctl */
--
2.55.0
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [PATCH 03/14] bsd-user: Flag shared memory as needing atomics
2026-09-20 5:20 [PATCH 00/14] bsd-user: Upstream a few fixes Warner Losh
2026-09-20 5:20 ` [PATCH 01/14] bsd-user: HOST_BIG_ENDIAN and TARGET_BIG_ENDIAN are always Warner Losh
2026-09-20 5:20 ` [PATCH 02/14] bsd-user: Drop support for FreeBSD 12 Warner Losh
@ 2026-09-20 5:20 ` Warner Losh
2026-09-20 21:59 ` Richard Henderson
2026-09-20 5:20 ` [PATCH 04/14] bsd-user: Add gdb for system calls Warner Losh
` (10 subsequent siblings)
13 siblings, 1 reply; 32+ messages in thread
From: Warner Losh @ 2026-09-20 5:20 UTC (permalink / raw)
To: qemu-devel; +Cc: Kyle Evans, Warner Losh
Catch up with linux-user 228168cbb7c:
Signal the translator to use host atomic instructions for
guest operations, insofar as it is possible. This is the
best we can do to allow the guest to interact atomically
with other processes.
as well as subsequent tweaks and adjustmentst for bsd-user's code
structure (we don't have one exit path linux-user does and could frankly
stand to resturcture a bit to match the evolved code in linux-user). On
non-private mmap(2) sharing and all successful shmat(2) calls we tell
tcg that we're in a parallel context, which changes how it does atomics.
Signed-off-by: Warner Losh <imp@bsdimp.com>
---
bsd-user/bsd-mem.h | 8 ++++++++
bsd-user/mmap.c | 9 +++++++++
2 files changed, 17 insertions(+)
diff --git a/bsd-user/bsd-mem.h b/bsd-user/bsd-mem.h
index 3086143d40..65270e2cdf 100644
--- a/bsd-user/bsd-mem.h
+++ b/bsd-user/bsd-mem.h
@@ -389,6 +389,14 @@ static inline abi_long do_bsd_shmat(int shmid, abi_ulong shmaddr, int shmflg)
}
}
+ /*
+ * We're mapping shared memory, so ensure we generate code for parallel
+ * execution and flush old translations. This will work up to the level
+ * supported by the host -- anything that requires EXCP_ATOMIC will not
+ * be atomic with respect to an external process.
+ */
+ begin_parallel_context(thread_cpu);
+
return raddr;
}
diff --git a/bsd-user/mmap.c b/bsd-user/mmap.c
index fe77eceb48..548b4824df 100644
--- a/bsd-user/mmap.c
+++ b/bsd-user/mmap.c
@@ -662,6 +662,15 @@ abi_long target_mmap(abi_ulong start, abi_ulong len, int prot,
printf("\n");
#endif
mmap_unlock();
+ /*
+ * If we're mapping shared memory, ensure we generate code for parallel
+ * execution and flush old translations. This will work up to the level
+ * supported by the host -- anything that requires EXCP_ATOMIC will not
+ * be atomic with respect to an external process.
+ */
+ if ((flags & MAP_TYPE) != MAP_PRIVATE) {
+ begin_parallel_context(thread_cpu);
+ }
return start;
fail:
mmap_unlock();
--
2.55.0
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [PATCH 04/14] bsd-user: Add gdb for system calls
2026-09-20 5:20 [PATCH 00/14] bsd-user: Upstream a few fixes Warner Losh
` (2 preceding siblings ...)
2026-09-20 5:20 ` [PATCH 03/14] bsd-user: Flag shared memory as needing atomics Warner Losh
@ 2026-09-20 5:20 ` Warner Losh
2026-09-20 22:02 ` Richard Henderson
2026-09-20 5:20 ` [PATCH 05/14] bsd-user: Initialize per-arch child registers Warner Losh
` (9 subsequent siblings)
13 siblings, 1 reply; 32+ messages in thread
From: Warner Losh @ 2026-09-20 5:20 UTC (permalink / raw)
To: qemu-devel; +Cc: Kyle Evans, Warner Losh
Mirror what linux-user does around system calls.
Signed-off-by: Warner Losh <imp@bsdimp.com>
---
bsd-user/freebsd/os-syscall.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/bsd-user/freebsd/os-syscall.c b/bsd-user/freebsd/os-syscall.c
index 7e400c89bc..38dc87f745 100644
--- a/bsd-user/freebsd/os-syscall.c
+++ b/bsd-user/freebsd/os-syscall.c
@@ -29,7 +29,7 @@
#include <utime.h>
#include <poll.h>
-#include "include/gdbstub/syscalls.h"
+#include "gdbstub/user.h"
#include "qemu.h"
#include "signal-common.h"
@@ -1622,14 +1622,20 @@ abi_long do_freebsd_syscall(CPUArchState *env, int num, abi_long arg1,
abi_long arg5, abi_long arg6, abi_long arg7,
abi_long arg8)
{
+ CPUState *cpu = env_cpu(env);
abi_long ret;
if (do_strace) {
print_freebsd_syscall(num, arg1, arg2, arg3, arg4, arg5, arg6);
}
+ gdb_syscall_entry(cpu, num);
+
ret = freebsd_syscall(env, num, arg1, arg2, arg3, arg4, arg5, arg6,
arg7, arg8);
+
+ gdb_syscall_return(cpu, num);
+
if (do_strace) {
print_freebsd_syscall_ret(num, ret);
}
--
2.55.0
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [PATCH 05/14] bsd-user: Initialize per-arch child registers
2026-09-20 5:20 [PATCH 00/14] bsd-user: Upstream a few fixes Warner Losh
` (3 preceding siblings ...)
2026-09-20 5:20 ` [PATCH 04/14] bsd-user: Add gdb for system calls Warner Losh
@ 2026-09-20 5:20 ` Warner Losh
2026-09-20 22:07 ` Richard Henderson
2026-09-20 5:20 ` [PATCH 06/14] bsd-user: Fix crazy bug with mmap Warner Losh
` (8 subsequent siblings)
13 siblings, 1 reply; 32+ messages in thread
From: Warner Losh @ 2026-09-20 5:20 UTC (permalink / raw)
To: qemu-devel; +Cc: Kyle Evans, Warner Losh
Signed-off-by: Warner Losh <imp@bsdimp.com>
---
bsd-user/freebsd/os-thread.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/bsd-user/freebsd/os-thread.c b/bsd-user/freebsd/os-thread.c
index 15872f03fd..eaab062d3d 100644
--- a/bsd-user/freebsd/os-thread.c
+++ b/bsd-user/freebsd/os-thread.c
@@ -1629,6 +1629,9 @@ abi_long do_freebsd_thr_new(CPUArchState *env,
new_env = cpu_copy(env);
+ /* Init regs that differ from the parent. */
+ target_cpu_clone_regs(new_env, 0);
+
new_cpu = env_cpu(new_env);
new_cpu->opaque = ts;
ts->bprm = parent_ts->bprm;
--
2.55.0
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [PATCH 06/14] bsd-user: Fix crazy bug with mmap
2026-09-20 5:20 [PATCH 00/14] bsd-user: Upstream a few fixes Warner Losh
` (4 preceding siblings ...)
2026-09-20 5:20 ` [PATCH 05/14] bsd-user: Initialize per-arch child registers Warner Losh
@ 2026-09-20 5:20 ` Warner Losh
2026-09-20 22:09 ` Richard Henderson
2026-09-20 5:20 ` [PATCH 07/14] bsd-user: Move tb_flush stuff to begin_parallel_context Warner Losh
` (7 subsequent siblings)
13 siblings, 1 reply; 32+ messages in thread
From: Warner Losh @ 2026-09-20 5:20 UTC (permalink / raw)
To: qemu-devel; +Cc: Kyle Evans, Warner Losh
So, for some crazy reason, we checked that only the SHARED bit was set
out of all these bits. The only ones that were live was MAP_ANON and
MAP_FIXED. We never called mmap with MAP_FIXED and MAP_SHARED. And the
equivalent from linux-user tested that MAP_ANON was off, but MAP_SHARED
was on. So incorporate the more direct approach from linux-user for
testing this condition. Many of these bits haven't been actually used in
FreeBSD since the very early days....
Signed-off-by: Warner Losh <imp@bsdimp.com>
---
bsd-user/mmap.c | 16 ++++++++++------
bsd-user/syscall_defs.h | 2 +-
2 files changed, 11 insertions(+), 7 deletions(-)
diff --git a/bsd-user/mmap.c b/bsd-user/mmap.c
index 548b4824df..76ac0340cb 100644
--- a/bsd-user/mmap.c
+++ b/bsd-user/mmap.c
@@ -215,10 +215,13 @@ static int mmap_frag(abi_ulong real_start,
prot_new = prot | prot1;
if (fd != -1) {
- /* msync() won't work here, so we return an error if write is
- possible while it is a shared mapping */
- if ((flags & TARGET_BSD_MAP_FLAGMASK) == MAP_SHARED &&
- (prot & PROT_WRITE))
+ /*
+ * msync() won't work here, so we return an error if write is
+ * possible while it is a shared mapping
+ */
+ if (!(flags & MAP_ANON)
+ && (flags & MAP_TYPE) == MAP_SHARED
+ && (prot & PROT_WRITE))
return -1;
/* adjust protection to be able to read */
@@ -586,8 +589,9 @@ abi_long target_mmap(abi_ulong start, abi_ulong len, int prot,
* msync() won't work here, so we return an error if write is
* possible while it is a shared mapping
*/
- if ((flags & TARGET_BSD_MAP_FLAGMASK) == MAP_SHARED &&
- (prot & PROT_WRITE)) {
+ if (!(flags & MAP_ANON)
+ && (flags & MAP_TYPE) == MAP_SHARED
+ && (prot & PROT_WRITE)) {
errno = EINVAL;
goto fail;
}
diff --git a/bsd-user/syscall_defs.h b/bsd-user/syscall_defs.h
index 9fa16e0863..506aea3e27 100644
--- a/bsd-user/syscall_defs.h
+++ b/bsd-user/syscall_defs.h
@@ -121,7 +121,7 @@ struct target_msgbuf {
/*
* sys/mman.h
*/
-#define TARGET_BSD_MAP_FLAGMASK 0x3ff7
+#define MAP_TYPE 0xf
/*
* sys/time.h
--
2.55.0
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [PATCH 07/14] bsd-user: Move tb_flush stuff to begin_parallel_context
2026-09-20 5:20 [PATCH 00/14] bsd-user: Upstream a few fixes Warner Losh
` (5 preceding siblings ...)
2026-09-20 5:20 ` [PATCH 06/14] bsd-user: Fix crazy bug with mmap Warner Losh
@ 2026-09-20 5:20 ` Warner Losh
2026-09-20 22:11 ` Richard Henderson
2026-09-20 5:20 ` [PATCH 08/14] bsd-user: Fix MAP_TYPE definition Warner Losh
` (6 subsequent siblings)
13 siblings, 1 reply; 32+ messages in thread
From: Warner Losh @ 2026-09-20 5:20 UTC (permalink / raw)
To: qemu-devel; +Cc: Kyle Evans, Warner Losh
Catch up with linux-user 430014bee7a6c26a70e9f3854428843d5918cdf5 and
impelment begin_parallel_context. We'd already moved to using
tb_flush__exclusive_or_serial, but need this in several places, like
linux-user has.
Signed-off-by: Warner Losh <imp@bsdimp.com>
---
bsd-user/freebsd/os-thread.c | 6 +-----
bsd-user/qemu.h | 18 ++++++++++++++++++
2 files changed, 19 insertions(+), 5 deletions(-)
diff --git a/bsd-user/freebsd/os-thread.c b/bsd-user/freebsd/os-thread.c
index eaab062d3d..4ffa76a798 100644
--- a/bsd-user/freebsd/os-thread.c
+++ b/bsd-user/freebsd/os-thread.c
@@ -16,7 +16,6 @@
#include "target_arch_thread.h"
#include "qemu/guest-random.h"
#include "tcg/startup.h"
-#include "exec/tb-flush.h"
#include "os-thread.h"
@@ -1622,10 +1621,7 @@ abi_long do_freebsd_thr_new(CPUArchState *env,
* generate code for parallel execution and flush old translations.
* Do this now so that the copy gets CF_PARALLEL too.
*/
- if (!(cpu->tcg_cflags & CF_PARALLEL)) {
- cpu->tcg_cflags |= CF_PARALLEL;
- tb_flush__exclusive_or_serial();
- }
+ begin_parallel_context(cpu);
new_env = cpu_copy(env);
diff --git a/bsd-user/qemu.h b/bsd-user/qemu.h
index d2dd8c2ee8..851b0c2c5f 100644
--- a/bsd-user/qemu.h
+++ b/bsd-user/qemu.h
@@ -41,6 +41,7 @@ extern char **environ;
#include "target.h"
#include "exec/gdbstub.h"
#include "exec/page-protection.h"
+#include "exec/tb-flush.h"
#include "accel/tcg/vcpu-state.h"
#include "qemu-os.h"
@@ -529,4 +530,21 @@ static inline uint64_t target_arg64(uint32_t word0, uint32_t word1)
#include "user/safe-syscall.h"
+/* In user-internal.h in linux-user XXX consider similar cleanup */
+
+/**
+ * begin_parallel_context
+ * @cs: the CPU context
+ *
+ * Called when starting the second vcpu, or joining shared memory.
+ */
+static inline void begin_parallel_context(CPUState *cs)
+{
+ if (!tcg_cflags_has(cs, CF_PARALLEL)) {
+ tb_flush__exclusive_or_serial();
+ tcg_cflags_set(cs, CF_PARALLEL);
+ }
+}
+
+
#endif /* QEMU_H */
--
2.55.0
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [PATCH 08/14] bsd-user: Fix MAP_TYPE definition.
2026-09-20 5:20 [PATCH 00/14] bsd-user: Upstream a few fixes Warner Losh
` (6 preceding siblings ...)
2026-09-20 5:20 ` [PATCH 07/14] bsd-user: Move tb_flush stuff to begin_parallel_context Warner Losh
@ 2026-09-20 5:20 ` Warner Losh
2026-09-20 22:12 ` Richard Henderson
2026-09-20 5:20 ` [PATCH 09/14] bsd-user: Implement exterrctl(2) Warner Losh
` (5 subsequent siblings)
13 siblings, 1 reply; 32+ messages in thread
From: Warner Losh @ 2026-09-20 5:20 UTC (permalink / raw)
To: qemu-devel; +Cc: Kyle Evans, Warner Losh
The 0xf I think was copied from the Linux headers a long time ago, since
BSD doesn't define this. In FreeBSD, there's only two bits of this low
nibble that are used for the sharing type (linux has 2 more types
encoded in these low bits). The kernel rejects bogus flags (0xc part of
0xf mask), so it's better to have just these two bits here.
Signed-off-by: Warner Losh <imp@bsdimp.com>
---
bsd-user/syscall_defs.h | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/bsd-user/syscall_defs.h b/bsd-user/syscall_defs.h
index 506aea3e27..c4fd5f5589 100644
--- a/bsd-user/syscall_defs.h
+++ b/bsd-user/syscall_defs.h
@@ -121,7 +121,14 @@ struct target_msgbuf {
/*
* sys/mman.h
*/
-#define MAP_TYPE 0xf
+/*
+ * FreeBSD doesn't define this, but Linux does. In Linux, it's only MAP_PRIVATE
+ * and MAP_SHARED and a few Linux-specific types (0xf). FreeBSD allows other
+ * types of mapping with MAP_ANON, MAP_GUARD, and MAP_STACK. The mask on Linux
+ * excludes these: They don't have MAP_GUARD, and MAP_STACK and MAP_ANON have
+ * similar flags with different names that aren't in it's 0xf MAP_TYPE.
+ */
+#define MAP_TYPE (MAP_PRIVATE | MAP_SHARED)
/*
* sys/time.h
--
2.55.0
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [PATCH 09/14] bsd-user: Implement exterrctl(2)
2026-09-20 5:20 [PATCH 00/14] bsd-user: Upstream a few fixes Warner Losh
` (7 preceding siblings ...)
2026-09-20 5:20 ` [PATCH 08/14] bsd-user: Fix MAP_TYPE definition Warner Losh
@ 2026-09-20 5:20 ` Warner Losh
2026-09-21 18:34 ` Pierrick Bouvier
2026-09-20 5:20 ` [PATCH 10/14] bsd-user: Implement sigfastblock Warner Losh
` (4 subsequent siblings)
13 siblings, 1 reply; 32+ messages in thread
From: Warner Losh @ 2026-09-20 5:20 UTC (permalink / raw)
To: qemu-devel; +Cc: Kyle Evans, Warner Losh
Signed-off-by: Warner Losh <imp@bsdimp.com>
---
bsd-user/freebsd/os-misc.h | 16 ++++++++++++++++
bsd-user/freebsd/os-syscall.c | 6 ++++++
2 files changed, 22 insertions(+)
diff --git a/bsd-user/freebsd/os-misc.h b/bsd-user/freebsd/os-misc.h
index e9f9eed4b4..7e8c29fe84 100644
--- a/bsd-user/freebsd/os-misc.h
+++ b/bsd-user/freebsd/os-misc.h
@@ -9,6 +9,9 @@
#define OS_MISC_H
#include <sys/cpuset.h>
+#ifdef TARGET_FREEBSD_NR_exterrctl
+#include <sys/exterrvar.h>
+#endif
#include <sys/random.h>
#include <sched.h>
#include <kenv.h>
@@ -541,4 +544,17 @@ static inline abi_long do_freebsd_kenv(abi_long action, abi_ulong name,
return ret;
}
+#ifdef TARGET_FREEBSD_NR_exterrctl
+static inline abi_long do_freebsd_exterrctl(abi_long op, abi_long flags, abi_long ptr)
+{
+ void *hostptr = 0;
+
+ if (op == EXTERRCTL_ENABLE) {
+ hostptr = g2h_untagged(ptr);
+ }
+
+ return get_errno(exterrctl(op, flags, hostptr));
+}
+#endif
+
#endif /* OS_MISC_H */
diff --git a/bsd-user/freebsd/os-syscall.c b/bsd-user/freebsd/os-syscall.c
index 38dc87f745..eb510bcab9 100644
--- a/bsd-user/freebsd/os-syscall.c
+++ b/bsd-user/freebsd/os-syscall.c
@@ -1592,6 +1592,12 @@ static abi_long freebsd_syscall(CPUArchState *env, int num, abi_long arg1,
ret = do_freebsd_kenv(arg1, arg2, arg3, arg4);
break;
+#ifdef TARGET_FREEBSD_NR_exterrctl
+ case TARGET_FREEBSD_NR_exterrctl:
+ ret = do_freebsd_exterrctl(arg1, arg2, arg3);
+ break;
+#endif
+
/* XXX */
case TARGET_FREEBSD_NR_cap_rights_limit:
case TARGET_FREEBSD_NR_cap_ioctls_limit:
--
2.55.0
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [PATCH 10/14] bsd-user: Implement sigfastblock
2026-09-20 5:20 [PATCH 00/14] bsd-user: Upstream a few fixes Warner Losh
` (8 preceding siblings ...)
2026-09-20 5:20 ` [PATCH 09/14] bsd-user: Implement exterrctl(2) Warner Losh
@ 2026-09-20 5:20 ` Warner Losh
2026-09-21 18:34 ` Pierrick Bouvier
2026-09-20 5:20 ` [PATCH 11/14] bsd-user: Eliminate unused regs arg in load_elf_binary Warner Losh
` (3 subsequent siblings)
13 siblings, 1 reply; 32+ messages in thread
From: Warner Losh @ 2026-09-20 5:20 UTC (permalink / raw)
To: qemu-devel; +Cc: Kyle Evans, Warner Losh
Signed-off-by: Warner Losh <imp@bsdimp.com>
---
bsd-user/freebsd/os-syscall.c | 5 +++++
bsd-user/freebsd/os-thread.h | 11 +++++++++++
2 files changed, 16 insertions(+)
diff --git a/bsd-user/freebsd/os-syscall.c b/bsd-user/freebsd/os-syscall.c
index eb510bcab9..f82fa381ce 100644
--- a/bsd-user/freebsd/os-syscall.c
+++ b/bsd-user/freebsd/os-syscall.c
@@ -97,6 +97,7 @@ safe_syscall3(ssize_t, sendmsg, int, s, const struct msghdr *, msg, int, flags);
safe_syscall1(int, thr_suspend, struct timespec *, timeout);
safe_syscall5(int, _umtx_op, void *, obj, int, op, unsigned long, val, void *,
uaddr, void *, uaddr2);
+safe_syscall2(int, sigfastblock, int, cmd, void *, ptr);
/* used in os-time */
safe_syscall2(int, nanosleep, const struct timespec *, rqtp, struct timespec *,
@@ -1175,6 +1176,10 @@ static abi_long freebsd_syscall(CPUArchState *env, int num, abi_long arg1,
ret = do_freebsd__umtx_op(arg1, arg2, arg3, arg4, arg5);
break;
+ case TARGET_FREEBSD_NR_sigfastblock: /* internal */
+ ret = do_freebsd_sigfastblock(arg1, arg2);
+ break;
+
/*
* ioctl(2)
*/
diff --git a/bsd-user/freebsd/os-thread.h b/bsd-user/freebsd/os-thread.h
index 6552c60337..dfb22e7cc2 100644
--- a/bsd-user/freebsd/os-thread.h
+++ b/bsd-user/freebsd/os-thread.h
@@ -17,6 +17,7 @@
int safe_thr_suspend(struct timespec *timeout);
int safe__umtx_op(void *, int, unsigned long, void *, void *);
+int safe_sigfastblock(int, void *);
#if HOST_BIG_ENDIAN == TARGET_BIG_ENDIAN && \
(TARGET_ABI_BITS == HOST_LONG_BITS || defined(UMTX_OP__32BIT))
@@ -593,4 +594,14 @@ static inline abi_long do_freebsd__umtx_op(abi_ulong obj, int op, abi_ulong val,
return ret;
}
+static inline abi_long do_freebsd_sigfastblock(abi_long cmd, abi_long ptr)
+{
+ void *hostptr = g2h_untagged(ptr);
+
+ if (hostptr == NULL) {
+ return -TARGET_EFAULT;
+ }
+ return get_errno(safe_sigfastblock(cmd, hostptr));
+}
+
#endif /* FREEBSD_OS_THREAD_H */
--
2.55.0
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [PATCH 11/14] bsd-user: Eliminate unused regs arg in load_elf_binary
2026-09-20 5:20 [PATCH 00/14] bsd-user: Upstream a few fixes Warner Losh
` (9 preceding siblings ...)
2026-09-20 5:20 ` [PATCH 10/14] bsd-user: Implement sigfastblock Warner Losh
@ 2026-09-20 5:20 ` Warner Losh
2026-09-20 22:14 ` Richard Henderson
2026-09-20 5:20 ` [PATCH 12/14] bsd-user: #ifdef sockopt that aren't in 14 Warner Losh
` (2 subsequent siblings)
13 siblings, 1 reply; 32+ messages in thread
From: Warner Losh @ 2026-09-20 5:20 UTC (permalink / raw)
To: qemu-devel; +Cc: Kyle Evans, Warner Losh
Signed-off-by: Warner Losh <imp@bsdimp.com>
---
bsd-user/bsdload.c | 2 +-
bsd-user/elfload.c | 3 +--
bsd-user/qemu.h | 3 +--
3 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/bsd-user/bsdload.c b/bsd-user/bsdload.c
index 5b3c061a45..dcf3ca14fc 100644
--- a/bsd-user/bsdload.c
+++ b/bsd-user/bsdload.c
@@ -193,7 +193,7 @@ int loader_exec(const char *filename, char **argv, char **envp,
&& bprm->buf[1] == 'E'
&& bprm->buf[2] == 'L'
&& bprm->buf[3] == 'F') {
- retval = load_elf_binary(bprm, regs, infop);
+ retval = load_elf_binary(bprm, infop);
} else {
fprintf(stderr, "Unknown binary format\n");
return -1;
diff --git a/bsd-user/elfload.c b/bsd-user/elfload.c
index a87a892eb8..295dad4643 100644
--- a/bsd-user/elfload.c
+++ b/bsd-user/elfload.c
@@ -598,8 +598,7 @@ load_elf_sections(const struct elfhdr *hdr, struct elf_phdr *phdr, int fd,
return 0;
}
-int load_elf_binary(struct bsd_binprm *bprm, struct target_pt_regs *regs,
- struct image_info *info)
+int load_elf_binary(struct bsd_binprm *bprm, struct image_info *info)
{
struct elfhdr elf_ex;
struct elfhdr interp_elf_ex;
diff --git a/bsd-user/qemu.h b/bsd-user/qemu.h
index 851b0c2c5f..5baaa333ed 100644
--- a/bsd-user/qemu.h
+++ b/bsd-user/qemu.h
@@ -167,8 +167,7 @@ int loader_exec(const char *filename, char **argv, char **envp,
struct target_pt_regs *regs, struct image_info *infop,
struct bsd_binprm *bprm);
-int load_elf_binary(struct bsd_binprm *bprm, struct target_pt_regs *regs,
- struct image_info *info);
+int load_elf_binary(struct bsd_binprm *bprm, struct image_info *info);
int load_flt_binary(struct bsd_binprm *bprm, struct target_pt_regs *regs,
struct image_info *info);
int is_target_elf_binary(int fd);
--
2.55.0
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [PATCH 12/14] bsd-user: #ifdef sockopt that aren't in 14
2026-09-20 5:20 [PATCH 00/14] bsd-user: Upstream a few fixes Warner Losh
` (10 preceding siblings ...)
2026-09-20 5:20 ` [PATCH 11/14] bsd-user: Eliminate unused regs arg in load_elf_binary Warner Losh
@ 2026-09-20 5:20 ` Warner Losh
2026-09-21 18:32 ` Pierrick Bouvier
2026-09-20 5:20 ` [PATCH 13/14] bsd-user: Fix non-PIE binaries Warner Losh
2026-09-20 5:20 ` [PATCH 14/14] bsd-user: Remove host-os.h Warner Losh
13 siblings, 1 reply; 32+ messages in thread
From: Warner Losh @ 2026-09-20 5:20 UTC (permalink / raw)
To: qemu-devel; +Cc: Kyle Evans, Warner Losh
Signed-off-by: Warner Losh <imp@bsdimp.com>
---
bsd-user/freebsd/os-sockopt.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/bsd-user/freebsd/os-sockopt.h b/bsd-user/freebsd/os-sockopt.h
index 2f984cf8e3..55b678824d 100644
--- a/bsd-user/freebsd/os-sockopt.h
+++ b/bsd-user/freebsd/os-sockopt.h
@@ -281,6 +281,7 @@ static struct sockopt_entry ipproto_tcp[] = {
{ IPPROTO_TCP , TCP_RACK_PACE_MIN_SEG, { SOCKOPT_TYPE_INT, } },
{ IPPROTO_TCP , TCP_RACK_DGP_IN_REC , { SOCKOPT_TYPE_INT, } },
{ IPPROTO_TCP , TCP_PACING_DND , { SOCKOPT_TYPE_INT, } },
+#ifdef TCP_SS_EEXIT
{ IPPROTO_TCP , TCP_SS_EEXIT , { SOCKOPT_TYPE_INT, } },
{ IPPROTO_TCP , TCP_DGP_UPPER_BOUNDS, { SOCKOPT_TYPE_INT, } },
{ IPPROTO_TCP , TCP_NO_TIMELY , { SOCKOPT_TYPE_INT, } },
@@ -289,6 +290,7 @@ static struct sockopt_entry ipproto_tcp[] = {
{ IPPROTO_TCP , TCP_SIDECHAN_DIS , { SOCKOPT_TYPE_INT, } },
{ IPPROTO_TCP , TCP_FILLCW_RATE_CAP , { SOCKOPT_TYPE_INT, } },
{ IPPROTO_TCP , TCP_GP_USE_LTBW , { SOCKOPT_TYPE_INT, } },
+#endif
{ SOCK_LEVEL_NONE }
};
--
2.55.0
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [PATCH 13/14] bsd-user: Fix non-PIE binaries
2026-09-20 5:20 [PATCH 00/14] bsd-user: Upstream a few fixes Warner Losh
` (11 preceding siblings ...)
2026-09-20 5:20 ` [PATCH 12/14] bsd-user: #ifdef sockopt that aren't in 14 Warner Losh
@ 2026-09-20 5:20 ` Warner Losh
2026-09-20 22:33 ` Richard Henderson
2026-09-20 5:20 ` [PATCH 14/14] bsd-user: Remove host-os.h Warner Losh
13 siblings, 1 reply; 32+ messages in thread
From: Warner Losh @ 2026-09-20 5:20 UTC (permalink / raw)
To: qemu-devel; +Cc: Kyle Evans, Warner Losh, Maksym Sobolyev
From: Maksym Sobolyev <sobomax@sippysoft.com>
When loading non-PIE binary (could be either static or dymanic),
make sure to set MAP_EXCL while mapping the program text. Otherwise
if qemu is also non-PIE it might be loaded at the very same
address, effectively self-destructing after mapping target binary
over its own text area.
It is not a problem for fully dynamic binaries loading, as in
that case the initial mapping is non-fixed, so the kernel would
pick some non-conflicting area for us.
32625 qemu-x86_64 CALL openat(AT_FDCWD,0x7fffffffe240,0<O_RDONLY>)
32625 qemu-x86_64 NAMI "/usr/bin/cc"
32625 qemu-x86_64 RET openat 3
[...]
32625 qemu-x86_64 CALL mmap(0x809222000,0x20001000,0x7<PROT_READ|PROT_WRITE|PROT_EXEC>,0x1012<MAP_PRIVATE|MAP_FIXED|MAP_ANON>,0xffffffff,0)
32625 qemu-x86_64 RET mmap 34512969728/0x809222000
32625 qemu-x86_64 CALL mprotect(0x809222000,0x1000,0<PROT_NONE>)
32625 qemu-x86_64 RET mprotect 0
32625 qemu-x86_64 CALL mmap(0,0x458,0x3<PROT_READ|PROT_WRITE>,0x1002<MAP_PRIVATE|MAP_ANON>,0xffffffff,0)
32625 qemu-x86_64 RET mmap 35049844736/0x829223000
32625 qemu-x86_64 CALL minherit(0x829223000,0x458,INHERIT_ZERO)
32625 qemu-x86_64 RET minherit 0
32625 qemu-x86_64 CALL getrandom(0x7fffffffde10,0x28,0)
32625 qemu-x86_64 RET getrandom 40/0x28
32625 qemu-x86_64 CALL mmap(0x200000,0x2053000,0x1<PROT_READ>,0x12<MAP_PRIVATE|MAP_FIXED>,0x3,0)
32625 qemu-x86_64 RET mmap 2097152/0x200000
32625 qemu-x86_64 PSIG SIGSEGV SIG_DFL code=SEGV_ACCERR
32625 qemu-x86_64 RET nanosleep -1 errno 4 Interrupted system call
Signed-off-by: Maksym Sobolyev <sobomax@sippysoft.com>
Reviewed-by: Warner Losh <imp@bsdimp.com>
Signed-off-by: Warner Losh <imp@bsdimp.com>
---
bsd-user/elfload.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/bsd-user/elfload.c b/bsd-user/elfload.c
index 295dad4643..eaa8676f5a 100644
--- a/bsd-user/elfload.c
+++ b/bsd-user/elfload.c
@@ -561,12 +561,14 @@ load_elf_sections(const struct elfhdr *hdr, struct elf_phdr *phdr, int fd,
elf_prot |= PROT_EXEC;
}
+ int flags = MAP_FIXED | MAP_PRIVATE | MAP_DENYWRITE;
+ if (rbase == 0) {
+ flags |= MAP_EXCL;
+ }
error = target_mmap(TARGET_ELF_PAGESTART(rbase + elf_ppnt->p_vaddr),
(elf_ppnt->p_filesz +
TARGET_ELF_PAGEOFFSET(elf_ppnt->p_vaddr)),
- elf_prot,
- (MAP_FIXED | MAP_PRIVATE | MAP_DENYWRITE),
- fd,
+ elf_prot, flags, fd,
(elf_ppnt->p_offset -
TARGET_ELF_PAGEOFFSET(elf_ppnt->p_vaddr)));
if (error == -1) {
--
2.55.0
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [PATCH 14/14] bsd-user: Remove host-os.h
2026-09-20 5:20 [PATCH 00/14] bsd-user: Upstream a few fixes Warner Losh
` (12 preceding siblings ...)
2026-09-20 5:20 ` [PATCH 13/14] bsd-user: Fix non-PIE binaries Warner Losh
@ 2026-09-20 5:20 ` Warner Losh
2026-09-20 22:34 ` Richard Henderson
13 siblings, 1 reply; 32+ messages in thread
From: Warner Losh @ 2026-09-20 5:20 UTC (permalink / raw)
To: qemu-devel; +Cc: Kyle Evans, Warner Losh
host-os.h was used to just set the default bsd flavor, but it's no
longer used. Retire it.
Signed-off-by: Warner Losh <imp@bsdimp.com>
---
bsd-user/freebsd/host-os.h | 25 -------------------------
bsd-user/main.c | 2 --
2 files changed, 27 deletions(-)
diff --git a/bsd-user/freebsd/host-os.h b/bsd-user/freebsd/host-os.h
deleted file mode 100644
index 40cae72ec9..0000000000
--- a/bsd-user/freebsd/host-os.h
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * FreeBSD host dependent code and definitions
- *
- * Copyright (c) 2013 Stacey D. Son
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef HOST_OS_H
-#define HOST_OS_H
-
-#define HOST_DEFAULT_BSD_TYPE target_freebsd
-
-#endif /* HOST_OS_H */
diff --git a/bsd-user/main.c b/bsd-user/main.c
index 13cd752b99..29ee59de2c 100644
--- a/bsd-user/main.c
+++ b/bsd-user/main.c
@@ -52,10 +52,8 @@
#include "exec/page-vary.h"
#include "exec/watchpoint.h"
-#include "host-os.h"
#include "target_arch_cpu.h"
-
/*
* TODO: Remove these and rely only on qemu_real_host_page_size().
*/
--
2.55.0
^ permalink raw reply related [flat|nested] 32+ messages in thread
* Re: [PATCH 01/14] bsd-user: HOST_BIG_ENDIAN and TARGET_BIG_ENDIAN are always
2026-09-20 5:20 ` [PATCH 01/14] bsd-user: HOST_BIG_ENDIAN and TARGET_BIG_ENDIAN are always Warner Losh
@ 2026-09-20 21:57 ` Richard Henderson
0 siblings, 0 replies; 32+ messages in thread
From: Richard Henderson @ 2026-09-20 21:57 UTC (permalink / raw)
To: Warner Losh, qemu-devel; +Cc: Kyle Evans, Rick Richard
On 9/19/26 19:20, Warner Losh wrote:
> From: Rick Richard <rick@sloservers.com>
>
> TARGET_BIG_ENDIAN and HOST_BIG_ENDIAN are always defined.
>
> lseek and target_offset64() transpose upper and lower halves
> on 32-bit ABIs, -strace prints wrong off_t.
>
> Signed-off-by: Rick Richard <rick@sloservers.com>
> [ fixed defined() too ]
> Reviewed-by: Warner Losh <imp@bsdimp.com>
> Signed-off-by: Warner Losh <imp@bsdimp.com>
> ---
> bsd-user/bsd-file.h | 2 +-
> bsd-user/freebsd/os-misc.h | 2 +-
> bsd-user/freebsd/os-thread.h | 2 +-
> 3 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/bsd-user/bsd-file.h b/bsd-user/bsd-file.h
> index 0fefc07232..a2c2e38e50 100644
> --- a/bsd-user/bsd-file.h
> +++ b/bsd-user/bsd-file.h
> @@ -986,7 +986,7 @@ static abi_long do_bsd_lseek(CPUArchState *env, abi_long arg1, abi_long arg2,
> ret = get_errno(res);
> set_second_rval(env, 0xFFFFFFFF);
> } else {
> -#ifdef TARGET_BIG_ENDIAN
> +#if TARGET_BIG_ENDIAN
> ret = ((res >> 32) & 0xFFFFFFFF);
> set_second_rval(env, res & 0xFFFFFFFF);
> #else
> diff --git a/bsd-user/freebsd/os-misc.h b/bsd-user/freebsd/os-misc.h
> index 0f87b21cc8..e9f9eed4b4 100644
> --- a/bsd-user/freebsd/os-misc.h
> +++ b/bsd-user/freebsd/os-misc.h
> @@ -336,7 +336,7 @@ static inline abi_long do_freebsd_kldsym(abi_long fileid, abi_long cmd,
> #if TARGET_ABI_BITS == 32
> static inline uint64_t target_offset64(uint32_t word0, uint32_t word1)
> {
> -#ifdef TARGET_BIG_ENDIAN
> +#if TARGET_BIG_ENDIAN
> return ((uint64_t)word0 << 32) | word1;
> #else
> return ((uint64_t)word1 << 32) | word0;
These first two should be converted to C if's.
r~
> diff --git a/bsd-user/freebsd/os-thread.h b/bsd-user/freebsd/os-thread.h
> index 4258b24095..6552c60337 100644
> --- a/bsd-user/freebsd/os-thread.h
> +++ b/bsd-user/freebsd/os-thread.h
> @@ -18,7 +18,7 @@
> int safe_thr_suspend(struct timespec *timeout);
> int safe__umtx_op(void *, int, unsigned long, void *, void *);
>
> -#if defined(HOST_BIG_ENDIAN) == defined(TARGET_BIG_ENDIAN) && \
> +#if HOST_BIG_ENDIAN == TARGET_BIG_ENDIAN && \
> (TARGET_ABI_BITS == HOST_LONG_BITS || defined(UMTX_OP__32BIT))
> #define _UMTX_OPTIMIZED
> #if defined(TARGET_ABI32)
>
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 03/14] bsd-user: Flag shared memory as needing atomics
2026-09-20 5:20 ` [PATCH 03/14] bsd-user: Flag shared memory as needing atomics Warner Losh
@ 2026-09-20 21:59 ` Richard Henderson
0 siblings, 0 replies; 32+ messages in thread
From: Richard Henderson @ 2026-09-20 21:59 UTC (permalink / raw)
To: Warner Losh, qemu-devel; +Cc: Kyle Evans
On 9/19/26 19:20, Warner Losh wrote:
> Catch up with linux-user 228168cbb7c:
> Signal the translator to use host atomic instructions for
> guest operations, insofar as it is possible. This is the
> best we can do to allow the guest to interact atomically
> with other processes.
>
> as well as subsequent tweaks and adjustmentst for bsd-user's code
> structure (we don't have one exit path linux-user does and could frankly
> stand to resturcture a bit to match the evolved code in linux-user). On
> non-private mmap(2) sharing and all successful shmat(2) calls we tell
> tcg that we're in a parallel context, which changes how it does atomics.
>
> Signed-off-by: Warner Losh<imp@bsdimp.com>
> ---
> bsd-user/bsd-mem.h | 8 ++++++++
> bsd-user/mmap.c | 9 +++++++++
> 2 files changed, 17 insertions(+)
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
r~
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 04/14] bsd-user: Add gdb for system calls
2026-09-20 5:20 ` [PATCH 04/14] bsd-user: Add gdb for system calls Warner Losh
@ 2026-09-20 22:02 ` Richard Henderson
2026-09-21 10:06 ` Warner Losh
0 siblings, 1 reply; 32+ messages in thread
From: Richard Henderson @ 2026-09-20 22:02 UTC (permalink / raw)
To: qemu-devel
On 9/19/26 19:20, Warner Losh wrote:
> Mirror what linux-user does around system calls.
>
> Signed-off-by: Warner Losh <imp@bsdimp.com>
> ---
> bsd-user/freebsd/os-syscall.c | 8 +++++++-
> 1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/bsd-user/freebsd/os-syscall.c b/bsd-user/freebsd/os-syscall.c
> index 7e400c89bc..38dc87f745 100644
> --- a/bsd-user/freebsd/os-syscall.c
> +++ b/bsd-user/freebsd/os-syscall.c
> @@ -29,7 +29,7 @@
> #include <utime.h>
> #include <poll.h>
>
> -#include "include/gdbstub/syscalls.h"
> +#include "gdbstub/user.h"
>
> #include "qemu.h"
> #include "signal-common.h"
> @@ -1622,14 +1622,20 @@ abi_long do_freebsd_syscall(CPUArchState *env, int num, abi_long arg1,
> abi_long arg5, abi_long arg6, abi_long arg7,
> abi_long arg8)
> {
> + CPUState *cpu = env_cpu(env);
> abi_long ret;
>
> if (do_strace) {
> print_freebsd_syscall(num, arg1, arg2, arg3, arg4, arg5, arg6);
> }
>
> + gdb_syscall_entry(cpu, num);
> +
> ret = freebsd_syscall(env, num, arg1, arg2, arg3, arg4, arg5, arg6,
> arg7, arg8);
> +
> + gdb_syscall_return(cpu, num);
> +
> if (do_strace) {
> print_freebsd_syscall_ret(num, ret);
> }
>
This isn't quite the same -- linux now has plugin support:
static void record_syscall_start(CPUState *cpu, int num,
abi_long arg1, abi_long arg2,
abi_long arg3, abi_long arg4,
abi_long arg5, abi_long arg6,
abi_long arg7, abi_long arg8)
{
qemu_plugin_vcpu_syscall(cpu, num,
arg1, arg2, arg3, arg4,
arg5, arg6, arg7, arg8);
gdb_syscall_entry(cpu, num);
}
static void record_syscall_return(CPUState *cpu, int num, abi_long ret)
{
qemu_plugin_vcpu_syscall_ret(cpu, num, ret);
gdb_syscall_return(cpu, num);
}
and they're strictly outside strace rather than interleaved.
r~
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 05/14] bsd-user: Initialize per-arch child registers
2026-09-20 5:20 ` [PATCH 05/14] bsd-user: Initialize per-arch child registers Warner Losh
@ 2026-09-20 22:07 ` Richard Henderson
0 siblings, 0 replies; 32+ messages in thread
From: Richard Henderson @ 2026-09-20 22:07 UTC (permalink / raw)
To: Warner Losh, qemu-devel; +Cc: Kyle Evans
On 9/19/26 19:20, Warner Losh wrote:
> Signed-off-by: Warner Losh <imp@bsdimp.com>
> ---
> bsd-user/freebsd/os-thread.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/bsd-user/freebsd/os-thread.c b/bsd-user/freebsd/os-thread.c
> index 15872f03fd..eaab062d3d 100644
> --- a/bsd-user/freebsd/os-thread.c
> +++ b/bsd-user/freebsd/os-thread.c
> @@ -1629,6 +1629,9 @@ abi_long do_freebsd_thr_new(CPUArchState *env,
>
> new_env = cpu_copy(env);
>
> + /* Init regs that differ from the parent. */
> + target_cpu_clone_regs(new_env, 0);
> +
> new_cpu = env_cpu(new_env);
> new_cpu->opaque = ts;
> ts->bprm = parent_ts->bprm;
>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
r~
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 06/14] bsd-user: Fix crazy bug with mmap
2026-09-20 5:20 ` [PATCH 06/14] bsd-user: Fix crazy bug with mmap Warner Losh
@ 2026-09-20 22:09 ` Richard Henderson
2026-09-21 2:38 ` Warner Losh
0 siblings, 1 reply; 32+ messages in thread
From: Richard Henderson @ 2026-09-20 22:09 UTC (permalink / raw)
To: Warner Losh, qemu-devel; +Cc: Kyle Evans
On 9/19/26 19:20, Warner Losh wrote:
> +++ b/bsd-user/mmap.c
> @@ -215,10 +215,13 @@ static int mmap_frag(abi_ulong real_start,
>
> prot_new = prot | prot1;
> if (fd != -1) {
> - /* msync() won't work here, so we return an error if write is
> - possible while it is a shared mapping */
> - if ((flags & TARGET_BSD_MAP_FLAGMASK) == MAP_SHARED &&
> - (prot & PROT_WRITE))
> + /*
> + * msync() won't work here, so we return an error if write is
> + * possible while it is a shared mapping
> + */
> + if (!(flags & MAP_ANON)
> + && (flags & MAP_TYPE) == MAP_SHARED
> + && (prot & PROT_WRITE))
> return -1;
>
> /* adjust protection to be able to read */
Need braces, even if they were missing beforehand. Otherwise,
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
r~
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 07/14] bsd-user: Move tb_flush stuff to begin_parallel_context
2026-09-20 5:20 ` [PATCH 07/14] bsd-user: Move tb_flush stuff to begin_parallel_context Warner Losh
@ 2026-09-20 22:11 ` Richard Henderson
0 siblings, 0 replies; 32+ messages in thread
From: Richard Henderson @ 2026-09-20 22:11 UTC (permalink / raw)
To: Warner Losh, qemu-devel; +Cc: Kyle Evans
On 9/19/26 19:20, Warner Losh wrote:
> Catch up with linux-user 430014bee7a6c26a70e9f3854428843d5918cdf5 and
> impelment begin_parallel_context. We'd already moved to using
> tb_flush__exclusive_or_serial, but need this in several places, like
> linux-user has.
>
> Signed-off-by: Warner Losh <imp@bsdimp.com>
> ---
> bsd-user/freebsd/os-thread.c | 6 +-----
> bsd-user/qemu.h | 18 ++++++++++++++++++
> 2 files changed, 19 insertions(+), 5 deletions(-)
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
r~
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 08/14] bsd-user: Fix MAP_TYPE definition.
2026-09-20 5:20 ` [PATCH 08/14] bsd-user: Fix MAP_TYPE definition Warner Losh
@ 2026-09-20 22:12 ` Richard Henderson
0 siblings, 0 replies; 32+ messages in thread
From: Richard Henderson @ 2026-09-20 22:12 UTC (permalink / raw)
To: qemu-devel
On 9/19/26 19:20, Warner Losh wrote:
> The 0xf I think was copied from the Linux headers a long time ago, since
> BSD doesn't define this. In FreeBSD, there's only two bits of this low
> nibble that are used for the sharing type (linux has 2 more types
> encoded in these low bits). The kernel rejects bogus flags (0xc part of
> 0xf mask), so it's better to have just these two bits here.
>
> Signed-off-by: Warner Losh <imp@bsdimp.com>
> ---
> bsd-user/syscall_defs.h | 9 ++++++++-
> 1 file changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/bsd-user/syscall_defs.h b/bsd-user/syscall_defs.h
> index 506aea3e27..c4fd5f5589 100644
> --- a/bsd-user/syscall_defs.h
> +++ b/bsd-user/syscall_defs.h
> @@ -121,7 +121,14 @@ struct target_msgbuf {
> /*
> * sys/mman.h
> */
> -#define MAP_TYPE 0xf
> +/*
> + * FreeBSD doesn't define this, but Linux does. In Linux, it's only MAP_PRIVATE
> + * and MAP_SHARED and a few Linux-specific types (0xf). FreeBSD allows other
> + * types of mapping with MAP_ANON, MAP_GUARD, and MAP_STACK. The mask on Linux
> + * excludes these: They don't have MAP_GUARD, and MAP_STACK and MAP_ANON have
> + * similar flags with different names that aren't in it's 0xf MAP_TYPE.
> + */
> +#define MAP_TYPE (MAP_PRIVATE | MAP_SHARED)
>
> /*
> * sys/time.h
>
Needs to be merged with patch 6.
r~
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 11/14] bsd-user: Eliminate unused regs arg in load_elf_binary
2026-09-20 5:20 ` [PATCH 11/14] bsd-user: Eliminate unused regs arg in load_elf_binary Warner Losh
@ 2026-09-20 22:14 ` Richard Henderson
0 siblings, 0 replies; 32+ messages in thread
From: Richard Henderson @ 2026-09-20 22:14 UTC (permalink / raw)
To: Warner Losh, qemu-devel; +Cc: Kyle Evans
On 9/19/26 19:20, Warner Losh wrote:
> Signed-off-by: Warner Losh<imp@bsdimp.com>
> ---
> bsd-user/bsdload.c | 2 +-
> bsd-user/elfload.c | 3 +--
> bsd-user/qemu.h | 3 +--
> 3 files changed, 3 insertions(+), 5 deletions(-)
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
r~
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 13/14] bsd-user: Fix non-PIE binaries
2026-09-20 5:20 ` [PATCH 13/14] bsd-user: Fix non-PIE binaries Warner Losh
@ 2026-09-20 22:33 ` Richard Henderson
2026-09-21 1:06 ` Warner Losh
0 siblings, 1 reply; 32+ messages in thread
From: Richard Henderson @ 2026-09-20 22:33 UTC (permalink / raw)
To: Warner Losh, qemu-devel; +Cc: Kyle Evans, Maksym Sobolyev
On 9/19/26 19:20, Warner Losh wrote:
> diff --git a/bsd-user/elfload.c b/bsd-user/elfload.c
> index 295dad4643..eaa8676f5a 100644
> --- a/bsd-user/elfload.c
> +++ b/bsd-user/elfload.c
> @@ -561,12 +561,14 @@ load_elf_sections(const struct elfhdr *hdr, struct elf_phdr *phdr, int fd,
> elf_prot |= PROT_EXEC;
> }
>
> + int flags = MAP_FIXED | MAP_PRIVATE | MAP_DENYWRITE;
> + if (rbase == 0) {
> + flags |= MAP_EXCL;
> + }
> error = target_mmap(TARGET_ELF_PAGESTART(rbase + elf_ppnt->p_vaddr),
> (elf_ppnt->p_filesz +
> TARGET_ELF_PAGEOFFSET(elf_ppnt->p_vaddr)),
> - elf_prot,
> - (MAP_FIXED | MAP_PRIVATE | MAP_DENYWRITE),
> - fd,
> + elf_prot, flags, fd,
This is wrong, or at least very not ideal.
What's missing no the freebsd side is a probe for the entire address
space for the guest program.
> /*
> * Reserve address space for all of this.
> *
> * In the case of ET_EXEC, we supply MAP_FIXED_NOREPLACE so that we get
> * exactly the address range that is required. Without reserved_va,
> * the guest address space is not isolated. We have attempted to avoid
> * conflict with the host program itself via probe_guest_base, but using
> * MAP_FIXED_NOREPLACE instead of MAP_FIXED provides an extra check.
> *
> * Otherwise this is ET_DYN, and we are searching for a location
> * that can hold the memory space required. If the image is
> * pre-linked, LOAD_ADDR will be non-zero, and the kernel should
> * honor that address if it happens to be free.
> *
> * In both cases, we will overwrite pages in this range with mappings
> * from the executable.
> */
> reserve_size = range.hi - range.lo + 1;
> align_size = reserve_size;
>
> if (ehdr->e_type != ET_EXEC && align > qemu_real_host_page_size()) {
> align_size += align - 1;
> }
>
> load_addr = target_mmap(load_addr, align_size, PROT_NONE,
> MAP_PRIVATE | MAP_ANON | MAP_NORESERVE |
> (ehdr->e_type == ET_EXEC ? MAP_FIXED_NOREPLACE : 0),
> -1, 0);
which handles ET_DYN properly, which is missing from the freebsd side
entirely. Afterward, elf sections are mapped onto this reserved range.
I'll note that FreeBSD should be able to do better than Linux wrt the
alignment handling here, since you have MAP_ALIGNED(). So long as
guest_base is suitably aligned, anyway.
r~
r~
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 14/14] bsd-user: Remove host-os.h
2026-09-20 5:20 ` [PATCH 14/14] bsd-user: Remove host-os.h Warner Losh
@ 2026-09-20 22:34 ` Richard Henderson
0 siblings, 0 replies; 32+ messages in thread
From: Richard Henderson @ 2026-09-20 22:34 UTC (permalink / raw)
To: Warner Losh, qemu-devel; +Cc: Kyle Evans
On 9/19/26 19:20, Warner Losh wrote:
> host-os.h was used to just set the default bsd flavor, but it's no
> longer used. Retire it.
>
> Signed-off-by: Warner Losh<imp@bsdimp.com>
> ---
> bsd-user/freebsd/host-os.h | 25 -------------------------
> bsd-user/main.c | 2 --
> 2 files changed, 27 deletions(-)
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
r~
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 13/14] bsd-user: Fix non-PIE binaries
2026-09-20 22:33 ` Richard Henderson
@ 2026-09-21 1:06 ` Warner Losh
0 siblings, 0 replies; 32+ messages in thread
From: Warner Losh @ 2026-09-21 1:06 UTC (permalink / raw)
To: Richard Henderson; +Cc: qemu-devel, Kyle Evans, Maksym Sobolyev
[-- Attachment #1: Type: text/plain, Size: 3102 bytes --]
On Sun, Sep 20, 2026 at 4:33 PM Richard Henderson <
richard.henderson@linaro.org> wrote:
> On 9/19/26 19:20, Warner Losh wrote:
> > diff --git a/bsd-user/elfload.c b/bsd-user/elfload.c
> > index 295dad4643..eaa8676f5a 100644
> > --- a/bsd-user/elfload.c
> > +++ b/bsd-user/elfload.c
> > @@ -561,12 +561,14 @@ load_elf_sections(const struct elfhdr *hdr, struct
> elf_phdr *phdr, int fd,
> > elf_prot |= PROT_EXEC;
> > }
> >
> > + int flags = MAP_FIXED | MAP_PRIVATE | MAP_DENYWRITE;
> > + if (rbase == 0) {
> > + flags |= MAP_EXCL;
> > + }
> > error = target_mmap(TARGET_ELF_PAGESTART(rbase +
> elf_ppnt->p_vaddr),
> > (elf_ppnt->p_filesz +
> > TARGET_ELF_PAGEOFFSET(elf_ppnt->p_vaddr)),
> > - elf_prot,
> > - (MAP_FIXED | MAP_PRIVATE | MAP_DENYWRITE),
> > - fd,
> > + elf_prot, flags, fd,
> This is wrong, or at least very not ideal.
>
> What's missing no the freebsd side is a probe for the entire address
> space for the guest program.
>
I believe I have those missing pieces in the next round. I'll pull them
forward into this round when I rework.
Warner
> > /*
> > * Reserve address space for all of this.
> > *
> > * In the case of ET_EXEC, we supply MAP_FIXED_NOREPLACE so that we
> get
> > * exactly the address range that is required. Without reserved_va,
> > * the guest address space is not isolated. We have attempted to
> avoid
> > * conflict with the host program itself via probe_guest_base, but
> using
> > * MAP_FIXED_NOREPLACE instead of MAP_FIXED provides an extra check.
> > *
> > * Otherwise this is ET_DYN, and we are searching for a location
> > * that can hold the memory space required. If the image is
> > * pre-linked, LOAD_ADDR will be non-zero, and the kernel should
> > * honor that address if it happens to be free.
> > *
> > * In both cases, we will overwrite pages in this range with mappings
> > * from the executable.
> > */
> > reserve_size = range.hi - range.lo + 1;
> > align_size = reserve_size;
> >
> > if (ehdr->e_type != ET_EXEC && align > qemu_real_host_page_size()) {
> > align_size += align - 1;
> > }
> >
> > load_addr = target_mmap(load_addr, align_size, PROT_NONE,
> > MAP_PRIVATE | MAP_ANON | MAP_NORESERVE |
> > (ehdr->e_type == ET_EXEC ?
> MAP_FIXED_NOREPLACE : 0),
> > -1, 0);
>
> which handles ET_DYN properly, which is missing from the freebsd side
> entirely. Afterward, elf sections are mapped onto this reserved range.
>
> I'll note that FreeBSD should be able to do better than Linux wrt the
> alignment handling here, since you have MAP_ALIGNED(). So long as
> guest_base is suitably aligned, anyway.
>
>
> r~
>
> r~
>
[-- Attachment #2: Type: text/html, Size: 4178 bytes --]
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 06/14] bsd-user: Fix crazy bug with mmap
2026-09-20 22:09 ` Richard Henderson
@ 2026-09-21 2:38 ` Warner Losh
0 siblings, 0 replies; 32+ messages in thread
From: Warner Losh @ 2026-09-21 2:38 UTC (permalink / raw)
To: Richard Henderson; +Cc: qemu-devel, Kyle Evans
[-- Attachment #1: Type: text/plain, Size: 1259 bytes --]
On Sun, Sep 20, 2026 at 4:09 PM Richard Henderson <
richard.henderson@linaro.org> wrote:
> On 9/19/26 19:20, Warner Losh wrote:
> > +++ b/bsd-user/mmap.c
> > @@ -215,10 +215,13 @@ static int mmap_frag(abi_ulong real_start,
> >
> > prot_new = prot | prot1;
> > if (fd != -1) {
> > - /* msync() won't work here, so we return an error if write is
> > - possible while it is a shared mapping */
> > - if ((flags & TARGET_BSD_MAP_FLAGMASK) == MAP_SHARED &&
> > - (prot & PROT_WRITE))
> > + /*
> > + * msync() won't work here, so we return an error if write is
> > + * possible while it is a shared mapping
> > + */
> > + if (!(flags & MAP_ANON)
> > + && (flags & MAP_TYPE) == MAP_SHARED
> > + && (prot & PROT_WRITE))
> > return -1;
> >
> > /* adjust protection to be able to read */
>
> Need braces, even if they were missing beforehand. Otherwise,
>
OK. I'll fix this for this series, but I'm tempted to land my 'fix all the
style bugs in bsd-user' patches
since this issue stubs my toe all the time.
> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
>
Thanks!
> r~
>
[-- Attachment #2: Type: text/html, Size: 2255 bytes --]
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 04/14] bsd-user: Add gdb for system calls
2026-09-20 22:02 ` Richard Henderson
@ 2026-09-21 10:06 ` Warner Losh
0 siblings, 0 replies; 32+ messages in thread
From: Warner Losh @ 2026-09-21 10:06 UTC (permalink / raw)
To: Richard Henderson; +Cc: qemu-devel
[-- Attachment #1: Type: text/plain, Size: 2589 bytes --]
On Sun, Sep 20, 2026 at 4:03 PM Richard Henderson <
richard.henderson@linaro.org> wrote:
> On 9/19/26 19:20, Warner Losh wrote:
> > Mirror what linux-user does around system calls.
> >
> > Signed-off-by: Warner Losh <imp@bsdimp.com>
> > ---
> > bsd-user/freebsd/os-syscall.c | 8 +++++++-
> > 1 file changed, 7 insertions(+), 1 deletion(-)
> >
> > diff --git a/bsd-user/freebsd/os-syscall.c
> b/bsd-user/freebsd/os-syscall.c
> > index 7e400c89bc..38dc87f745 100644
> > --- a/bsd-user/freebsd/os-syscall.c
> > +++ b/bsd-user/freebsd/os-syscall.c
> > @@ -29,7 +29,7 @@
> > #include <utime.h>
> > #include <poll.h>
> >
> > -#include "include/gdbstub/syscalls.h"
> > +#include "gdbstub/user.h"
> >
> > #include "qemu.h"
> > #include "signal-common.h"
> > @@ -1622,14 +1622,20 @@ abi_long do_freebsd_syscall(CPUArchState *env,
> int num, abi_long arg1,
> > abi_long arg5, abi_long arg6, abi_long
> arg7,
> > abi_long arg8)
> > {
> > + CPUState *cpu = env_cpu(env);
> > abi_long ret;
> >
> > if (do_strace) {
> > print_freebsd_syscall(num, arg1, arg2, arg3, arg4, arg5, arg6);
> > }
> >
> > + gdb_syscall_entry(cpu, num);
> > +
> > ret = freebsd_syscall(env, num, arg1, arg2, arg3, arg4, arg5, arg6,
> > arg7, arg8);
> > +
> > + gdb_syscall_return(cpu, num);
> > +
> > if (do_strace) {
> > print_freebsd_syscall_ret(num, ret);
> > }
> >
>
> This isn't quite the same -- linux now has plugin support:
>
> static void record_syscall_start(CPUState *cpu, int num,
> abi_long arg1, abi_long arg2,
> abi_long arg3, abi_long arg4,
> abi_long arg5, abi_long arg6,
> abi_long arg7, abi_long arg8)
> {
> qemu_plugin_vcpu_syscall(cpu, num,
> arg1, arg2, arg3, arg4,
> arg5, arg6, arg7, arg8);
> gdb_syscall_entry(cpu, num);
> }
>
> static void record_syscall_return(CPUState *cpu, int num, abi_long ret)
> {
> qemu_plugin_vcpu_syscall_ret(cpu, num, ret);
> gdb_syscall_return(cpu, num);
> }
>
> and they're strictly outside strace rather than interleaved.
>
OK. I'm going to drop this from the list, but create
https://github.com/qemu-bsd-user/qemu-bsd-user/issues/72
to track it and resubmit once I've had a chance to refactor it.
Warner
[-- Attachment #2: Type: text/html, Size: 3655 bytes --]
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 12/14] bsd-user: #ifdef sockopt that aren't in 14
2026-09-20 5:20 ` [PATCH 12/14] bsd-user: #ifdef sockopt that aren't in 14 Warner Losh
@ 2026-09-21 18:32 ` Pierrick Bouvier
0 siblings, 0 replies; 32+ messages in thread
From: Pierrick Bouvier @ 2026-09-21 18:32 UTC (permalink / raw)
To: Warner Losh, qemu-devel; +Cc: Kyle Evans
On 9/19/2026 10:20 PM, Warner Losh wrote:
> Signed-off-by: Warner Losh <imp@bsdimp.com>
> ---
> bsd-user/freebsd/os-sockopt.h | 2 ++
> 1 file changed, 2 insertions(+)
>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 09/14] bsd-user: Implement exterrctl(2)
2026-09-20 5:20 ` [PATCH 09/14] bsd-user: Implement exterrctl(2) Warner Losh
@ 2026-09-21 18:34 ` Pierrick Bouvier
0 siblings, 0 replies; 32+ messages in thread
From: Pierrick Bouvier @ 2026-09-21 18:34 UTC (permalink / raw)
To: Warner Losh, qemu-devel; +Cc: Kyle Evans
On 9/19/2026 10:20 PM, Warner Losh wrote:
> Signed-off-by: Warner Losh <imp@bsdimp.com>
> ---
> bsd-user/freebsd/os-misc.h | 16 ++++++++++++++++
> bsd-user/freebsd/os-syscall.c | 6 ++++++
> 2 files changed, 22 insertions(+)
>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 10/14] bsd-user: Implement sigfastblock
2026-09-20 5:20 ` [PATCH 10/14] bsd-user: Implement sigfastblock Warner Losh
@ 2026-09-21 18:34 ` Pierrick Bouvier
0 siblings, 0 replies; 32+ messages in thread
From: Pierrick Bouvier @ 2026-09-21 18:34 UTC (permalink / raw)
To: Warner Losh, qemu-devel; +Cc: Kyle Evans
On 9/19/2026 10:20 PM, Warner Losh wrote:
> Signed-off-by: Warner Losh <imp@bsdimp.com>
> ---
> bsd-user/freebsd/os-syscall.c | 5 +++++
> bsd-user/freebsd/os-thread.h | 11 +++++++++++
> 2 files changed, 16 insertions(+)
>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 02/14] bsd-user: Drop support for FreeBSD 12
2026-09-20 5:20 ` [PATCH 02/14] bsd-user: Drop support for FreeBSD 12 Warner Losh
@ 2026-09-21 18:35 ` Pierrick Bouvier
0 siblings, 0 replies; 32+ messages in thread
From: Pierrick Bouvier @ 2026-09-21 18:35 UTC (permalink / raw)
To: Warner Losh, qemu-devel; +Cc: Kyle Evans
On 9/19/2026 10:20 PM, Warner Losh wrote:
> All supported branches have these, so we don't need ifdefs anymore.
>
> Signed-off-by: Warner Losh <imp@bsdimp.com>
> ---
> bsd-user/freebsd/target_os_user.h | 5 -----
> 1 file changed, 5 deletions(-)
>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
^ permalink raw reply [flat|nested] 32+ messages in thread
end of thread, other threads:[~2026-09-21 18:35 UTC | newest]
Thread overview: 32+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-20 5:20 [PATCH 00/14] bsd-user: Upstream a few fixes Warner Losh
2026-09-20 5:20 ` [PATCH 01/14] bsd-user: HOST_BIG_ENDIAN and TARGET_BIG_ENDIAN are always Warner Losh
2026-09-20 21:57 ` Richard Henderson
2026-09-20 5:20 ` [PATCH 02/14] bsd-user: Drop support for FreeBSD 12 Warner Losh
2026-09-21 18:35 ` Pierrick Bouvier
2026-09-20 5:20 ` [PATCH 03/14] bsd-user: Flag shared memory as needing atomics Warner Losh
2026-09-20 21:59 ` Richard Henderson
2026-09-20 5:20 ` [PATCH 04/14] bsd-user: Add gdb for system calls Warner Losh
2026-09-20 22:02 ` Richard Henderson
2026-09-21 10:06 ` Warner Losh
2026-09-20 5:20 ` [PATCH 05/14] bsd-user: Initialize per-arch child registers Warner Losh
2026-09-20 22:07 ` Richard Henderson
2026-09-20 5:20 ` [PATCH 06/14] bsd-user: Fix crazy bug with mmap Warner Losh
2026-09-20 22:09 ` Richard Henderson
2026-09-21 2:38 ` Warner Losh
2026-09-20 5:20 ` [PATCH 07/14] bsd-user: Move tb_flush stuff to begin_parallel_context Warner Losh
2026-09-20 22:11 ` Richard Henderson
2026-09-20 5:20 ` [PATCH 08/14] bsd-user: Fix MAP_TYPE definition Warner Losh
2026-09-20 22:12 ` Richard Henderson
2026-09-20 5:20 ` [PATCH 09/14] bsd-user: Implement exterrctl(2) Warner Losh
2026-09-21 18:34 ` Pierrick Bouvier
2026-09-20 5:20 ` [PATCH 10/14] bsd-user: Implement sigfastblock Warner Losh
2026-09-21 18:34 ` Pierrick Bouvier
2026-09-20 5:20 ` [PATCH 11/14] bsd-user: Eliminate unused regs arg in load_elf_binary Warner Losh
2026-09-20 22:14 ` Richard Henderson
2026-09-20 5:20 ` [PATCH 12/14] bsd-user: #ifdef sockopt that aren't in 14 Warner Losh
2026-09-21 18:32 ` Pierrick Bouvier
2026-09-20 5:20 ` [PATCH 13/14] bsd-user: Fix non-PIE binaries Warner Losh
2026-09-20 22:33 ` Richard Henderson
2026-09-21 1:06 ` Warner Losh
2026-09-20 5:20 ` [PATCH 14/14] bsd-user: Remove host-os.h Warner Losh
2026-09-20 22:34 ` Richard Henderson
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.