40965ad9 | 07-Jul-2023 |
Richard Henderson <richard.henderson@linaro.org> |
linux-user/strace: Expand struct flags to hold a mask
A zero bit value does not make sense -- it must relate to some field in some way.
Define FLAG_BASIC with a build-time sanity check. Adjust FLAG
linux-user/strace: Expand struct flags to hold a mask
A zero bit value does not make sense -- it must relate to some field in some way.
Define FLAG_BASIC with a build-time sanity check. Adjust FLAG_GENERIC and FLAG_TARGET to use it. Add FLAG_GENERIC_MASK and FLAG_TARGET_MASK.
Fix up the existing flag definitions for build errors.
Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20230707204054.8792-6-richard.henderson@linaro.org>
show more ...
|
2b730f79 | 07-Jul-2023 |
Richard Henderson <richard.henderson@linaro.org> |
linux-user: Fix formatting of mmap.c
Fix all checkpatch.pl errors within mmap.c.
Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off
linux-user: Fix formatting of mmap.c
Fix all checkpatch.pl errors within mmap.c.
Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20230707204054.8792-5-richard.henderson@linaro.org>
show more ...
|
d28b3c90 | 06-Jul-2023 |
Andreas Schwab <schwab@suse.de> |
linux-user: Make sure initial brk(0) is page-aligned
Fixes: 86f04735ac ("linux-user: Fix brk() to release pages") Signed-off-by: Andreas Schwab <schwab@suse.de> Message-Id: <mvmpm55qnno.fsf@suse.de>
linux-user: Make sure initial brk(0) is page-aligned
Fixes: 86f04735ac ("linux-user: Fix brk() to release pages") Signed-off-by: Andreas Schwab <schwab@suse.de> Message-Id: <mvmpm55qnno.fsf@suse.de> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
show more ...
|
9b61f77f | 26-Jun-2023 |
Richard Henderson <richard.henderson@linaro.org> |
linux-user: Fix do_shmat type errors
The guest address, raddr, should be unsigned, aka abi_ulong. The host addresses should be cast via *intptr_t not long. Drop the inline and fix two other whitespa
linux-user: Fix do_shmat type errors
The guest address, raddr, should be unsigned, aka abi_ulong. The host addresses should be cast via *intptr_t not long. Drop the inline and fix two other whitespace issues.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Anton Johansson <anjo@rev.ng> Message-Id: <20230626140250.69572-1-richard.henderson@linaro.org>
show more ...
|
7a8d9f3a | 05-Jul-2023 |
Pierrick Bouvier <pierrick.bouvier@linaro.org> |
linux-user/syscall: Implement execve without execveat
Support for execveat syscall was implemented in 55bbe4 and is available since QEMU 8.0.0. It relies on host execveat, which is widely available
linux-user/syscall: Implement execve without execveat
Support for execveat syscall was implemented in 55bbe4 and is available since QEMU 8.0.0. It relies on host execveat, which is widely available on most of Linux kernels today.
However, this change breaks qemu-user self emulation, if "host" qemu version is less than 8.0.0. Indeed, it does not implement yet execveat. This strange use case happens with most of distribution today having binfmt support.
With a concrete failing example: $ qemu-x86_64-7.2 qemu-x86_64-8.0 /bin/bash -c /bin/ls /bin/bash: line 1: /bin/ls: Function not implemented -> not implemented means execve returned ENOSYS
qemu-user-static 7.2 and 8.0 can be conveniently grabbed from debian packages qemu-user-static* [1].
One usage of this is running wine-arm64 from linux-x64 (details [2]). This is by updating qemu embedded in docker image that we ran into this issue.
The solution to update host qemu is not always possible. Either it's complicated or ask you to recompile it, or simply is not accessible (GitLab CI, GitHub Actions). Thus, it could be worth to implement execve without relying on execveat, which is the goal of this patch.
This patch was tested with example presented in this commit message.
[1] http://ftp.us.debian.org/debian/pool/main/q/qemu/ [1] https://www.linaro.org/blog/emulate-windows-on-arm/
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Michael Tokarev <mjt@tls.msk.ru> Message-Id: <20230705121023.973284-1-pierrick.bouvier@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
show more ...
|
0f41be8d | 03-Jun-2023 |
Richard Henderson <richard.henderson@linaro.org> |
linux-user: Use abi_uint not unsigned in syscall_defs.h
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> |
20d49567 | 03-Jun-2023 |
Richard Henderson <richard.henderson@linaro.org> |
linux-user: Use abi_short not short in syscall_defs.h
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> |
77e935f4 | 03-Jun-2023 |
Richard Henderson <richard.henderson@linaro.org> |
linux-user: Use abi_ushort not unsigned short in syscall_defs.h
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> |
b3c719b2 | 03-Jun-2023 |
Richard Henderson <richard.henderson@linaro.org> |
linux-user: Use abi_int not int in syscall_defs.h
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> |
55a1bcff | 03-Jun-2023 |
Richard Henderson <richard.henderson@linaro.org> |
linux-user: Use abi_llong not long long in syscall_defs.h
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> |
6c977729 | 03-Jun-2023 |
Richard Henderson <richard.henderson@linaro.org> |
linux-user: Use abi_ullong not unsigned long long in syscall_defs.h
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> |
c7828bd1 | 03-Jun-2023 |
Richard Henderson <richard.henderson@linaro.org> |
linux-user: Use abi_uint not unsigned int in syscall_defs.h
Signed-off-by: Richard Henderson <richard.henderson@linaro.org> |
93c5c6cd | 03-Jun-2023 |
Richard Henderson <richard.henderson@linaro.org> |
linux-user: Use abi_llong not int64_t in syscall_defs.h
Be careful not to change linux_dirent64, which is a host structure.
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Ri
linux-user: Use abi_llong not int64_t in syscall_defs.h
Be careful not to change linux_dirent64, which is a host structure.
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
show more ...
|
7af406a6 | 03-Jun-2023 |
Richard Henderson <richard.henderson@linaro.org> |
linux-user: Use abi_ullong not uint64_t in syscall_defs.h
Be careful not to change linux_dirent64, which is a host structure.
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by:
linux-user: Use abi_ullong not uint64_t in syscall_defs.h
Be careful not to change linux_dirent64, which is a host structure.
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
show more ...
|
5dc0c971 | 03-Jun-2023 |
Richard Henderson <richard.henderson@linaro.org> |
linux-user: Use abi_int not int32_t in syscall_defs.h
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> |
f6ee1627 | 03-Jun-2023 |
Richard Henderson <richard.henderson@linaro.org> |
linux-user: Use abi_uint not uint32_t in syscall_defs.h
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> |
cb80ce5e | 03-Jun-2023 |
Richard Henderson <richard.henderson@linaro.org> |
linux-user: Remove #if 0 block in syscall_defs.h
These definitions are in sparc/signal.c.
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Richard Henderson <richard.henderson
linux-user: Remove #if 0 block in syscall_defs.h
These definitions are in sparc/signal.c.
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
show more ...
|
4f8ed2fd | 03-Jun-2023 |
Richard Henderson <richard.henderson@linaro.org> |
linux-user: Reformat syscall_defs.h
Untabify and re-indent. We had a mix of 2, 3, 4, and 8 space indentation.
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Richard Henderso
linux-user: Reformat syscall_defs.h
Untabify and re-indent. We had a mix of 2, 3, 4, and 8 space indentation.
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
show more ...
|
78a1e153 | 04-Jul-2023 |
Ilya Leoshkevich <iii@linux.ibm.com> |
linux-user: elfload: Add more initial s390x PSW bits
Make the PSW look more similar to the real s390x userspace PSW. Except for being there, the newly added bits should not affect the userspace code
linux-user: elfload: Add more initial s390x PSW bits
Make the PSW look more similar to the real s390x userspace PSW. Except for being there, the newly added bits should not affect the userspace code execution.
Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com> Reviewed-by: David Hildenbrand <david@redhat.com> Message-Id: <20230704081506.276055-2-iii@linux.ibm.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
show more ...
|
9e1c7d98 | 19-Jun-2023 |
Robbin Ehn <rehn@rivosinc.com> |
linux-user/riscv: Add syscall riscv_hwprobe
This patch adds the new syscall for the "RISC-V Hardware Probing Interface" (https://docs.kernel.org/riscv/hwprobe.html).
Reviewed-by: Palmer Dabbelt <pa
linux-user/riscv: Add syscall riscv_hwprobe
This patch adds the new syscall for the "RISC-V Hardware Probing Interface" (https://docs.kernel.org/riscv/hwprobe.html).
Reviewed-by: Palmer Dabbelt <palmer@rivosinc.com> Signed-off-by: Robbin Ehn <rehn@rivosinc.com> Message-Id: <06a4543df2aa6101ca9a48f21a3198064b4f1f87.camel@rivosinc.com> Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
show more ...
|
036cf169 | 12-Mar-2023 |
Helge Deller <deller@gmx.de> |
linux-user: Improve strace output of pread64() and pwrite64()
Make the strace look nicer for those two syscalls.
Signed-off-by: Helge Deller <deller@gmx.de> Reviewed-by: Richard Henderson <richard.
linux-user: Improve strace output of pread64() and pwrite64()
Make the strace look nicer for those two syscalls.
Signed-off-by: Helge Deller <deller@gmx.de> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
show more ...
|
dca4c838 | 08-Jul-2023 |
Helge Deller <deller@gmx.de> |
linux-user: Fix accept4(SOCK_NONBLOCK) syscall
The Linux accept4() syscall allows two flags only: SOCK_NONBLOCK and SOCK_CLOEXEC, and returns -EINVAL if any other bits have been set.
Change the qem
linux-user: Fix accept4(SOCK_NONBLOCK) syscall
The Linux accept4() syscall allows two flags only: SOCK_NONBLOCK and SOCK_CLOEXEC, and returns -EINVAL if any other bits have been set.
Change the qemu implementation accordingly, which means we can not use the fcntl_flags_tbl[] translation table which allows too many other values.
Beside the correction in behaviour, this actually fixes the accept4() emulation for hppa, mips and alpha targets for which SOCK_NONBLOCK is different than TARGET_SOCK_NONBLOCK (aka O_NONBLOCK).
The fix can be verified with the testcase of the debian lwt package, which hangs forever in a read() syscall without this patch.
Signed-off-by: Helge Deller <deller@gmx.de> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
show more ...
|
e0ddf8ea | 08-Jul-2023 |
Helge Deller <deller@gmx.de> |
linux-user: Fix fcntl() and fcntl64() to return O_LARGEFILE for 32-bit targets
When running a 32-bit guest on a 64-bit host, fcntl[64](F_GETFL) should return with the TARGET_O_LARGEFILE flag set, be
linux-user: Fix fcntl() and fcntl64() to return O_LARGEFILE for 32-bit targets
When running a 32-bit guest on a 64-bit host, fcntl[64](F_GETFL) should return with the TARGET_O_LARGEFILE flag set, because all 64-bit hosts support large files unconditionally.
But on 64-bit hosts, O_LARGEFILE has the value 0, so the flag translation can't be done with the fcntl_flags_tbl[]. Instead add the TARGET_O_LARGEFILE flag afterwards.
Note that for 64-bit guests the compiler will optimize away this code, since TARGET_O_LARGEFILE is zero.
Signed-off-by: Helge Deller <deller@gmx.de> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
show more ...
|
77ae5761 | 30-Jun-2023 |
Ilya Leoshkevich <iii@linux.ibm.com> |
linux-user: Emulate /proc/self/smaps
/proc/self/smaps is an extension of /proc/self/maps: it provides the same lines, plus additional information about each range.
GDB uses /proc/self/smaps when av
linux-user: Emulate /proc/self/smaps
/proc/self/smaps is an extension of /proc/self/maps: it provides the same lines, plus additional information about each range.
GDB uses /proc/self/smaps when available, which means that generate-core-file tries it first before falling back to /proc/self/maps. This, in turn, causes it to dump the host mappings, since /proc/self/smaps is not emulated and is just passed through.
Fix by emulating /proc/self/smaps. Provide true values only for Size, KernelPageSize, MMUPageSize and VmFlags. Leave all other values at 0, which is a valid conservative estimate.
Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20230621203627.1808446-4-iii@linux.ibm.com> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20230630180423.558337-34-alex.bennee@linaro.org>
show more ...
|
35be898e | 30-Jun-2023 |
Ilya Leoshkevich <iii@linux.ibm.com> |
linux-user: Add "safe" parameter to do_guest_openat()
gdbstub cannot meaningfully handle QEMU_ERESTARTSYS, and it doesn't need to. Add a parameter to do_guest_openat() that makes it use openat() ins
linux-user: Add "safe" parameter to do_guest_openat()
gdbstub cannot meaningfully handle QEMU_ERESTARTSYS, and it doesn't need to. Add a parameter to do_guest_openat() that makes it use openat() instead of safe_openat(), so that it becomes usable from gdbstub.
Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20230621203627.1808446-3-iii@linux.ibm.com> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20230630180423.558337-33-alex.bennee@linaro.org>
show more ...
|