d7d5601c | 14-Feb-2023 |
Ilya Leoshkevich <iii@linux.ibm.com> |
linux-user/microblaze: Handle privileged exception
Follow what kernel's full_exception() is doing.
Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Ilya Leoshkevich <iii
linux-user/microblaze: Handle privileged exception
Follow what kernel's full_exception() is doing.
Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com> Message-Id: <20230214140829.45392-4-iii@linux.ibm.com> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
show more ...
|
7de0816f | 14-Feb-2023 |
Ilya Leoshkevich <iii@linux.ibm.com> |
linux-user: Always exit from exclusive state in fork_end()
fork()ed processes currently start with current_cpu->in_exclusive_context set, which is, strictly speaking, not correct, but does not cause
linux-user: Always exit from exclusive state in fork_end()
fork()ed processes currently start with current_cpu->in_exclusive_context set, which is, strictly speaking, not correct, but does not cause problems (even assertion failures).
With one of the next patches, the code begins to rely on this value, so fix it by always calling end_exclusive() in fork_end().
Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com> Message-Id: <20230214140829.45392-2-iii@linux.ibm.com> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
show more ...
|
21a474c4 | 01-Feb-2023 |
Richard Henderson <richard.henderson@linaro.org> |
linux-user/sparc: Raise SIGILL for all unhandled software traps
The linux kernel's trap tables vector all unassigned trap numbers to BAD_TRAP, which then raises SIGILL.
Tested-by: Ilya Leoshkevich
linux-user/sparc: Raise SIGILL for all unhandled software traps
The linux kernel's trap tables vector all unassigned trap numbers to BAD_TRAP, which then raises SIGILL.
Tested-by: Ilya Leoshkevich <iii@linux.ibm.com> Reported-by: Ilya Leoshkevich <iii@linux.ibm.com> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
show more ...
|
de4143fc | 06-Feb-2023 |
Philippe Mathieu-Daudé <philmd@linaro.org> |
target/arm: Convert CPUARMState::eabi to boolean
Suggested-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Richard Henders
target/arm: Convert CPUARMState::eabi to boolean
Suggested-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20230206223502.25122-6-philmd@linaro.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
show more ...
|
3f0744f9 | 12-Dec-2022 |
Helge Deller <deller@gmx.de> |
linux-user: Allow sendmsg() without IOV
Applications do call sendmsg() without any IOV, e.g.: sendmsg(4, {msg_name=NULL, msg_namelen=0, msg_iov=NULL, msg_iovlen=0, msg_control=[{cmsg_le
linux-user: Allow sendmsg() without IOV
Applications do call sendmsg() without any IOV, e.g.: sendmsg(4, {msg_name=NULL, msg_namelen=0, msg_iov=NULL, msg_iovlen=0, msg_control=[{cmsg_len=36, cmsg_level=SOL_ALG, cmsg_type=0x2}], msg_controllen=40, msg_flags=0}, MSG_MORE) = 0 sendmsg(4, {msg_name=NULL, msg_namelen=0, msg_iov=[{iov_base="The quick brown fox jumps over t"..., iov_len=183}], msg_iovlen=1, msg_control=[{cmsg_len=20, cmsg_level=SOL_ALG, cmsg_type=0x3}], msg_controllen=24, msg_flags=0}, 0) = 183
The function do_sendrecvmsg_locked() is used for sndmsg() and recvmsg() and calls lock_iovec() to lock the IOV into memory. For the first sendmsg() above it returns NULL and thus wrongly skips the call the host sendmsg() syscall, which will break the calling application.
Fix this issue by: - allowing sendmsg() even with empty IOV - skip recvmsg() if IOV is NULL - skip both if the return code of do_sendrecvmsg_locked() != 0, which indicates some failure like EFAULT on the IOV
Tested with the debian "ell" package with hppa guest on x86_64 host.
Signed-off-by: Helge Deller <deller@gmx.de> Reviewed-by: Laurent Vivier <laurent@vivier.eu> Message-Id: <20221212173416.90590-2-deller@gmx.de> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
show more ...
|
27404b6c | 12-Dec-2022 |
Helge Deller <deller@gmx.de> |
linux-user: Implement SOL_ALG encryption support
Add suport to handle SOL_ALG packets via sendmsg() and recvmsg(). This allows emulated userspace to use encryption functionality.
Tested with the de
linux-user: Implement SOL_ALG encryption support
Add suport to handle SOL_ALG packets via sendmsg() and recvmsg(). This allows emulated userspace to use encryption functionality.
Tested with the debian ell package with hppa guest on x86_64 host.
Signed-off-by: Helge Deller <deller@gmx.de> Reviewed-by: Laurent Vivier <laurent@vivier.eu> Message-Id: <20221212173416.90590-1-deller@gmx.de> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
show more ...
|
93cf7e6c | 12-Dec-2022 |
Helge Deller <deller@gmx.de> |
linux-user: Enhance strace output for various syscalls
Add appropriate strace printf formats for various Linux syscalls.
Signed-off-by: Helge Deller <deller@gmx.de> Reviewed-by: Philippe Mathieu-Da
linux-user: Enhance strace output for various syscalls
Add appropriate strace printf formats for various Linux syscalls.
Signed-off-by: Helge Deller <deller@gmx.de> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-Id: <Y5dsfGB1RChGfraW@p100> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
show more ...
|
7020e2fd | 30-Jan-2023 |
Helge Deller <deller@gmx.de> |
linux-user: Show 4th argument of rt_sigprocmask() in strace
Add output for the missing 4th parameter (size_t sigsetsize).
Signed-off-by: Helge Deller <deller@gmx.de> Reviewed-by: Richard Henderson
linux-user: Show 4th argument of rt_sigprocmask() in strace
Add output for the missing 4th parameter (size_t sigsetsize).
Signed-off-by: Helge Deller <deller@gmx.de> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Laurent Vivier <laurent@vivier.eu> Message-Id: <Y9hCxdvdM1o+/iHC@p100> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
show more ...
|
4530deb1 | 13-Dec-2022 |
Helge Deller <deller@gmx.de> |
linux-user: Add emulation for MADV_WIPEONFORK and MADV_KEEPONFORK in madvise()
Both parameters have a different value on the parisc platform, so first translate the target value into a host value fo
linux-user: Add emulation for MADV_WIPEONFORK and MADV_KEEPONFORK in madvise()
Both parameters have a different value on the parisc platform, so first translate the target value into a host value for usage in the native madvise() syscall.
Those parameters are often used by security sensitive applications (e.g. tor browser, boringssl, ...) which expect the call to return a proper return code on failure, so return -EINVAL if qemu fails to forward the syscall to the host OS.
While touching this code, enhance the comments about MADV_DONTNEED.
Tested with testcase of tor browser when running hppa-linux guest on x86-64 host.
Signed-off-by: Helge Deller <deller@gmx.de> Acked-by: Ilya Leoshkevich <iii@linux.ibm.com> Reviewed-by: Laurent Vivier <laurent@vivier.eu> Message-Id: <Y5iwTaydU7i66K/i@p100> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
show more ...
|
ab6c497e | 27-Jan-2023 |
Helge Deller <deller@gmx.de> |
linux-user: Improve strace output of personality() and sysinfo()
Make the strace look nicer for those two syscalls.
Signed-off-by: Helge Deller <deller@gmx.de> Reviewed-by: Richard Henderson <richa
linux-user: Improve strace output of personality() and sysinfo()
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> Reviewed-by: Laurent Vivier <laurent@vivier.eu> Message-Id: <Y9QxskymWJjrKQmT@p100> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
show more ...
|
e0174afe | 27-Jan-2023 |
Helge Deller <deller@gmx.de> |
linux-user: Fix /proc/cpuinfo output for hppa
The hppa architectures provides an own output for the emulated /proc/cpuinfo file.
Some userspace applications count (even if that's not the recommende
linux-user: Fix /proc/cpuinfo output for hppa
The hppa architectures provides an own output for the emulated /proc/cpuinfo file.
Some userspace applications count (even if that's not the recommended way) the number of lines which start with "processor:" and assume that this number then reflects the number of online CPUs. Since those 3 architectures don't provide any such line, applications may assume "0" CPUs. One such issue can be seen in debian bug report: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1024653
Avoid such issues by adding a "processor:" line for each of the online CPUs.
Signed-off-by: Helge Deller <deller@gmx.de> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Laurent Vivier <laurent@vivier.eu> Message-Id: <Y9QvyRSq1I1k5/JW@p100> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
show more ...
|
cb88b7c2 | 27-Jan-2023 |
Helge Deller <deller@gmx.de> |
linux-user: Fix SO_ERROR return code of getsockopt()
Add translation for the host error return code of: getsockopt(19, SOL_SOCKET, SO_ERROR, [ECONNREFUSED], [4]) = 0
This fixes the testsuite of
linux-user: Fix SO_ERROR return code of getsockopt()
Add translation for the host error return code of: getsockopt(19, SOL_SOCKET, SO_ERROR, [ECONNREFUSED], [4]) = 0
This fixes the testsuite of the cockpit debian package with a hppa-linux guest on a x86-64 host.
Signed-off-by: Helge Deller <deller@gmx.de> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Laurent Vivier <laurent@vivier.eu> Message-Id: <Y9QzNzXg0hrzHQeo@p100> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
show more ...
|
95fc5ed4 | 29-Jan-2023 |
Mike Frysinger <vapier@gentoo.org> |
linux-user: move target_flat.h to target subdirs
This makes target_flat.h behave like every other target_xxx.h header. It also makes it actually work -- while the current header says adding a header
linux-user: move target_flat.h to target subdirs
This makes target_flat.h behave like every other target_xxx.h header. It also makes it actually work -- while the current header says adding a header to the target subdir overrides the common one, it doesn't. This is for two reasons: * meson.build adds -Ilinux-user before -Ilinux-user/$arch * the compiler search path for "target_flat.h" looks in the same dir as the source file before searching -I paths.
This can be seen with the xtensa port -- the subdir settings aren't used which breaks stack setup.
Move it to the generic/ subdir and add include stubs like every other target_xxx.h header is handled.
Signed-off-by: Mike Frysinger <vapier@gentoo.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20230129004625.11228-1-vapier@gentoo.org> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
show more ...
|
6a848b52 | 15-Jan-2023 |
Helge Deller <deller@gmx.de> |
linux-user: Improve strace output of getgroups() and setgroups()
Make the strace look nicer for those syscalls.
Signed-off-by: Helge Deller <deller@gmx.de> Reviewed-by: Laurent Vivier <laurent@vivi
linux-user: Improve strace output of getgroups() and setgroups()
Make the strace look nicer for those syscalls.
Signed-off-by: Helge Deller <deller@gmx.de> Reviewed-by: Laurent Vivier <laurent@vivier.eu> Message-Id: <20230115210057.445132-1-deller@gmx.de> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
show more ...
|
dfd8c5e9 | 15-Jan-2023 |
Helge Deller <deller@gmx.de> |
linux-user: Add strace output for clock_getres_time64() and futex_time64()
Add the two syscalls to strace output to avoid "Unknown syscall" message.
Signed-off-by: Helge Deller <deller@gmx.de> Revi
linux-user: Add strace output for clock_getres_time64() and futex_time64()
Add the two syscalls to strace output to avoid "Unknown syscall" message.
Signed-off-by: Helge Deller <deller@gmx.de> Reviewed-by: Laurent Vivier <laurent@vivier.eu> Message-Id: <20230115113517.25143-1-deller@gmx.de> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
show more ...
|
6003159c | 10-Jan-2023 |
Daniel P. Berrangé <berrange@redhat.com> |
Revert "linux-user: fix compat with glibc >= 2.36 sys/mount.h"
This reverts commit 3cd3df2a9584e6f753bb62a0028bd67124ab5532.
glibc has fixed (in 2.36.9000-40-g774058d729) the problem that caused a
Revert "linux-user: fix compat with glibc >= 2.36 sys/mount.h"
This reverts commit 3cd3df2a9584e6f753bb62a0028bd67124ab5532.
glibc has fixed (in 2.36.9000-40-g774058d729) the problem that caused a clash when both sys/mount.h annd linux/mount.h are included, and backported this to the 2.36 stable release too:
https://sourceware.org/glibc/wiki/Release/2.36#Usage_of_.3Clinux.2Fmount.h.3E_and_.3Csys.2Fmount.h.3E
It is saner for QEMU to remove the workaround it applied for glibc 2.36 and expect distros to ship the 2.36 maint release with the fix. This avoids needing to add a further workaround to QEMU to deal with the fact that linux/brtfs.h now also pulls in linux/mount.h via linux/fs.h since Linux 6.1
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20230110174901.2580297-3-berrange@redhat.com> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
show more ...
|
9f024653 | 10-Jan-2023 |
Daniel P. Berrangé <berrange@redhat.com> |
Revert "linux-user: add more compat ioctl definitions"
This reverts commit c5495f4ecb0cdaaf2e9dddeb48f1689cdb520ca0.
glibc has fixed (in 2.36.9000-40-g774058d729) the problem that caused a clash wh
Revert "linux-user: add more compat ioctl definitions"
This reverts commit c5495f4ecb0cdaaf2e9dddeb48f1689cdb520ca0.
glibc has fixed (in 2.36.9000-40-g774058d729) the problem that caused a clash when both sys/mount.h annd linux/mount.h are included, and backported this to the 2.36 stable release too:
https://sourceware.org/glibc/wiki/Release/2.36#Usage_of_.3Clinux.2Fmount.h.3E_and_.3Csys.2Fmount.h.3E
It is saner for QEMU to remove the workaround it applied for glibc 2.36 and expect distros to ship the 2.36 maint release with the fix. This avoids needing to add a further workaround to QEMU to deal with the fact that linux/brtfs.h now also pulls in linux/mount.h via linux/fs.h since Linux 6.1
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20230110174901.2580297-2-berrange@redhat.com> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
show more ...
|
d5dbbfe6 | 01-Jan-2023 |
Letu Ren <fantasquex@gmail.com> |
linux-user: add more netlink protocol constants
Currently, qemu strace only prints four protocol contants. This patch adds others listed in "linux/netlink.h".
Signed-off-by: Letu Ren <fantasquex@gm
linux-user: add more netlink protocol constants
Currently, qemu strace only prints four protocol contants. This patch adds others listed in "linux/netlink.h".
Signed-off-by: Letu Ren <fantasquex@gmail.com> Message-Id: <20230101141105.12024-1-fantasquex@gmail.com> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
show more ...
|
d237b416 | 18-Jan-2023 |
Mike Frysinger <vapier@gentoo.org> |
linux-user: fix strace build w/out munlockall
Signed-off-by: Mike Frysinger <vapier@gentoo.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-Id: <20230118090144.31155-1-vapier@gen
linux-user: fix strace build w/out munlockall
Signed-off-by: Mike Frysinger <vapier@gentoo.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-Id: <20230118090144.31155-1-vapier@gentoo.org> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
show more ...
|
6490d9aa | 24-Jan-2023 |
Richard Henderson <richard.henderson@linaro.org> |
linux-user: un-parent OBJECT(cpu) when closing thread
This reinstates commit 52f0c1607671293afcdb2acc2f83e9bccbfa74bb:
While forcing the CPU to unrealize by hand does trigger the clean-up code we n
linux-user: un-parent OBJECT(cpu) when closing thread
This reinstates commit 52f0c1607671293afcdb2acc2f83e9bccbfa74bb:
While forcing the CPU to unrealize by hand does trigger the clean-up code we never fully free resources because refcount never reaches zero. This is because QOM automatically added objects without an explicit parent to /unattached/, incrementing the refcount.
Instead of manually triggering unrealization just unparent the object and let the device machinery deal with that for us.
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/866 Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Laurent Vivier <laurent@vivier.eu> Message-Id: <20220811151413.3350684-2-alex.bennee@linaro.org>
The original patch tickled a problem in target/arm, and was reverted. But that problem is fixed as of commit 3b07a936d3bf.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20230124201019.3935934-1-richard.henderson@linaro.org> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
show more ...
|
e2c649e5 | 13-Dec-2022 |
Helge Deller <deller@gmx.de> |
linux-user: Add missing MAP_HUGETLB and MAP_STACK flags in strace
Add two missing mmap flags.
Signed-off-by: Helge Deller <deller@gmx.de> Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id
linux-user: Add missing MAP_HUGETLB and MAP_STACK flags in strace
Add two missing mmap flags.
Signed-off-by: Helge Deller <deller@gmx.de> Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <Y5iiED4PpnGAHpyz@p100> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
show more ...
|
55bbe4d5 | 04-Nov-2022 |
Drew DeVault <sir@cmpwn.com> |
linux-user/syscall: Implement execveat()
References: https://gitlab.com/qemu-project/qemu/-/issues/1007 Signed-off-by: Drew DeVault <sir@cmpwn.com> Reviewed-by: Laurent Vivier <laurent@vivier.eu> Me
linux-user/syscall: Implement execveat()
References: https://gitlab.com/qemu-project/qemu/-/issues/1007 Signed-off-by: Drew DeVault <sir@cmpwn.com> Reviewed-by: Laurent Vivier <laurent@vivier.eu> Message-Id: <20221104081015.706009-1-sir@cmpwn.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-Id: <20221104173632.1052-6-philmd@linaro.org> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
show more ...
|
156e1f67 | 04-Nov-2022 |
Drew DeVault <sir@cmpwn.com> |
linux-user/syscall: Extract do_execve() from do_syscall1()
execve() is a particular case of execveat(). In order to add do_execveat(), first factor do_execve() out.
Signed-off-by: Drew DeVault <sir
linux-user/syscall: Extract do_execve() from do_syscall1()
execve() is a particular case of execveat(). In order to add do_execveat(), first factor do_execve() out.
Signed-off-by: Drew DeVault <sir@cmpwn.com> Message-Id: <20221104081015.706009-1-sir@cmpwn.com> [PMD: Split of bigger patch, filled description, fixed style] Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Laurent Vivier <laurent@vivier.eu> Message-Id: <20221104173632.1052-5-philmd@linaro.org> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
show more ...
|
5667a1ae | 04-Nov-2022 |
Drew DeVault <sir@cmpwn.com> |
linux-user/strace: Add output for execveat() syscall
Signed-off-by: Drew DeVault <sir@cmpwn.com> Message-Id: <20221104081015.706009-1-sir@cmpwn.com> Suggested-by: Helge Deller <deller@gmx.de> [PMD:
linux-user/strace: Add output for execveat() syscall
Signed-off-by: Drew DeVault <sir@cmpwn.com> Message-Id: <20221104081015.706009-1-sir@cmpwn.com> Suggested-by: Helge Deller <deller@gmx.de> [PMD: Split of bigger patch] Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Laurent Vivier <laurent@vivier.eu> Message-Id: <20221104173632.1052-4-philmd@linaro.org> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
show more ...
|
24acb7b4 | 04-Nov-2022 |
Drew DeVault <sir@cmpwn.com> |
linux-user/strace: Extract print_execve_argv() from print_execve()
In order to add print_execveat() which re-use common code from print_execve(), extract print_execve_argv() from it.
Signed-off-by:
linux-user/strace: Extract print_execve_argv() from print_execve()
In order to add print_execveat() which re-use common code from print_execve(), extract print_execve_argv() from it.
Signed-off-by: Drew DeVault <sir@cmpwn.com> Message-Id: <20221104081015.706009-1-sir@cmpwn.com> [PMD: Split of bigger patch, filled description, fixed style] Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Laurent Vivier <laurent@vivier.eu> Message-Id: <20221104173632.1052-3-philmd@linaro.org> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
show more ...
|