[PATCH v3 0/2] linux-user: implement fsmount(2) series of syscalls

Xinhui Yang posted 2 patches 1 month, 2 weeks ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/cover.1780036891.git.cyan@cyano.uk
Maintainers: Laurent Vivier <laurent@vivier.eu>, Helge Deller <deller@gmx.de>, Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
linux-user/strace.c    | 105 +++++++++++++++++++++++++++++++++++++++++
linux-user/strace.list |  15 ++++++
linux-user/syscall.c   |  91 +++++++++++++++++++++++++++++++++++
3 files changed, 211 insertions(+)
[PATCH v3 0/2] linux-user: implement fsmount(2) series of syscalls
Posted by Xinhui Yang 1 month, 2 weeks ago
The motivation of the implementation is to allow any foreign guest OSes
with systemd v259+ to boot using systemd-nspawn(1), otherwise any
systemd service requiring importing credentials will fail, including
journald, D-Bus service and getty. We used to work around this issue by
patching systemd to retry the clone() without CLONE_NEWNS, which is not
and can not be implemented in QEMU user emulation.

mount(8) from util-linux worked prior to this patch because it will
fallback to the old mount(2) syscall if fsmount(8) series of syscalls
is not available.

Tested good on an x86-64 host, with:

- an AOSC OS mips64r6el guest, which boots successfully with full systemd
  support using systemd-nspawn(1).
- a Gentoo ppc (big endian) guest, which boots successfully with full
  systemd support, using systemd-nspawn(1).

Changes from v2:

* Apply the review from Pierrick Bouvier[1], making sure that the buffer
  is unlocked before returning error in the fsconfig handler.
* Clearify some comments in syscall.c.

Changes from v1:

* Add missing guard for FSCONFIG_CMD_CREATE_EXCL in strace.c, since it is
  only available since 6.6.
* Fix some wording issues in the cover letter.

[1]: https://lists.nongnu.org/archive/html/qemu-devel/2026-05/msg07794.html

Xinhui Yang (2):
  linux-user: implement fsmount(2) series of syscalls
  linux-user/strace: add fsmount series of syscalls

 linux-user/strace.c    | 105 +++++++++++++++++++++++++++++++++++++++++
 linux-user/strace.list |  15 ++++++
 linux-user/syscall.c   |  91 +++++++++++++++++++++++++++++++++++
 3 files changed, 211 insertions(+)

-- 
2.52.0
Re: [PATCH v3 0/2] linux-user: implement fsmount(2) series of syscalls
Posted by Helge Deller 1 month, 1 week ago
On 5/29/26 08:53, Xinhui Yang wrote:
> The motivation of the implementation is to allow any foreign guest OSes
> with systemd v259+ to boot using systemd-nspawn(1), otherwise any
> systemd service requiring importing credentials will fail, including
> journald, D-Bus service and getty. We used to work around this issue by
> patching systemd to retry the clone() without CLONE_NEWNS, which is not
> and can not be implemented in QEMU user emulation.
> 
> mount(8) from util-linux worked prior to this patch because it will
> fallback to the old mount(2) syscall if fsmount(8) series of syscalls
> is not available.
> 
> Tested good on an x86-64 host, with:
> 
> - an AOSC OS mips64r6el guest, which boots successfully with full systemd
>    support using systemd-nspawn(1).
> - a Gentoo ppc (big endian) guest, which boots successfully with full
>    systemd support, using systemd-nspawn(1).
> 
> Changes from v2:
> 
> * Apply the review from Pierrick Bouvier[1], making sure that the buffer
>    is unlocked before returning error in the fsconfig handler.
> * Clearify some comments in syscall.c.
> 
> Changes from v1:
> 
> * Add missing guard for FSCONFIG_CMD_CREATE_EXCL in strace.c, since it is
>    only available since 6.6.
> * Fix some wording issues in the cover letter.
> 
> [1]: https://lists.nongnu.org/archive/html/qemu-devel/2026-05/msg07794.html
> 
> Xinhui Yang (2):
>    linux-user: implement fsmount(2) series of syscalls
>    linux-user/strace: add fsmount series of syscalls
> 
>   linux-user/strace.c    | 105 +++++++++++++++++++++++++++++++++++++++++
>   linux-user/strace.list |  15 ++++++
>   linux-user/syscall.c   |  91 +++++++++++++++++++++++++++++++++++
>   3 files changed, 211 insertions(+)

series applied to the linux-user-next git tree.

Thanks!
Helge