qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Balint Reczey <rbalint@gmail.com>
Cc: Warner Losh <imp@bsdimp.com>, Kyle Evans <kevans@freebsd.org>,
	Riku Voipio <riku.voipio@iki.fi>,
	Laurent Vivier <laurent@vivier.eu>
Subject: [PATCH 0/1] user: add runtime switch to call safe_syscall via libc
Date: Tue, 4 Nov 2025 14:54:23 +0100	[thread overview]
Message-ID: <cddc5c730b912a058b54100b19adf552.rbalint@gmail.com> (raw)

Hi,

qemu-user implements calling signal-race-safe syscalls for the guest
in assembly directly to the kernel instead of going through the host's libc.

The proposed patch adds a switch to go through libc, which allows interposition
of libc's syscall(), even when the guest program is statically linked.

The motivation behind the change is intercepting statically linked binaries [1]
with firebuild [2], a build accelerator implemented in userspace.

I have tested the Linux changes, but not not BSD ones.
I think they are trivial enough to work and I'd like to port firebuild
to BSD, too, in the future.

Cheers,
Balint

[1] https://github.com/firebuild/firebuild/pull/1334
[2] https://github.com/firebuild/firebuild

Balint Reczey (1):
  user: add runtime switch to call safe_syscall via libc

 bsd-user/main.c             | 11 +++++++
 common-user/meson.build     |  1 +
 common-user/safe-syscall.c  | 57 +++++++++++++++++++++++++++++++++++++
 docs/user/main.rst          | 28 ++++++++++++++++--
 include/user/safe-syscall.h | 25 +++++++++++-----
 linux-user/main.c           |  9 ++++++
 6 files changed, 122 insertions(+), 9 deletions(-)
 create mode 100644 common-user/safe-syscall.c

-- 
2.43.0



             reply	other threads:[~2025-11-04 23:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-04 13:54 Balint Reczey [this message]
  -- strict thread matches above, loose matches on Subject: below --
2025-11-04 13:54 [PATCH 0/1] user: add runtime switch to call safe_syscall via libc Balint Reczey via

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=cddc5c730b912a058b54100b19adf552.rbalint@gmail.com \
    --to=rbalint@gmail.com \
    --cc=imp@bsdimp.com \
    --cc=kevans@freebsd.org \
    --cc=laurent@vivier.eu \
    --cc=riku.voipio@iki.fi \
    /path/to/YOUR_REPLY

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

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