* [PULL 00/11] Bsd user 2026q3 patches
@ 2026-09-22 19:20 Warner Losh
2026-09-22 19:20 ` [PULL 01/11] bsd-user: HOST_BIG_ENDIAN and TARGET_BIG_ENDIAN are always Warner Losh
` (11 more replies)
0 siblings, 12 replies; 13+ messages in thread
From: Warner Losh @ 2026-09-22 19:20 UTC (permalink / raw)
To: qemu-devel; +Cc: Warner Losh, Kyle Evans
The following changes since commit 7074591d7954876951f84c15b994a43251d5a3c1:
Merge tag 'qom-qdev-20260922' of https://gitlab.com/mcayland-ntx/qemu into staging (2026-09-22 07:56:00 -0700)
are available in the Git repository at:
git@gitlab.com:bsdimp/qemu-from-official.git tags/bsd-user-2026q3-pull-request
for you to fetch changes up to c79adb04654bba3e505e5332b90b7ca2c639b044:
bsd-user: Remove host-os.h (2026-09-22 13:07:11 -0600)
----------------------------------------------------------------
bsd-user: misc fixes
Catch up with a number of trivial differences between master and blitz branch:
- HOST_BIG_ENDIAN and TARGET_BIG_ENDIAN are always defined
- Drop support for FreeBSD 12
- Flag shared memory as needing atomics
- Initialize per-arch child registers
- mmap fix for flags from long ago
- Move tb_flush stuff to begin_parallel_context
- Implement exterrctl(2)
- Implement sigfastblock
- Eliminate unused regs arg in load_elf_binary
- #ifdef sockopt that aren't in 14
- Remove host-os.h
-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - https://gpgtools.org
iQJPBAABCgA5FiEEIDX4lLAKo898zeG3bBzRKH2wEQAFAmqy1REbFIAAAAAABAAO
bWFudTIsMi41KzEuMTIsMiwzAAoJEGwc0Sh9sBEAQroQAJMmYV/REl8PlyGlqiD9
uNLEiXTkO8erWUA33LbNxvbWi9oltoOHpyEF9u1i45vKChyV6SszGt9P9ev5MHjJ
VEJTjeWnb0Nq/J+fS3cnxACJS234PEDOVcoVumj7/RyvLNO+lFdYv50ZsOpfEqYJ
Pgkl/V0uyyLx4U3pWm5prxud0rt1fQMrJXoX1gnlJt55BOjLRc6iqHzTm/PIsnnE
5VU7o+FWZXJo5jGNiaBsHJHdji6fX8VJc6Ot1m1rw4nFt0RhyrB6bCaPINLz3jjm
j9gBfZNLhRG1rSyQkLBKITOV3mGgKaGTE2FsMQg/zx8j3fDuX4iht5DRtCUQwKST
LQQOYD5WO/fFvFyoC8HVKV4+WHiaM2cyIRR1ANRR8aSRV7tFP4H4p8WdmsBKWJ+R
mws2GMC4DgkDfELKpB1oVmLnLOvMB0+hFYY3LIsXVd4ytxAuSYGf+M2OCnaVBLxv
Wlv51RaX8vIW4E3qSPOIAhbQxdptRHFGlpj9LYfArsf4nKbXCor5+sWHQfGuWAKY
2JvaZvV5c6pJBFn9gfX5Jpa6JukrfmXfmrbiDm2tYmWFo0YbSkpXnnBfC+WPZ1DV
H3SoA8uuJNKO/p5/jcdiIshCeo3U2QAQeHjPmR3Pj5iDR3ZE0aiQbc1WUcucyXqS
TWhd1Ob6d6T5N/J0xGqwRiKr
=xgLW
-----END PGP SIGNATURE-----
----------------------------------------------------------------
Rick Richard (1):
bsd-user: HOST_BIG_ENDIAN and TARGET_BIG_ENDIAN are always
Warner Losh (10):
bsd-user: Drop support for FreeBSD 12
bsd-user: Flag shared memory as needing atomics
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: 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 | 43 +++++------
bsd-user/bsd-mem.h | 8 ++
bsd-user/bsdload.c | 2 +-
bsd-user/elfload.c | 3 +-
bsd-user/freebsd/host-os.h | 25 ------
bsd-user/freebsd/os-misc.h | 121 +++++++++++++++++-------------
bsd-user/freebsd/os-sockopt.h | 2 +
bsd-user/freebsd/os-syscall.c | 11 +++
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 | 26 +++++--
bsd-user/qemu.h | 21 +++++-
bsd-user/syscall_defs.h | 9 ++-
15 files changed, 175 insertions(+), 125 deletions(-)
delete mode 100644 bsd-user/freebsd/host-os.h
--
2.55.0
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PULL 01/11] bsd-user: HOST_BIG_ENDIAN and TARGET_BIG_ENDIAN are always
2026-09-22 19:20 [PULL 00/11] Bsd user 2026q3 patches Warner Losh
@ 2026-09-22 19:20 ` Warner Losh
2026-09-22 19:21 ` [PULL 02/11] bsd-user: Drop support for FreeBSD 12 Warner Losh
` (10 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: Warner Losh @ 2026-09-22 19:20 UTC (permalink / raw)
To: qemu-devel; +Cc: Warner Losh, Kyle Evans, 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 and moved to C if() instead of ifdef ]
Reviewed-by: Warner Losh <imp@bsdimp.com>
Signed-off-by: Warner Losh <imp@bsdimp.com>
---
bsd-user/bsd-file.h | 43 +++++++-------
bsd-user/freebsd/os-misc.h | 105 +++++++++++++++++------------------
bsd-user/freebsd/os-thread.h | 2 +-
3 files changed, 74 insertions(+), 76 deletions(-)
diff --git a/bsd-user/bsd-file.h b/bsd-user/bsd-file.h
index 0fefc07232..5c32aa0396 100644
--- a/bsd-user/bsd-file.h
+++ b/bsd-user/bsd-file.h
@@ -973,30 +973,31 @@ static abi_long do_bsd_lseek(CPUArchState *env, abi_long arg1, abi_long arg2,
abi_long arg3, abi_long arg4, abi_long arg5)
{
abi_long ret;
-#if TARGET_ABI_BITS == 32
- int64_t res;
- /* 32-bit arch's use two 32 registers for 64 bit return value */
- if (regpairs_aligned(env) != 0) {
- res = lseek(arg1, target_arg64(arg3, arg4), arg5);
- } else {
- res = lseek(arg1, target_arg64(arg2, arg3), arg4);
- }
- if (res == -1) {
- ret = get_errno(res);
- set_second_rval(env, 0xFFFFFFFF);
+ if (TARGET_ABI_BITS == 32) {
+ /* 32-bit arch's use two 32 registers for 64 bit return value */
+ int64_t res;
+
+ if (regpairs_aligned(env) != 0) {
+ res = lseek(arg1, target_arg64(arg3, arg4), arg5);
+ } else {
+ res = lseek(arg1, target_arg64(arg2, arg3), arg4);
+ }
+ if (res == -1) {
+ ret = get_errno(res);
+ set_second_rval(env, 0xFFFFFFFF);
+ } else {
+ if (TARGET_BIG_ENDIAN) {
+ ret = ((res >> 32) & 0xFFFFFFFF);
+ set_second_rval(env, res & 0xFFFFFFFF);
+ } else {
+ ret = res & 0xFFFFFFFF;
+ set_second_rval(env, (res >> 32) & 0xFFFFFFFF);
+ }
+ }
} else {
-#ifdef TARGET_BIG_ENDIAN
- ret = ((res >> 32) & 0xFFFFFFFF);
- set_second_rval(env, res & 0xFFFFFFFF);
-#else
- ret = res & 0xFFFFFFFF;
- set_second_rval(env, (res >> 32) & 0xFFFFFFFF);
-#endif
+ ret = get_errno(lseek(arg1, arg2, arg3));
}
-#else
- ret = get_errno(lseek(arg1, arg2, arg3));
-#endif
return ret;
}
diff --git a/bsd-user/freebsd/os-misc.h b/bsd-user/freebsd/os-misc.h
index 0f87b21cc8..be549c4bd9 100644
--- a/bsd-user/freebsd/os-misc.h
+++ b/bsd-user/freebsd/os-misc.h
@@ -106,19 +106,19 @@ static inline abi_long do_freebsd_cpuset_setid(CPUArchState *env, abi_long arg1,
cpuwhich_t which;
target_to_host_cpuset_which(&which, arg1);
-#if TARGET_ABI_BITS == 32
- /* See if we need to align the register pairs */
- if (regpairs_aligned(env)) {
- id = target_arg64(arg3, arg4);
- setid = arg5;
+ if (TARGET_ABI_BITS == 32) {
+ /* See if we need to align the register pairs */
+ if (regpairs_aligned(env)) {
+ id = target_arg64(arg3, arg4);
+ setid = arg5;
+ } else {
+ id = target_arg64(arg2, arg3);
+ setid = arg4;
+ }
} else {
- id = target_arg64(arg2, arg3);
- setid = arg4;
+ id = arg2;
+ setid = arg3;
}
-#else
- id = arg2;
- setid = arg3;
-#endif
return get_errno(cpuset_setid(which, id, setid));
}
@@ -135,13 +135,13 @@ static inline abi_long do_freebsd_cpuset_getid(abi_long arg1, abi_ulong arg2,
target_to_host_cpuset_which(&which, arg1);
target_to_host_cpuset_level(&level, arg2);
-#if TARGET_ABI_BITS == 32
- id = target_arg64(arg3, arg4);
- target_setid = arg5;
-#else
- id = arg3;
- target_setid = arg4;
-#endif
+ if (TARGET_ABI_BITS == 32) {
+ id = target_arg64(arg3, arg4);
+ target_setid = arg5;
+ } else {
+ id = arg3;
+ target_setid = arg4;
+ }
ret = get_errno(cpuset_getid(level, which, id, &setid));
if (is_error(ret)) {
return ret;
@@ -212,15 +212,15 @@ static inline abi_long do_freebsd_cpuset_getaffinity(cpulevel_t level,
id_t id; /* 64-bit */
abi_ulong setsize, target_mask;
-#if TARGET_ABI_BITS == 32
- id = (id_t)target_arg64(arg3, arg4);
- setsize = arg5;
- target_mask = arg6;
-#else
- id = (id_t)arg3;
- setsize = arg4;
- target_mask = arg5;
-#endif
+ if (TARGET_ABI_BITS == 32) {
+ id = (id_t)target_arg64(arg3, arg4);
+ setsize = arg5;
+ target_mask = arg6;
+ } else {
+ id = (id_t)arg3;
+ setsize = arg4;
+ target_mask = arg5;
+ }
ret = get_errno(cpuset_getaffinity(level, which, id, setsize, &mask));
if (ret == 0) {
@@ -241,15 +241,15 @@ static inline abi_long do_freebsd_cpuset_setaffinity(cpulevel_t level,
id_t id; /* 64-bit */
abi_ulong setsize, target_mask;
-#if TARGET_ABI_BITS == 32
- id = (id_t)target_arg64(arg3, arg4);
- setsize = arg5;
- target_mask = arg6;
-#else
- id = (id_t)arg3;
- setsize = arg4;
- target_mask = arg5;
-#endif
+ if (TARGET_ABI_BITS == 32) {
+ id = (id_t)target_arg64(arg3, arg4);
+ setsize = arg5;
+ target_mask = arg6;
+ } else {
+ id = (id_t)arg3;
+ setsize = arg4;
+ target_mask = arg5;
+ }
ret = copy_from_user_cpuset_mask(&mask, target_mask);
if (ret == 0) {
@@ -333,33 +333,30 @@ static inline abi_long do_freebsd_kldsym(abi_long fileid, abi_long cmd,
* New posix calls
*/
-#if TARGET_ABI_BITS == 32
-static inline uint64_t target_offset64(uint32_t word0, uint32_t word1)
-{
-#ifdef TARGET_BIG_ENDIAN
- return ((uint64_t)word0 << 32) | word1;
-#else
- return ((uint64_t)word1 << 32) | word0;
-#endif
-}
-#else /* TARGET_ABI_BITS == 32 */
static inline uint64_t target_offset64(uint64_t word0, uint64_t word1)
{
- return word0;
+ if (TARGET_ABI_BITS == 32) {
+ if (TARGET_BIG_ENDIAN) {
+ return ((uint64_t)word0 << 32) | word1;
+ } else {
+ return ((uint64_t)word1 << 32) | word0;
+ }
+ } else {
+ return word0;
+ }
}
-#endif /* TARGET_ABI_BITS != 32 */
/* posix_fallocate(2) */
static inline abi_long do_freebsd_posix_fallocate(abi_long arg1, abi_long arg2,
abi_long arg3, abi_long arg4, abi_long arg5, abi_long arg6)
{
-#if TARGET_ABI_BITS == 32
- return get_errno(posix_fallocate(arg1, target_offset64(arg3, arg4),
- target_offset64(arg5, arg6)));
-#else
- return get_errno(posix_fallocate(arg1, arg2, arg3));
-#endif
+ if (TARGET_ABI_BITS == 32) {
+ return get_errno(posix_fallocate(arg1, target_offset64(arg3, arg4),
+ target_offset64(arg5, arg6)));
+ } else {
+ return get_errno(posix_fallocate(arg1, arg2, arg3));
+ }
}
/* posix_openpt(2) */
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] 13+ messages in thread
* [PULL 02/11] bsd-user: Drop support for FreeBSD 12
2026-09-22 19:20 [PULL 00/11] Bsd user 2026q3 patches Warner Losh
2026-09-22 19:20 ` [PULL 01/11] bsd-user: HOST_BIG_ENDIAN and TARGET_BIG_ENDIAN are always Warner Losh
@ 2026-09-22 19:21 ` Warner Losh
2026-09-22 19:21 ` [PULL 03/11] bsd-user: Flag shared memory as needing atomics Warner Losh
` (9 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: Warner Losh @ 2026-09-22 19:21 UTC (permalink / raw)
To: qemu-devel; +Cc: Warner Losh, Kyle Evans, Pierrick Bouvier
All supported branches have these, so we don't need ifdefs anymore.
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
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] 13+ messages in thread
* [PULL 03/11] bsd-user: Flag shared memory as needing atomics
2026-09-22 19:20 [PULL 00/11] Bsd user 2026q3 patches Warner Losh
2026-09-22 19:20 ` [PULL 01/11] bsd-user: HOST_BIG_ENDIAN and TARGET_BIG_ENDIAN are always Warner Losh
2026-09-22 19:21 ` [PULL 02/11] bsd-user: Drop support for FreeBSD 12 Warner Losh
@ 2026-09-22 19:21 ` Warner Losh
2026-09-22 19:21 ` [PULL 04/11] bsd-user: Initialize per-arch child registers Warner Losh
` (8 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: Warner Losh @ 2026-09-22 19:21 UTC (permalink / raw)
To: qemu-devel; +Cc: Warner Losh, Kyle Evans, Richard Henderson
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.
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
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] 13+ messages in thread
* [PULL 04/11] bsd-user: Initialize per-arch child registers
2026-09-22 19:20 [PULL 00/11] Bsd user 2026q3 patches Warner Losh
` (2 preceding siblings ...)
2026-09-22 19:21 ` [PULL 03/11] bsd-user: Flag shared memory as needing atomics Warner Losh
@ 2026-09-22 19:21 ` Warner Losh
2026-09-22 19:21 ` [PULL 05/11] bsd-user: Fix crazy bug with mmap Warner Losh
` (7 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: Warner Losh @ 2026-09-22 19:21 UTC (permalink / raw)
To: qemu-devel; +Cc: Warner Losh, Kyle Evans, Richard Henderson
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
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] 13+ messages in thread
* [PULL 05/11] bsd-user: Fix crazy bug with mmap
2026-09-22 19:20 [PULL 00/11] Bsd user 2026q3 patches Warner Losh
` (3 preceding siblings ...)
2026-09-22 19:21 ` [PULL 04/11] bsd-user: Initialize per-arch child registers Warner Losh
@ 2026-09-22 19:21 ` Warner Losh
2026-09-22 19:21 ` [PULL 06/11] bsd-user: Move tb_flush stuff to begin_parallel_context Warner Losh
` (6 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: Warner Losh @ 2026-09-22 19:21 UTC (permalink / raw)
To: qemu-devel; +Cc: Warner Losh, Kyle Evans, Richard Henderson
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....
Also fix MAP_TYPE definition. 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.
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Warner Losh <imp@bsdimp.com>
---
bsd-user/mmap.c | 17 +++++++++++------
bsd-user/syscall_defs.h | 9 ++++++++-
2 files changed, 19 insertions(+), 7 deletions(-)
diff --git a/bsd-user/mmap.c b/bsd-user/mmap.c
index 548b4824df..5068e5c3b7 100644
--- a/bsd-user/mmap.c
+++ b/bsd-user/mmap.c
@@ -215,11 +215,15 @@ 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 */
if (!(prot1 & PROT_WRITE))
@@ -586,8 +590,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..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 TARGET_BSD_MAP_FLAGMASK 0x3ff7
+/*
+ * 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] 13+ messages in thread
* [PULL 06/11] bsd-user: Move tb_flush stuff to begin_parallel_context
2026-09-22 19:20 [PULL 00/11] Bsd user 2026q3 patches Warner Losh
` (4 preceding siblings ...)
2026-09-22 19:21 ` [PULL 05/11] bsd-user: Fix crazy bug with mmap Warner Losh
@ 2026-09-22 19:21 ` Warner Losh
2026-09-22 19:21 ` [PULL 07/11] bsd-user: Implement exterrctl(2) Warner Losh
` (5 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: Warner Losh @ 2026-09-22 19:21 UTC (permalink / raw)
To: qemu-devel; +Cc: Warner Losh, Kyle Evans, Richard Henderson
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.
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
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] 13+ messages in thread
* [PULL 07/11] bsd-user: Implement exterrctl(2)
2026-09-22 19:20 [PULL 00/11] Bsd user 2026q3 patches Warner Losh
` (5 preceding siblings ...)
2026-09-22 19:21 ` [PULL 06/11] bsd-user: Move tb_flush stuff to begin_parallel_context Warner Losh
@ 2026-09-22 19:21 ` Warner Losh
2026-09-22 19:21 ` [PULL 08/11] bsd-user: Implement sigfastblock Warner Losh
` (4 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: Warner Losh @ 2026-09-22 19:21 UTC (permalink / raw)
To: qemu-devel; +Cc: Warner Losh, Kyle Evans, Pierrick Bouvier
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
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 be549c4bd9..fa40261da3 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>
@@ -538,4 +541,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 7e400c89bc..e87924fbb5 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] 13+ messages in thread
* [PULL 08/11] bsd-user: Implement sigfastblock
2026-09-22 19:20 [PULL 00/11] Bsd user 2026q3 patches Warner Losh
` (6 preceding siblings ...)
2026-09-22 19:21 ` [PULL 07/11] bsd-user: Implement exterrctl(2) Warner Losh
@ 2026-09-22 19:21 ` Warner Losh
2026-09-22 19:21 ` [PULL 09/11] bsd-user: Eliminate unused regs arg in load_elf_binary Warner Losh
` (3 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: Warner Losh @ 2026-09-22 19:21 UTC (permalink / raw)
To: qemu-devel; +Cc: Warner Losh, Kyle Evans, Pierrick Bouvier
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
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 e87924fbb5..b5178f298e 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] 13+ messages in thread
* [PULL 09/11] bsd-user: Eliminate unused regs arg in load_elf_binary
2026-09-22 19:20 [PULL 00/11] Bsd user 2026q3 patches Warner Losh
` (7 preceding siblings ...)
2026-09-22 19:21 ` [PULL 08/11] bsd-user: Implement sigfastblock Warner Losh
@ 2026-09-22 19:21 ` Warner Losh
2026-09-22 19:21 ` [PULL 10/11] bsd-user: #ifdef sockopt that aren't in 14 Warner Losh
` (2 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: Warner Losh @ 2026-09-22 19:21 UTC (permalink / raw)
To: qemu-devel; +Cc: Warner Losh, Kyle Evans, Richard Henderson
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
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] 13+ messages in thread
* [PULL 10/11] bsd-user: #ifdef sockopt that aren't in 14
2026-09-22 19:20 [PULL 00/11] Bsd user 2026q3 patches Warner Losh
` (8 preceding siblings ...)
2026-09-22 19:21 ` [PULL 09/11] bsd-user: Eliminate unused regs arg in load_elf_binary Warner Losh
@ 2026-09-22 19:21 ` Warner Losh
2026-09-22 19:21 ` [PULL 11/11] bsd-user: Remove host-os.h Warner Losh
2026-09-23 19:44 ` [PULL 00/11] Bsd user 2026q3 patches Richard Henderson
11 siblings, 0 replies; 13+ messages in thread
From: Warner Losh @ 2026-09-22 19:21 UTC (permalink / raw)
To: qemu-devel; +Cc: Warner Losh, Kyle Evans, Pierrick Bouvier
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
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] 13+ messages in thread
* [PULL 11/11] bsd-user: Remove host-os.h
2026-09-22 19:20 [PULL 00/11] Bsd user 2026q3 patches Warner Losh
` (9 preceding siblings ...)
2026-09-22 19:21 ` [PULL 10/11] bsd-user: #ifdef sockopt that aren't in 14 Warner Losh
@ 2026-09-22 19:21 ` Warner Losh
2026-09-23 19:44 ` [PULL 00/11] Bsd user 2026q3 patches Richard Henderson
11 siblings, 0 replies; 13+ messages in thread
From: Warner Losh @ 2026-09-22 19:21 UTC (permalink / raw)
To: qemu-devel; +Cc: Warner Losh, Kyle Evans, Richard Henderson
host-os.h was used to just set the default bsd flavor, but it's no
longer used. Retire it.
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
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(-)
delete mode 100644 bsd-user/freebsd/host-os.h
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] 13+ messages in thread
* Re: [PULL 00/11] Bsd user 2026q3 patches
2026-09-22 19:20 [PULL 00/11] Bsd user 2026q3 patches Warner Losh
` (10 preceding siblings ...)
2026-09-22 19:21 ` [PULL 11/11] bsd-user: Remove host-os.h Warner Losh
@ 2026-09-23 19:44 ` Richard Henderson
11 siblings, 0 replies; 13+ messages in thread
From: Richard Henderson @ 2026-09-23 19:44 UTC (permalink / raw)
To: Warner Losh, qemu-devel; +Cc: Kyle Evans
On 9/22/26 12:20, Warner Losh wrote:
> The following changes since commit 7074591d7954876951f84c15b994a43251d5a3c1:
>
> Merge tag 'qom-qdev-20260922' ofhttps://gitlab.com/mcayland-ntx/qemu into staging (2026-09-22 07:56:00 -0700)
>
> are available in the Git repository at:
>
> git@gitlab.com:bsdimp/qemu-from-official.git tags/bsd-user-2026q3-pull-request
>
> for you to fetch changes up to c79adb04654bba3e505e5332b90b7ca2c639b044:
>
> bsd-user: Remove host-os.h (2026-09-22 13:07:11 -0600)
>
> ----------------------------------------------------------------
> bsd-user: misc fixes
>
> Catch up with a number of trivial differences between master and blitz branch:
>
> - HOST_BIG_ENDIAN and TARGET_BIG_ENDIAN are always defined
> - Drop support for FreeBSD 12
> - Flag shared memory as needing atomics
> - Initialize per-arch child registers
> - mmap fix for flags from long ago
> - Move tb_flush stuff to begin_parallel_context
> - Implement exterrctl(2)
> - Implement sigfastblock
> - Eliminate unused regs arg in load_elf_binary
> - #ifdef sockopt that aren't in 14
> - Remove host-os.h
Applied, thanks.
r~
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2026-09-23 19:44 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-22 19:20 [PULL 00/11] Bsd user 2026q3 patches Warner Losh
2026-09-22 19:20 ` [PULL 01/11] bsd-user: HOST_BIG_ENDIAN and TARGET_BIG_ENDIAN are always Warner Losh
2026-09-22 19:21 ` [PULL 02/11] bsd-user: Drop support for FreeBSD 12 Warner Losh
2026-09-22 19:21 ` [PULL 03/11] bsd-user: Flag shared memory as needing atomics Warner Losh
2026-09-22 19:21 ` [PULL 04/11] bsd-user: Initialize per-arch child registers Warner Losh
2026-09-22 19:21 ` [PULL 05/11] bsd-user: Fix crazy bug with mmap Warner Losh
2026-09-22 19:21 ` [PULL 06/11] bsd-user: Move tb_flush stuff to begin_parallel_context Warner Losh
2026-09-22 19:21 ` [PULL 07/11] bsd-user: Implement exterrctl(2) Warner Losh
2026-09-22 19:21 ` [PULL 08/11] bsd-user: Implement sigfastblock Warner Losh
2026-09-22 19:21 ` [PULL 09/11] bsd-user: Eliminate unused regs arg in load_elf_binary Warner Losh
2026-09-22 19:21 ` [PULL 10/11] bsd-user: #ifdef sockopt that aren't in 14 Warner Losh
2026-09-22 19:21 ` [PULL 11/11] bsd-user: Remove host-os.h Warner Losh
2026-09-23 19:44 ` [PULL 00/11] Bsd user 2026q3 patches 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.