a1367443 | 01-Jul-2021 |
Richard Henderson <richard.henderson@linaro.org> |
linux-user/i386: Add vdso
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1267 Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@lin
linux-user/i386: Add vdso
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1267 Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
show more ...
|
2fa536d1 | 17-Jun-2021 |
Richard Henderson <richard.henderson@linaro.org> |
linux-user: Add gen-vdso tool
This tool will be used for post-processing the linked vdso image, turning it into something that is easy to include into elfload.c.
Reviewed-by: Philippe Mathieu-Daudé
linux-user: Add gen-vdso tool
This tool will be used for post-processing the linked vdso image, turning it into something that is easy to include into elfload.c.
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
show more ...
|
c40f621a | 17-Jun-2021 |
Richard Henderson <richard.henderson@linaro.org> |
linux-user: Load vdso image if available
The vdso image will be pre-processed into a C data array, with a simple list of relocations to perform, and identifying the location of signal trampolines.
linux-user: Load vdso image if available
The vdso image will be pre-processed into a C data array, with a simple list of relocations to perform, and identifying the location of signal trampolines.
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
show more ...
|
d0b6b793 | 17-Jun-2021 |
Richard Henderson <richard.henderson@linaro.org> |
linux-user: Replace bprm->fd with bprm->src.fd
There are only a couple of uses of bprm->fd remaining. Migrate to the other field.
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by
linux-user: Replace bprm->fd with bprm->src.fd
There are only a couple of uses of bprm->fd remaining. Migrate to the other field.
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
show more ...
|
86cf82dc | 17-Jun-2021 |
Richard Henderson <richard.henderson@linaro.org> |
linux-user: Use ImageSource in load_symbols
Aside from the section headers, we're unlikely to hit the ImageSource cache on guest executables. But the interface for imgsrc_read_* is better.
Reviewe
linux-user: Use ImageSource in load_symbols
Aside from the section headers, we're unlikely to hit the ImageSource cache on guest executables. But the interface for imgsrc_read_* is better.
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
show more ...
|
3bd02386 | 17-Jun-2021 |
Richard Henderson <richard.henderson@linaro.org> |
linux-user: Use ImageSource in load_elf_image
Change parse_elf_properties as well, as the bprm_buf argument ties the two functions closely.
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> S
linux-user: Use ImageSource in load_elf_image
Change parse_elf_properties as well, as the bprm_buf argument ties the two functions closely.
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
show more ...
|
40d487ee | 19-Jun-2021 |
Richard Henderson <richard.henderson@linaro.org> |
linux-user: Do not clobber bprm_buf swapping ehdr
Rearrange the allocation of storage for ehdr between load_elf_image and load_elf_binary. The same set of copies are done, but we don't modify bprm_
linux-user: Do not clobber bprm_buf swapping ehdr
Rearrange the allocation of storage for ehdr between load_elf_image and load_elf_binary. The same set of copies are done, but we don't modify bprm_buf, which will be important later.
Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
show more ...
|
f485be72 | 17-Jun-2021 |
Richard Henderson <richard.henderson@linaro.org> |
linux-user: Tidy loader_exec
Reorg the if cases to reduce indentation. Test for 4 bytes in the file before checking the signatures.
Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Ph
linux-user: Tidy loader_exec
Reorg the if cases to reduce indentation. Test for 4 bytes in the file before checking the signatures.
Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
show more ...
|
7d2c5526 | 17-Jun-2021 |
Richard Henderson <richard.henderson@linaro.org> |
linux-user: Introduce imgsrc_read, imgsrc_read_alloc
Introduced and initialized, but not yet really used. These will tidy the current tests vs BPRM_BUF_SIZE.
Reviewed-by: Alex Bennée <alex.bennee@l
linux-user: Introduce imgsrc_read, imgsrc_read_alloc
Introduced and initialized, but not yet really used. These will tidy the current tests vs BPRM_BUF_SIZE.
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>
show more ...
|
02d9f5b6 | 27-Oct-2023 |
Richard Henderson <richard.henderson@linaro.org> |
linux-user: Fix guest signal remapping after adjusting SIGABRT
The arithmetic within the loop was not adjusted properly after SIGRTMIN was stolen for the guest SIGABRT. The effect was that the gues
linux-user: Fix guest signal remapping after adjusting SIGABRT
The arithmetic within the loop was not adjusted properly after SIGRTMIN was stolen for the guest SIGABRT. The effect was that the guest libc could not send itself __SIGRTMIN to wake sleeping threads.
Fixes: 38ee0a7dfb4b ("linux-user: Remap guest SIGABRT") Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1967 Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
show more ...
|
5a534314 | 24-Oct-2023 |
Peter Maydell <peter.maydell@linaro.org> |
target/arm: Move feature test functions to their own header
The feature test functions isar_feature_*() now take up nearly a thousand lines in target/arm/cpu.h. This header file is included by a lot
target/arm: Move feature test functions to their own header
The feature test functions isar_feature_*() now take up nearly a thousand lines in target/arm/cpu.h. This header file is included by a lot of source files, most of which don't need these functions. Move the feature test functions to their own header file.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20231024163510.2972081-2-peter.maydell@linaro.org
show more ...
|
5f25b383 | 12-Oct-2023 |
Richard Henderson <richard.henderson@linaro.org> |
target/sparc: Remove sparcv7 cpu features
The oldest supported cpu is the microsparc 1; all other cpus use CPU_DEFAULT_FEATURES. Remove the features that must always be present for sparcv7: FLOAT,
target/sparc: Remove sparcv7 cpu features
The oldest supported cpu is the microsparc 1; all other cpus use CPU_DEFAULT_FEATURES. Remove the features that must always be present for sparcv7: FLOAT, SWAP, FLUSH, FSQRT, FMUL.
Tested-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Acked-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
show more ...
|
38ee0a7d | 30-Sep-2023 |
Richard Henderson <richard.henderson@linaro.org> |
linux-user: Remap guest SIGABRT
Distinguish host SIGABRT from guest SIGABRT by mapping the guest signal onto one of the host RT signals.
This prevents a cycle by which a host assertion failure is c
linux-user: Remap guest SIGABRT
Distinguish host SIGABRT from guest SIGABRT by mapping the guest signal onto one of the host RT signals.
This prevents a cycle by which a host assertion failure is caught and handled by host_signal_handler, queued for the guest, and then we attempt to continue past the host abort. What happens next depends on the host libc, but is neither good nor helpful.
Acked-by: Helge Deller <deller@gmx.de> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
show more ...
|
4a6ebc19 | 23-Aug-2023 |
Richard Henderson <richard.henderson@linaro.org> |
linux-user: Detect and report host SIGILL, SIGFPE, SIGTRAP
These signals, when not spoofed via kill(), are always bugs. Use die_from_signal to report this sensibly.
Acked-by: Helge Deller <deller@g
linux-user: Detect and report host SIGILL, SIGFPE, SIGTRAP
These signals, when not spoofed via kill(), are always bugs. Use die_from_signal to report this sensibly.
Acked-by: Helge Deller <deller@gmx.de> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
show more ...
|
f4e11681 | 23-Aug-2023 |
Richard Henderson <richard.henderson@linaro.org> |
linux-user: Split out host_sig{segv,bus}_handler
Make host_signal_handler slightly easier to read.
Acked-by: Helge Deller <deller@gmx.de> Signed-off-by: Richard Henderson <richard.henderson@linaro.
linux-user: Split out host_sig{segv,bus}_handler
Make host_signal_handler slightly easier to read.
Acked-by: Helge Deller <deller@gmx.de> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
show more ...
|
58c4e36c | 23-Aug-2023 |
Richard Henderson <richard.henderson@linaro.org> |
linux-user: Simplify signal_init
Install the host signal handler at the same time we are probing the target signals for SIG_IGN/SIG_DFL. Ignore unmapped target signals.
Acked-by: Helge Deller <del
linux-user: Simplify signal_init
Install the host signal handler at the same time we are probing the target signals for SIG_IGN/SIG_DFL. Ignore unmapped target signals.
Acked-by: Helge Deller <deller@gmx.de> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
show more ...
|
b60b91aa | 23-Aug-2023 |
Richard Henderson <richard.henderson@linaro.org> |
linux-user: Map unsupported signals to an out-of-bounds value
Do not return a valid signal number in one domain when given an invalid signal number in the other domain.
Acked-by: Helge Deller <dell
linux-user: Map unsupported signals to an out-of-bounds value
Do not return a valid signal number in one domain when given an invalid signal number in the other domain.
Acked-by: Helge Deller <deller@gmx.de> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
show more ...
|
dbde2c0c | 22-Aug-2023 |
Richard Henderson <richard.henderson@linaro.org> |
linux-user: Only register handlers for core_dump_signal by default
The set of fatal signals is really immaterial. If one arrives, and is unhandled, then the qemu process dies and the parent gets th
linux-user: Only register handlers for core_dump_signal by default
The set of fatal signals is really immaterial. If one arrives, and is unhandled, then the qemu process dies and the parent gets the correct signal.
It is only for those signals which we would like to perform a guest core dump instead of a host core dump that we need to catch.
Acked-by: Helge Deller <deller@gmx.de> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
show more ...
|
7dfd3ca8 | 12-Aug-2023 |
Helge Deller <deller@gmx.de> |
linux-user: Detect and report host crashes
If there is an internal program error in the qemu source code which raises SIGSEGV or SIGBUS, we currently assume the signal belongs to the guest. With an
linux-user: Detect and report host crashes
If there is an internal program error in the qemu source code which raises SIGSEGV or SIGBUS, we currently assume the signal belongs to the guest. With an artificial error introduced, we will now print
QEMU internal SIGSEGV {code=MAPERR, addr=(nil)}
Signed-off-by: Helge Deller <deller@gmx.de> Message-Id: <20230812164314.352131-1-deller@gmx.de> [rth: Use in_code_gen_buffer and die_with_signal; drop backtrace] Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
show more ...
|
ee72c47e | 22-Aug-2023 |
Richard Henderson <richard.henderson@linaro.org> |
linux-user: Exit not abort in die_with_backtrace
This line is supposed to be unreachable, but if we're going to have it at all, SIGABRT via abort() is subject to the same signal peril that created t
linux-user: Exit not abort in die_with_backtrace
This line is supposed to be unreachable, but if we're going to have it at all, SIGABRT via abort() is subject to the same signal peril that created this function in the first place.
We can _exit immediately without peril.
Acked-by: Helge Deller <deller@gmx.de> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
show more ...
|
b8b50f1e | 22-Aug-2023 |
Richard Henderson <richard.henderson@linaro.org> |
linux-user: Split out die_with_signal
Because we trap so many signals for use by the guest, we have to take extra steps to exit properly.
Acked-by: Helge Deller <deller@gmx.de> Reviewed-by: Philipp
linux-user: Split out die_with_signal
Because we trap so many signals for use by the guest, we have to take extra steps to exit properly.
Acked-by: Helge Deller <deller@gmx.de> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
show more ...
|
912ff698 | 03-Oct-2023 |
Richard Henderson <richard.henderson@linaro.org> |
linux-user: Propagate failure in mmap_reserve_or_unmap back to target_munmap
Do not assert success, but return any failure received. Additionally, fix the method of earlier error return in target_mu
linux-user: Propagate failure in mmap_reserve_or_unmap back to target_munmap
Do not assert success, but return any failure received. Additionally, fix the method of earlier error return in target_munmap.
Reported-by: Andreas Schwab <schwab@suse.de> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
show more ...
|
a9f6004f | 01-Oct-2023 |
Jiajie Chen <c@jia.je> |
linux-user/elfload: Enable LSX/LASX in HWCAP for LoongArch
Since support for LSX and LASX is landed in QEMU recently, we can update HWCAPS accordingly.
Signed-off-by: Jiajie Chen <c@jia.je> Reviewe
linux-user/elfload: Enable LSX/LASX in HWCAP for LoongArch
Since support for LSX and LASX is landed in QEMU recently, we can update HWCAPS accordingly.
Signed-off-by: Jiajie Chen <c@jia.je> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20231001085315.1692667-1-c@jia.je> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
show more ...
|
3b894b69 | 28-Sep-2023 |
Mikulas Patocka <mpatocka@redhat.com> |
linux-user/sh4: Fix crashes on signal delivery
sh4 uses gUSA (general UserSpace Atomicity) to provide atomicity on CPUs that don't have atomic instructions. A gUSA region that adds 1 to an atomic va
linux-user/sh4: Fix crashes on signal delivery
sh4 uses gUSA (general UserSpace Atomicity) to provide atomicity on CPUs that don't have atomic instructions. A gUSA region that adds 1 to an atomic variable stored in @R2 looks like this:
4004b6: 03 c7 mova 4004c4 <gusa+0x10>,r0 4004b8: f3 61 mov r15,r1 4004ba: 09 00 nop 4004bc: fa ef mov #-6,r15 4004be: 22 63 mov.l @r2,r3 4004c0: 01 73 add #1,r3 4004c2: 32 22 mov.l r3,@r2 4004c4: 13 6f mov r1,r15
R0 contains a pointer to the end of the gUSA region R1 contains the saved stack pointer R15 contains negative length of the gUSA region
When this region is interrupted by a signal, the kernel detects if R15 >= -128U. If yes, the kernel rolls back PC to the beginning of the region and restores SP by copying R1 to R15.
The problem happens if we are interrupted by a signal at address 4004c4. R15 still holds the value -6, but the atomic value was already written by an instruction at address 4004c2. In this situation we can't undo the gUSA. The function unwind_gusa does nothing, the signal handler attempts to push a signal frame to the address -6 and crashes.
This patch fixes it, so that if we are interrupted at the last instruction in a gUSA region, we copy R1 to R15 to restore the correct stack pointer and avoid crashing.
There's another bug: if we are interrupted in a delay slot, we save the address of the instruction in the delay slot. We must save the address of the previous instruction.
Cc: qemu-stable@nongnu.org Signed-off-by: Mikulas Patocka <mpatocka@redhat.com> Reviewed-by: Yoshinori Sato <ysato@users.sourcefoege.jp> Message-Id: <b16389f7-6c62-70b7-59b3-87533c0bcc@redhat.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
show more ...
|
6fad9b4b | 28-Sep-2023 |
Mikulas Patocka <mpatocka@redhat.com> |
linux-user/mips: fix abort on integer overflow
QEMU mips userspace emulation crashes with "qemu: unhandled CPU exception 0x15 - aborting" when one of the integer arithmetic instructions detects an o
linux-user/mips: fix abort on integer overflow
QEMU mips userspace emulation crashes with "qemu: unhandled CPU exception 0x15 - aborting" when one of the integer arithmetic instructions detects an overflow.
This patch fixes it so that it delivers SIGFPE with FPE_INTOVF instead.
Cc: qemu-stable@nongnu.org Signed-off-by: Mikulas Patocka <mpatocka@redhat.com> Message-Id: <3ef979a8-3ee1-eb2d-71f7-d788ff88dd11@redhat.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
show more ...
|