architecture: 0.862 device: 0.833 semantic: 0.790 socket: 0.714 vnc: 0.686 ppc: 0.684 network: 0.639 files: 0.621 debug: 0.613 kernel: 0.605 arm: 0.599 graphic: 0.599 user-level: 0.585 hypervisor: 0.560 PID: 0.552 performance: 0.550 x86: 0.544 risc-v: 0.535 register: 0.483 i386: 0.480 permissions: 0.467 VMM: 0.464 boot: 0.456 TCG: 0.446 virtual: 0.418 KVM: 0.378 peripherals: 0.363 assembly: 0.257 mistranslation: 0.218 -------------------- user-level: 0.993 debug: 0.719 TCG: 0.308 virtual: 0.190 PID: 0.087 architecture: 0.084 semantic: 0.067 register: 0.050 files: 0.034 network: 0.027 performance: 0.016 kernel: 0.012 hypervisor: 0.010 device: 0.009 VMM: 0.009 vnc: 0.005 peripherals: 0.005 assembly: 0.004 risc-v: 0.004 permissions: 0.004 boot: 0.003 socket: 0.003 graphic: 0.003 x86: 0.002 KVM: 0.001 arm: 0.001 ppc: 0.001 i386: 0.001 mistranslation: 0.001 Limited Support for MIPS clone syscall in QEMU User Mode Description of problem: Hello, I have been working with QEMU user mode to run programs based on the MIPS architecture and have encountered a limitation regarding the support for the MIPS clone syscall in the current implementation of QEMU user mode. Specifically, when invoking the clone syscall with certain flags, it results in the error "errno=22 (Invalid argument)" due to the absence of corresponding handling code in QEMU. Upon further investigation, I pinpointed the probable cause. QEMU user mode appears to check if the flags for the clone syscall include all the flags defined in CLONE_THREAD_FLAGS. If there is a mismatch, it returns "-TARGET_EINVAL". [source code](https://gitlab.com/qemu-project/qemu/-/blob/master/linux-user/syscall.c?ref_type=heads#L6564) The current CLONE_THREAD_FLAGS in QEMU are set to include: (CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND | CLONE_THREAD | CLONE_SYSVSEM). However, in my MIPS program, the flags are only: (CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND). Aligning my MIPS program to include all the flags as per CLONE_THREAD_FLAGS alters the clone syscall's behavior, deviating from the original semantics required by my MIPS program. I am seeking guidance on whether there is a way in QEMU user mode's MIPS syscall handling to exclusively use the flags (CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND). Alternatively, I am interested in any possible approach to enable support for the MIPS architecture's clone syscall in QEMU user mode. Thank you for your time and assistance. Steps to reproduce: 1. Write a C program that utilizes the clone function, specifying the flags as: CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND. strace output: ``` clone(CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND,child_stack=0x009359a8,parent_tidptr=0x00000f00,tls=0x00000003,child_tidptr=0x2b36d510) = -1 errno=22 (Invalid argument) ```