159fb790 | 18-Apr-2024 |
Philippe Mathieu-Daudé <philmd@linaro.org> |
hw/elf_ops: Rename elf_ops.h -> elf_ops.h.inc
Since commit 139c1837db ("meson: rename included C source files to .c.inc"), QEMU standard procedure for included C files is to use *.c.inc.
Besides, s
hw/elf_ops: Rename elf_ops.h -> elf_ops.h.inc
Since commit 139c1837db ("meson: rename included C source files to .c.inc"), QEMU standard procedure for included C files is to use *.c.inc.
Besides, since commit 6a0057aa22 ("docs/devel: make a statement about includes") this is documented in the Coding Style:
If you do use template header files they should be named with the ``.c.inc`` or ``.h.inc`` suffix to make it clear they are being included for expansion.
Therefore rename "hw/elf_ops.h" as "hw/elf_ops.h.inc".
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Acked-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20240424173333.96148-2-philmd@linaro.org>
show more ...
|
a6819c1b | 11-Apr-2024 |
Peter Maydell <peter.maydell@linaro.org> |
linux-user/flatload.c: Remove unused bFLT shared-library and ZFLAT code
Ever since the bFLT format support was added in 2006, there has been a chunk of code in the file guarded by CONFIG_BINFMT_SHAR
linux-user/flatload.c: Remove unused bFLT shared-library and ZFLAT code
Ever since the bFLT format support was added in 2006, there has been a chunk of code in the file guarded by CONFIG_BINFMT_SHARED_FLAT which is supposedly for shared library support. This is not enabled and it's not possible to enable it, because if you do you'll run into the "#error needs checking" in the calc_reloc() function.
Similarly, CONFIG_BINFMT_ZFLAT exists but can't be enabled because of an "#error code needs checking" in load_flat_file().
This code is obviously unfinished and has never been used; nobody in the intervening 18 years has complained about this or fixed it, so just delete the dead code. If anybody ever wants the feature they can always pull it out of git, or (perhaps better) write it from scratch based on the current Linux bFLT loader rather than the one of 18 years ago.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-id: 20240411115313.680433-1-peter.maydell@linaro.org
show more ...
|
7048fc59 | 03-Apr-2024 |
Michael Vogt <mvogt@redhat.com> |
linux-user: Add FITRIM ioctl
Tiny patch to add the missing FITRIM ioctl.
Signed-off-by: Michael Vogt <mvogt@redhat.com> Message-Id: <20240403092048.16023-2-michael.vogt@gmail.com> Signed-off-by: Ri
linux-user: Add FITRIM ioctl
Tiny patch to add the missing FITRIM ioctl.
Signed-off-by: Michael Vogt <mvogt@redhat.com> Message-Id: <20240403092048.16023-2-michael.vogt@gmail.com> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
show more ...
|
88a722b6 | 31-Mar-2024 |
Michael Tokarev <mjt@tls.msk.ru> |
linux-user: do_setsockopt: eliminate goto in switch for SO_SNDTIMEO
There's identical code for SO_SNDTIMEO and SO_RCVTIMEO, currently implemented using an ugly goto into another switch case. Elimin
linux-user: do_setsockopt: eliminate goto in switch for SO_SNDTIMEO
There's identical code for SO_SNDTIMEO and SO_RCVTIMEO, currently implemented using an ugly goto into another switch case. Eliminate that using arithmetic if, making code flow more natural.
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru> Message-Id: <20240331100737.2724186-5-mjt@tls.msk.ru> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
show more ...
|
166bd92e | 31-Mar-2024 |
Michael Tokarev <mjt@tls.msk.ru> |
linux-user: do_setsockopt: make ip_mreq_source local to the place where it is used
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru> Message-Id: <20240331100737.2724186-4-mjt@tls.msk.ru> Signed-off-by
linux-user: do_setsockopt: make ip_mreq_source local to the place where it is used
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru> Message-Id: <20240331100737.2724186-4-mjt@tls.msk.ru> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
show more ...
|
124a1341 | 31-Mar-2024 |
Michael Tokarev <mjt@tls.msk.ru> |
linux-user: do_setsockopt: make ip_mreq local to the place it is used and inline target_to_host_ip_mreq()
ip_mreq is declared at the beginning of do_setsockopt(), while it is used in only one place.
linux-user: do_setsockopt: make ip_mreq local to the place it is used and inline target_to_host_ip_mreq()
ip_mreq is declared at the beginning of do_setsockopt(), while it is used in only one place. Move its declaration to that very place and replace pointer to alloca()-allocated memory with the structure itself.
target_to_host_ip_mreq() is used only once, inline it.
This change also properly handles TARGET_EFAULT when the address is wrong.
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru> Message-Id: <20240331100737.2724186-3-mjt@tls.msk.ru> [rth: Fix braces, adjust optlen to match host structure size] Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
show more ...
|
04f6fb89 | 31-Mar-2024 |
Michael Tokarev <mjt@tls.msk.ru> |
linux-user: do_setsockopt: fix SOL_ALG.ALG_SET_KEY
This setsockopt accepts zero-lengh optlen (current qemu implementation does not allow this). Also, there's no need to make a copy of the key, it i
linux-user: do_setsockopt: fix SOL_ALG.ALG_SET_KEY
This setsockopt accepts zero-lengh optlen (current qemu implementation does not allow this). Also, there's no need to make a copy of the key, it is enough to use lock_user() (which accepts zero length already).
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2197 Fixes: f31dddd2fc "linux-user: Add support for setsockopt() option SOL_ALG" Signed-off-by: Michael Tokarev <mjt@tls.msk.ru> Message-Id: <20240331100737.2724186-2-mjt@tls.msk.ru> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
show more ...
|
1f2355f5 | 12-Mar-2024 |
Ilya Leoshkevich <iii@linux.ibm.com> |
meson: Make DEBUG_REMAP a meson option
Currently DEBUG_REMAP is a macro that needs to be manually #defined to be activated, which makes it hard to have separate build directories dedicated to testin
meson: Make DEBUG_REMAP a meson option
Currently DEBUG_REMAP is a macro that needs to be manually #defined to be activated, which makes it hard to have separate build directories dedicated to testing the code with it. Promote it to a meson option.
Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com> Message-Id: <20240312002402.14344-1-iii@linux.ibm.com> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
show more ...
|
6c301485 | 27-Mar-2024 |
Philippe Mathieu-Daudé <philmd@linaro.org> |
target/nios2: Remove the deprecated Nios II target
The Nios II target is deprecated since v8.2 in commit 9997771bc1 ("target/nios2: Deprecate the Nios II architecture").
Remove: - Buildsys / CI inf
target/nios2: Remove the deprecated Nios II target
The Nios II target is deprecated since v8.2 in commit 9997771bc1 ("target/nios2: Deprecate the Nios II architecture").
Remove: - Buildsys / CI infra - User emulation - System emulation (10m50-ghrd & nios2-generic-nommu machines) - Tests
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Acked-by: Marek Vasut <marex@denx.de> Message-Id: <20240327144806.11319-3-philmd@linaro.org>
show more ...
|
143bcc1d | 09-Apr-2024 |
Richard Henderson <richard.henderson@linaro.org> |
linux-user: Preserve unswapped siginfo_t for strace
Passing the tswapped structure to strace means that our internal si_type is also gone, which then aborts in print_siginfo.
Fixes: 4d6d8a05a0a ("l
linux-user: Preserve unswapped siginfo_t for strace
Passing the tswapped structure to strace means that our internal si_type is also gone, which then aborts in print_siginfo.
Fixes: 4d6d8a05a0a ("linux-user: Move tswap_siginfo out of target code") Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
show more ...
|
2ee80bce | 17-Mar-2024 |
Nguyen Dinh Phi <phind.uet@gmail.com> |
linux-user: replace calloc() with g_new0()
Use glib allocation as recommended by the coding convention
Signed-off-by: Nguyen Dinh Phi <phind.uet@gmail.com> Message-Id: <20240317171747.1642207-1-phi
linux-user: replace calloc() with g_new0()
Use glib allocation as recommended by the coding convention
Signed-off-by: Nguyen Dinh Phi <phind.uet@gmail.com> Message-Id: <20240317171747.1642207-1-phind.uet@gmail.com> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
show more ...
|
f0907ff4 | 05-Apr-2024 |
Richard Henderson <richard.henderson@linaro.org> |
linux-user: Fix waitid return of siginfo_t and rusage
The copy back to siginfo_t should be conditional only on arg3, not the specific values that might have been written. The copy back to rusage was
linux-user: Fix waitid return of siginfo_t and rusage
The copy back to siginfo_t should be conditional only on arg3, not the specific values that might have been written. The copy back to rusage was missing entirely.
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2262 Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Tested-by: Alex Fan <alex.fan.q@gmail.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
show more ...
|
fa527b44 | 25-Mar-2024 |
Ilya Leoshkevich <iii@linux.ibm.com> |
linux-user: Fix shmat(NULL) for h != g
In the h != g && shmaddr == NULL && !reserved_va case, target_shmat() incorrectly mmap()s the initial anonymous range with MAP_FIXED_NOREPLACE, even though the
linux-user: Fix shmat(NULL) for h != g
In the h != g && shmaddr == NULL && !reserved_va case, target_shmat() incorrectly mmap()s the initial anonymous range with MAP_FIXED_NOREPLACE, even though the earlier mmap_find_vma() has already reserved the respective address range.
Fix by using MAP_FIXED when "mapped", which is set after mmap_find_vma(), is true.
Fixes: 78bc8ed9a8f0 ("linux-user: Rewrite target_shmat") Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com> Message-Id: <20240325192436.561154-4-iii@linux.ibm.com> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
show more ...
|
e6763d7d | 25-Mar-2024 |
Ilya Leoshkevich <iii@linux.ibm.com> |
linux-user: Fix shmat() strace
The indices of arguments passed to print_shmat() are all off-by-1, because arg1 is the ipc() command. Fix them.
New output for linux-shmat-maps test:
3501769 shm
linux-user: Fix shmat() strace
The indices of arguments passed to print_shmat() are all off-by-1, because arg1 is the ipc() command. Fix them.
New output for linux-shmat-maps test:
3501769 shmat(4784214,0x0000000000800000,SHM_RND) = 0
Fixes: 9f7c97324c27 ("linux-user: Add strace for shmat") Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com> Message-Id: <20240325192436.561154-3-iii@linux.ibm.com> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
show more ...
|
b9f38374 | 25-Mar-2024 |
Ilya Leoshkevich <iii@linux.ibm.com> |
linux-user: Fix semctl() strace
The indices of arguments used with semctl() are all off-by-1, because arg1 is the ipc() command. Fix them. While at it, reuse print_semctl().
New output (for a small
linux-user: Fix semctl() strace
The indices of arguments used with semctl() are all off-by-1, because arg1 is the ipc() command. Fix them. While at it, reuse print_semctl().
New output (for a small test program):
3540333 semctl(999,888,SEM_INFO,0x00007fe5051ee9a0) = -1 errno=14 (Bad address)
Fixes: 7ccfb2eb5f9d ("Fix warnings that would be caused by gcc flag -Wwrite-strings") Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com> Message-Id: <20240325192436.561154-2-iii@linux.ibm.com> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
show more ...
|
f84e313e | 09-Mar-2024 |
Gustavo Romero <gustavo.romero@linaro.org> |
gdbstub: Save target's siginfo
Save target's siginfo into gdbserver_state so it can be used later, for example, in any stub that requires the target's si_signo and si_code.
This change affects only
gdbstub: Save target's siginfo
Save target's siginfo into gdbserver_state so it can be used later, for example, in any stub that requires the target's si_signo and si_code.
This change affects only linux-user mode.
Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org> Suggested-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20240309030901.1726211-4-gustavo.romero@linaro.org> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
show more ...
|
4d6d8a05 | 09-Mar-2024 |
Gustavo Romero <gustavo.romero@linaro.org> |
linux-user: Move tswap_siginfo out of target code
Move tswap_siginfo from target code to handle_pending_signal. This will allow some cleanups and having the siginfo ready to be used in gdbstub.
Sig
linux-user: Move tswap_siginfo out of target code
Move tswap_siginfo from target code to handle_pending_signal. This will allow some cleanups and having the siginfo ready to be used in gdbstub.
Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org> Suggested-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20240309030901.1726211-3-gustavo.romero@linaro.org> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
show more ...
|
b6617e93 | 09-Mar-2024 |
Gustavo Romero <gustavo.romero@linaro.org> |
gdbstub: Rename back gdb_handlesig
Rename gdb_handlesig_reason back to gdb_handlesig. There is no need to add a wrapper for gdb_handlesig and rename it when a new parameter is added.
Signed-off-by:
gdbstub: Rename back gdb_handlesig
Rename gdb_handlesig_reason back to gdb_handlesig. There is no need to add a wrapper for gdb_handlesig and rename it when a new parameter is added.
Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20240309030901.1726211-2-gustavo.romero@linaro.org> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
show more ...
|
52e566b3 | 05-Mar-2024 |
Richard Henderson <richard.henderson@linaro.org> |
linux-user/elfload: Fully initialize struct target_elf_prpsinfo
Fixes Coverity CID: 1534962 Fixes: 243c4706625 ("linux-user/elfload: Write corefile elf header in one block") Reviewed-by: Philippe Ma
linux-user/elfload: Fully initialize struct target_elf_prpsinfo
Fixes Coverity CID: 1534962 Fixes: 243c4706625 ("linux-user/elfload: Write corefile elf header in one block") Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
show more ...
|
b35348c7 | 05-Mar-2024 |
Richard Henderson <richard.henderson@linaro.org> |
linux-user/elfload: Don't close an unopened file descriptor
Fixes Coverity CID: 1534964 Fixes: 106f8da664 ("linux-user/elfload: Open core file after vma_init") Reviewed-by: Philippe Mathieu-Daudé <p
linux-user/elfload: Don't close an unopened file descriptor
Fixes Coverity CID: 1534964 Fixes: 106f8da664 ("linux-user/elfload: Open core file after vma_init") Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
show more ...
|
8de24b15 | 02-Mar-2024 |
Richard Henderson <richard.henderson@linaro.org> |
linux-user: Implement PR_GET_TID_ADDRESS
Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> |
91511bd4 | 02-Mar-2024 |
Richard Henderson <richard.henderson@linaro.org> |
linux-user: Implement PR_{GET,SET}_SPECULATION_CTRL
Both of these only pass and return integral values.
Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richa
linux-user: Implement PR_{GET,SET}_SPECULATION_CTRL
Both of these only pass and return integral values.
Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
show more ...
|
07726f52 | 02-Mar-2024 |
Richard Henderson <richard.henderson@linaro.org> |
linux-user: Implement PR_{GET,SET}_CHILD_SUBREAPER
The "set" prctl passes through integral values. The "get" prctl returns the value into a pointer.
Resolves: https://gitlab.com/qemu-project/qemu/-
linux-user: Implement PR_{GET,SET}_CHILD_SUBREAPER
The "set" prctl passes through integral values. The "get" prctl returns the value into a pointer.
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1929 Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
show more ...
|
f9eebe31 | 20-Feb-2024 |
Michael Vogt <michael.vogt@gmail.com> |
linux-user: Add FIFREEZE and FITHAW ioctls
Add missing FIFREEZE and FITHAW ioctls.
Signed-off-by: Michael Vogt <michael.vogt@gmail.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Message
linux-user: Add FIFREEZE and FITHAW ioctls
Add missing FIFREEZE and FITHAW ioctls.
Signed-off-by: Michael Vogt <michael.vogt@gmail.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20240220105726.8852-1-michael.vogt@gmail.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
show more ...
|
42e62aad | 29-Jan-2024 |
Philippe Mathieu-Daudé <philmd@linaro.org> |
user: Prefer fast cpu_env() over slower CPU QOM cast macro
Mechanical patch produced running the command documented in scripts/coccinelle/cpu_env.cocci_template header.
Signed-off-by: Philippe Math
user: Prefer fast cpu_env() over slower CPU QOM cast macro
Mechanical patch produced running the command documented in scripts/coccinelle/cpu_env.cocci_template header.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Warner Losh <imp@bsdimp.com> Message-ID: <20240129164514.73104-30-philmd@linaro.org> Signed-off-by: Thomas Huth <thuth@redhat.com>
show more ...
|