From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Warner Losh <imp@bsdimp.com>
Cc: qemu-devel@nongnu.org, "Kyle Evans" <kevans@freebsd.org>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Marc-André Lureau" <marcandre.lureau@redhat.com>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: Re: [PATCH 3/5] bsd-user: Conditionally use old system calls
Date: Tue, 14 Apr 2026 09:13:37 +0100 [thread overview]
Message-ID: <ad33MUkefoZY1X44@redhat.com> (raw)
In-Reply-To: <20260413-syscall-nr-v1-3-f70408d042ea@bsdimp.com>
On Mon, Apr 13, 2026 at 09:31:45AM -0600, Warner Losh wrote:
> sbrk and sstk have been deprecated in FreeBSD for a while now, only
> support them if the version of FreeBSD we're compiling on does. They've
> returned not supported for a while anyway, so no net change.
What versions of FreeBSD still have these syscalls ?
Per out policy we only aim to support the 2 most recent major
versions of distros:
https://www.qemu.org/docs/master/about/build-platforms.html
So for FreeBSD that means 14.x and 15.x series are all that you
need to retain code support for. Any code for older versions
can be entirely dropped at any convenient time.
>
> Signed-off-by: Warner Losh <imp@bsdimp.com>
> ---
> bsd-user/bsd-mem.h | 2 ++
> bsd-user/freebsd/os-syscall.c | 4 ++++
> bsd-user/freebsd/strace.list | 4 ++++
> 3 files changed, 10 insertions(+)
>
> diff --git a/bsd-user/bsd-mem.h b/bsd-user/bsd-mem.h
> index a118e57260..a20b703053 100644
> --- a/bsd-user/bsd-mem.h
> +++ b/bsd-user/bsd-mem.h
> @@ -440,6 +440,7 @@ static inline abi_long do_bsd_vadvise(void)
> return -TARGET_EINVAL;
> }
>
> +#ifdef TARGET_FREEBSD_NR_sbrk
> static inline abi_long do_bsd_sbrk(void)
> {
> /* see sys_sbrk() in vm_mmap.c */
> @@ -451,5 +452,6 @@ static inline abi_long do_bsd_sstk(void)
> /* see sys_sstk() in vm_mmap.c */
> return -TARGET_EOPNOTSUPP;
> }
> +#endif
>
> #endif /* BSD_USER_BSD_MEM_H */
> diff --git a/bsd-user/freebsd/os-syscall.c b/bsd-user/freebsd/os-syscall.c
> index 85e5db19a3..ff6cbfc481 100644
> --- a/bsd-user/freebsd/os-syscall.c
> +++ b/bsd-user/freebsd/os-syscall.c
> @@ -918,13 +918,17 @@ static abi_long freebsd_syscall(void *cpu_env, int num, abi_long arg1,
> ret = do_bsd_vadvise();
> break;
>
> +#ifdef TARGET_FREEBSD_NR_sbrk
> case TARGET_FREEBSD_NR_sbrk:
> ret = do_bsd_sbrk();
> break;
> +#endif
>
> +#ifdef TARGET_FREEBSD_NR_sstk
> case TARGET_FREEBSD_NR_sstk:
> ret = do_bsd_sstk();
> break;
> +#endif
>
> /*
> * Misc
> diff --git a/bsd-user/freebsd/strace.list b/bsd-user/freebsd/strace.list
> index 275d2dbe27..d7f61f480e 100644
> --- a/bsd-user/freebsd/strace.list
> +++ b/bsd-user/freebsd/strace.list
> @@ -194,7 +194,9 @@
> { TARGET_FREEBSD_NR_rfork, "rfork", NULL, NULL, NULL },
> { TARGET_FREEBSD_NR_rmdir, "rmdir", NULL, NULL, NULL },
> { TARGET_FREEBSD_NR_rtprio_thread, "rtprio_thread", "%s(%d, %d, %p)", NULL, NULL },
> +#ifdef TARGET_FREEBSD_NR_sbrk
> { TARGET_FREEBSD_NR_sbrk, "sbrk", NULL, NULL, NULL },
> +#endif
> { TARGET_FREEBSD_NR_sched_get_priority_max, "sched_get_priority_max", NULL, NULL, NULL },
> { TARGET_FREEBSD_NR_sched_get_priority_min, "sched_get_priority_min", NULL, NULL, NULL },
> { TARGET_FREEBSD_NR_sched_yield, "sched_yield", NULL, NULL, NULL },
> @@ -234,7 +236,9 @@
> { TARGET_FREEBSD_NR_sigsuspend, "sigsuspend", NULL, NULL, NULL },
> { TARGET_FREEBSD_NR_socket, "socket", "%s(%d,%d,%d)", NULL, NULL },
> { TARGET_FREEBSD_NR_socketpair, "socketpair", NULL, NULL, NULL },
> +#ifdef TARGET_FREEBSD_NR_sstk
> { TARGET_FREEBSD_NR_sstk, "sstk", NULL, NULL, NULL },
> +#endif
> { TARGET_FREEBSD_NR_freebsd11_stat, "freebsd11_stat", "%s(\"%s\",%p)", NULL, NULL },
> { TARGET_FREEBSD_NR_freebsd11_statfs, "freebsd11_statfs", "%s(\"%s\",%p)", NULL, NULL },
> { TARGET_FREEBSD_NR_symlink, "symlink", "%s(\"%s\",\"%s\")", NULL, NULL },
>
> --
> 2.52.0
>
With regards,
Daniel
--
|: https://berrange.com ~~ https://hachyderm.io/@berrange :|
|: https://libvirt.org ~~ https://entangle-photo.org :|
|: https://pixelfed.art/berrange ~~ https://fstop138.berrange.com :|
next prev parent reply other threads:[~2026-04-14 8:16 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-13 15:31 [PATCH 0/5] bsd-user: Generate system call numbers Warner Losh
2026-04-13 15:31 ` [PATCH 1/5] bsd-user: Add syscall header generator for FreeBSD Warner Losh
2026-04-13 22:20 ` Philippe Mathieu-Daudé
2026-04-14 2:44 ` Warner Losh
2026-04-14 9:16 ` Philippe Mathieu-Daudé
2026-04-13 15:31 ` [PATCH 2/5] bsd-user: Generate the system call numbers in meson build Warner Losh
2026-04-13 22:22 ` Philippe Mathieu-Daudé
2026-04-13 15:31 ` [PATCH 3/5] bsd-user: Conditionally use old system calls Warner Losh
2026-04-13 22:12 ` Philippe Mathieu-Daudé
2026-04-14 8:13 ` Daniel P. Berrangé [this message]
2026-04-14 13:56 ` Warner Losh
2026-04-13 15:31 ` [PATCH 4/5] bsd-user: Create os-syscall.h Warner Losh
2026-04-13 15:31 ` [PATCH 5/5] bsd-user: Switch to generated syscall_nr.h Warner Losh
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ad33MUkefoZY1X44@redhat.com \
--to=berrange@redhat.com \
--cc=imp@bsdimp.com \
--cc=kevans@freebsd.org \
--cc=marcandre.lureau@redhat.com \
--cc=pbonzini@redhat.com \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is 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.