summaryrefslogtreecommitdiffstats
path: root/common-user
Commit message (Collapse)AuthorAgeFilesLines
* common-user: Only compile the common user code if have_user is setThomas Huth2022-06-281-0/+4
| | | | | | | | | | | | | | There is no need to waste cycles here if we only compile the system binaries or tools. Additionally, this change is even a hard requirement for building the tools on systems that do not have an entry in the common-user/host/ folder (since common-user/meson.build is trying to add such a path via the include_directories() command). Reported-by: Michael Tokarev <mjt@tls.msk.ru> Signed-off-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Zhang Chen <chen.zhang@intel.com> Message-Id: <20220622140328.383961-1-thuth@redhat.com> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
* common-user/host/sparc64: Fix safe_syscall_baseRichard Henderson2022-02-081-2/+3
| | | | | | | | | | | Use the "retl" instead of "ret" instruction alias, since we do not allocate a register window in this function. Fix the offset to the first stacked parameter, which lies beyond the register window save area. Fixes: 95c021dac835 ("linux-user/host/sparc64: Add safe-syscall.inc.S") Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
* meson: cleanup common-user/ buildPaolo Bonzini2022-01-121-1/+1
| | | | | | | | | | | | | | | | | It is not necessary to have a separate static_library just for common_user files; using the one that already covers the rest of common_ss is enough unless you need to reuse some source files between emulators and tests. Just place common files for all user-mode emulators in common_ss, similar to what is already done for softmmu_ss in full system emulators. The only disadvantage is that the include_directories under bsd-user/include/ and linux-user/include/ are now enabled for all targets rather than only user mode emulators. This however is not different from how include/sysemu/ is available when building user mode emulators. Tested-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* common-user: Really fix i386 calls to safe_syscall_set_errno_tailRichard Henderson2022-01-051-1/+1
| | | | | | | | Brown bag time: offset 0 from esp is the return address, offset 4 is the first argument. Fixes: d7478d4229f0 ("common-user: Fix tail calls to safe_syscall_set_errno_tail") Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
* common-user: Fix tail calls to safe_syscall_set_errno_tailRichard Henderson2022-01-053-0/+3
| | | | | | | | | | | | | For the ABIs in which the syscall return register is not also the first function argument register, move the errno value into the correct place. Fixes: a3310c0397e2 ("linux-user: Move syscall error detection into safe_syscall_base") Reported-by: Laurent Vivier <laurent@vivier.eu> Tested-by: Laurent Vivier <laurent@vivier.eu> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20220104190454.542225-1-richard.henderson@linaro.org>
* common-user: Add safe syscall handling for loongarch64 hostsWANG Xuerui2021-12-211-0/+90
| | | | | | | Signed-off-by: WANG Xuerui <git@xen0n.name> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20211221054105.178795-29-git@xen0n.name> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
* common-user: Adjust system call return on FreeBSDRichard Henderson2021-12-204-1/+44
| | | | | | | | FreeBSD system calls return positive errno. On the 4 hosts for which we have support, error is indicated by the C bit set or clear. Reviewed-by: Warner Losh <imp@bsdimp.com> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
* common-user: Move safe-syscall.* from linux-userRichard Henderson2021-12-2012-0/+950
Move linux-user safe-syscall.S and safe-syscall-error.c to common-user so that bsd-user can also use it. Also move safe-syscall.h to include/user/. Since there is nothing here that is related to the guest, as opposed to the host, build it once. Reviewed-by: Warner Losh <imp@bsdimp.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>