- Sep 27, 2022
-
-
Ilya Leoshkevich authored
Provide MADV_* definitions using target_mman.h header, similar to what kernel does. Most architectures use the same values, with the exception of alpha and hppa. Signed-off-by:
Ilya Leoshkevich <iii@linux.ibm.com> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org> Message-Id: <20220906000839.1672934-2-iii@linux.ibm.com> Signed-off-by:
Laurent Vivier <laurent@vivier.eu>
-
- Sep 06, 2022
-
-
Richard Henderson authored
We're about to start validating PAGE_EXEC, which means that we've got to mark the commpage executable. We had been placing the commpage outside of reserved_va, which was incorrect and lead to an abort. Acked-by:
Ilya Leoshkevich <iii@linux.ibm.com> Tested-by:
Ilya Leoshkevich <iii@linux.ibm.com> Signed-off-by:
Richard Henderson <richard.henderson@linaro.org>
-
- Jun 27, 2022
-
-
Richard Henderson authored
Perform the cleanup in the FIXME comment in common_semi_gdb_syscall. Do not modify guest registers until the syscall is complete, which in the gdbstub case is asynchronous. In the synchronous non-gdbstub case, use common_semi_set_ret to set the result. Merge set_swi_errno into common_semi_cb. Rely on the latter for combined return value / errno setting. Reviewed-by:
Alex Bennée <alex.bennee@linaro.org> Signed-off-by:
Richard Henderson <richard.henderson@linaro.org>
-
- Apr 22, 2022
-
-
Richard Henderson authored
Bool is a more appropriate type for this value. Adjust the assignments to use true/false. Signed-off-by:
Richard Henderson <richard.henderson@linaro.org> Reviewed-by:
Peter Maydell <peter.maydell@linaro.org> Signed-off-by:
Peter Maydell <peter.maydell@linaro.org>
-
- Apr 06, 2022
-
-
Marc-André Lureau authored
Signed-off-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20220323155743.1585078-33-marcandre.lureau@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Marc-André Lureau authored
Convert the TARGET_WORDS_BIGENDIAN macro, similarly to what was done with HOST_BIG_ENDIAN. The new TARGET_BIG_ENDIAN macro is either 0 or 1, and thus should always be defined to prevent misuse. Signed-off-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Suggested-by:
Halil Pasic <pasic@linux.ibm.com> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org> Message-Id: <20220323155743.1585078-8-marcandre.lureau@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Marc-André Lureau authored
Replace a config-time define with a compile time condition define (compatible with clang and gcc) that must be declared prior to its usage. This avoids having a global configure time define, but also prevents from bad usage, if the config header wasn't included before. This can help to make some code independent from qemu too. gcc supports __BYTE_ORDER__ from about 4.6 and clang from 3.2. Signed-off-by:
Marc-André Lureau <marcandre.lureau@redhat.com> [ For the s390x parts I'm involved in ] Acked-by:
Halil Pasic <pasic@linux.ibm.com> Reviewed-by:
Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org> Message-Id: <20220323155743.1585078-7-marcandre.lureau@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
- Mar 23, 2022
-
-
Richard Henderson authored
If CONFIG_ATOMIC64, we can use a host cmpxchg and provide atomicity across processes; otherwise we have no choice but to continue using start/end_exclusive. Reviewed-by:
Peter Maydell <peter.maydell@linaro.org> Signed-off-by:
Richard Henderson <richard.henderson@linaro.org> Message-Id: <20220323005839.94327-4-richard.henderson@linaro.org> Signed-off-by:
Laurent Vivier <laurent@vivier.eu>
-
Richard Henderson authored
The existing implementation using start/end_exclusive does not provide atomicity across processes. Reviewed-by:
Peter Maydell <peter.maydell@linaro.org> Signed-off-by:
Richard Henderson <richard.henderson@linaro.org> Message-Id: <20220323005839.94327-3-richard.henderson@linaro.org> Signed-off-by:
Laurent Vivier <laurent@vivier.eu>
-
Richard Henderson authored
This fallback syscall was stubbed out. It would only matter for emulating pre-armv6. Reviewed-by:
Peter Maydell <peter.maydell@linaro.org> Signed-off-by:
Richard Henderson <richard.henderson@linaro.org> Message-Id: <20220323005839.94327-2-richard.henderson@linaro.org> Signed-off-by:
Laurent Vivier <laurent@vivier.eu>
-
- Feb 01, 2022
-
-
Serge Belyshev authored
Signed-off-by:
Serge Belyshev <belyshev@depni.sinp.msu.ru> Message-Id: <87ee4ql3yk.fsf_-_@depni.sinp.msu.ru> Signed-off-by:
Laurent Vivier <laurent@vivier.eu>
-
- Jan 18, 2022
-
-
Peter Maydell authored
Fix a typo in a comment in the arm cpu_loop code. Signed-off-by:
Peter Maydell <peter.maydell@linaro.org> Reviewed-by:
Warner Losh <imp@bsdimp.com> Message-Id: <20220114182535.3804783-1-peter.maydell@linaro.org> Signed-off-by:
Laurent Vivier <laurent@vivier.eu>
-
- Jan 11, 2022
-
-
Richard Henderson authored
Most targets share the same generic ipc structure definitions. Signed-off-by:
Richard Henderson <richard.henderson@linaro.org> Reviewed-by:
Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by:
Laurent Vivier <laurent@vivier.eu> Message-Id: <20220107042600.149852-3-richard.henderson@linaro.org> Signed-off-by:
Laurent Vivier <laurent@vivier.eu>
-
Richard Henderson authored
Place it next to copy_from/to_user_oabi_flock64, the only users, inside the existing target-specific ifdef. This leaves only generic ipc structs in target_structs.h. Signed-off-by:
Richard Henderson <richard.henderson@linaro.org> Reviewed-by:
Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by:
Laurent Vivier <laurent@vivier.eu> Message-Id: <20220107042600.149852-2-richard.henderson@linaro.org> Signed-off-by:
Laurent Vivier <laurent@vivier.eu>
-
- Jan 06, 2022
-
-
Richard Henderson authored
Since the prctl constants are supposed to be generic, supply any that are not provided by the host. Split out subroutines for PR_GET_FP_MODE, PR_SET_FP_MODE, PR_GET_VL, PR_SET_VL, PR_RESET_KEYS, PR_SET_TAGGED_ADDR_CTRL, PR_GET_TAGGED_ADDR_CTRL. Return EINVAL for guests that do not support these options rather than pass them on to the host. Reviewed-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: <20211227150127.2659293-2-richard.henderson@linaro.org> Signed-off-by:
Laurent Vivier <laurent@vivier.eu>
-
Song Gao authored
TARGET_MINSIGSTKSZ has been defined in generic/signal.h or target_signal.h, We don't need to define it again. Signed-off-by:
Song Gao <gaosong@loongson.cn> Reviewed-by:
Laurent Vivier <laurent@vivier.eu> Reviewed-by:
Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org> Message-Id: <1637893388-10282-3-git-send-email-gaosong@loongson.cn> Signed-off-by:
Laurent Vivier <laurent@vivier.eu>
-
Song Gao authored
No code change Suggested-by:
Richard Henderson <richard.henderson@linaro.org> Signed-off-by:
Song Gao <gaosong@loongson.cn> Reviewed-by:
Laurent Vivier <laurent@vivier.eu> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org> Message-Id: <1637893388-10282-2-git-send-email-gaosong@loongson.cn> Signed-off-by:
Laurent Vivier <laurent@vivier.eu>
-
- Dec 20, 2021
-
-
Richard Henderson authored
This value is fully internal to qemu, and so is not a TARGET define. Reviewed-by:
Warner Losh <imp@bsdimp.com> Reviewed-by:
Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by:
Richard Henderson <richard.henderson@linaro.org>
-
Richard Henderson authored
This value is fully internal to qemu, and so is not a TARGET define. We use this as an extra marker for both host and target errno. Reviewed-by:
Warner Losh <imp@bsdimp.com> Reviewed-by:
Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by:
Richard Henderson <richard.henderson@linaro.org>
-
- Nov 02, 2021
-
-
Richard Henderson authored
Because of the complexity of setting ESR, re-use the existing arm_cpu_do_unaligned_access function. This means we have to handle the exception ourselves in cpu_loop, transforming it to the appropriate signal. Reviewed-by:
Warner Losh <imp@bsdimp.com> Reviewed-by:
Peter Maydell <peter.maydell@linaro.org> Signed-off-by:
Richard Henderson <richard.henderson@linaro.org>
-
- Oct 01, 2021
-
-
Richard Henderson authored
Mirror what the kernel does in arch/arm/kernel/signal.h, using the old sigframe struct in the rt sigframe struct. Update the trampoline code to match the kernel: this uses sp-relative accesses rather than pc-relative. Copy the code into frame->retcode from the trampoline page. This minimises the different cases wrt arm vs thumb vs fdpic. Signed-off-by:
Richard Henderson <richard.henderson@linaro.org> Reviewed-by:
Peter Maydell <peter.maydell@linaro.org> Message-Id: <20210929130553.121567-6-richard.henderson@linaro.org> Signed-off-by:
Laurent Vivier <laurent@vivier.eu>
-
Richard Henderson authored
Since we no longer support "v1", there's no need to distinguish "v2". Reviewed-by:
Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by:
Richard Henderson <richard.henderson@linaro.org> Message-Id: <20210929130553.121567-5-richard.henderson@linaro.org> Signed-off-by:
Laurent Vivier <laurent@vivier.eu>
-
Richard Henderson authored
Version 2 signal frames are used from 2.6.12 and since cbc14e6f, we have set UNAME_MINIMUM_RELEASE to 2.6.32. Suggested-by:
Peter Maydell <peter.maydell@linaro.org> Reviewed-by:
Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by:
Richard Henderson <richard.henderson@linaro.org> Message-Id: <20210929130553.121567-4-richard.henderson@linaro.org> Signed-off-by:
Laurent Vivier <laurent@vivier.eu>
-
- Sep 23, 2021
-
-
Peter Maydell authored
Use the new force_sig_fault() function instead of setting up a target_siginfo_t and calling queue_signal(). Signed-off-by:
Peter Maydell <peter.maydell@linaro.org> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org> Message-Id: <20210813131809.28655-7-peter.maydell@linaro.org> Signed-off-by:
Laurent Vivier <laurent@vivier.eu>
-
Peter Maydell authored
In the Arm target code, when the fpa11 emulation code tells us we need to send the guest a SIGFPE, we do this with queue_signal(), but we are using the wrong si_type, and we aren't setting the _sifields union members corresponding to either the si_type we are using or the si_type we should be using. As the existing comment notes, the kernel code for this calls the old send_sig() function to deliver the signal. This eventually results in the kernel's signal handling code fabricating a siginfo_t with a SI_KERNEL code and a zero pid and uid. For QEMU this means we need to use QEMU_SI_KILL. We already have a function for that: force_sig() sets up the whole target_siginfo_t the way we need it. Signed-off-by:
Peter Maydell <peter.maydell@linaro.org> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org> Message-Id: <20210813131809.28655-4-peter.maydell@linaro.org> Signed-off-by:
Laurent Vivier <laurent@vivier.eu>
-
Peter Maydell authored
When generating a TRAP_BRKPT SIGTRAP, set the siginfo_t addr field to the PC where the breakpoint/singlestep trap occurred; this is what the kernel does for this signal for this architecture. Signed-off-by:
Peter Maydell <peter.maydell@linaro.org> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org> Message-Id: <20210813131809.28655-3-peter.maydell@linaro.org> Signed-off-by:
Laurent Vivier <laurent@vivier.eu>
-
- Sep 13, 2021
-
-
Peter Maydell authored
qemu.h is included in various non-linux-user files (which mostly want the TaskState struct and the functions for doing usermode access to guest addresses like lock_user(), unlock_user(), get_user*(), etc). Split out the parts that are only used in linux-user itself into a new user-internals.h. This leaves qemu.h with basically three things: * the definition of the TaskState struct * the user-access functions and macros * do_brk() all of which are needed by code outside linux-user that includes qemu.h. The addition of all the extra #include lines was done with sed -i '/include.*qemu\.h/a #include "user-internals.h"' $(git grep -l 'include.*qemu\.h' linux-user) (and then undoing the change to fpa11.h). Signed-off-by:
Peter Maydell <peter.maydell@linaro.org> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org> Message-Id: <20210908154405.15417-8-peter.maydell@linaro.org> Signed-off-by:
Laurent Vivier <laurent@vivier.eu>
-
Peter Maydell authored
Split the signal related prototypes into the existing header file signal-common.h, and include it in those places that now require it. Signed-off-by:
Peter Maydell <peter.maydell@linaro.org> Reviewed-by:
Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org> Message-Id: <20210908154405.15417-4-peter.maydell@linaro.org> Signed-off-by:
Laurent Vivier <laurent@vivier.eu>
-
- Aug 26, 2021
-
-
Peter Maydell authored
Currently we rely on all the callsites of cpsr_write() to rebuild the cached hflags if they change one of the CPSR bits which we use as a TB flag and cache in hflags. This is a bit awkward when we want to change the set of CPSR bits that we cache, because it means we need to re-audit all the cpsr_write() callsites to see which flags they are writing and whether they now need to rebuild the hflags. Switch instead to making cpsr_write() call arm_rebuild_hflags() itself if one of the bits being changed is a cached bit. We don't do the rebuild for the CPSRWriteRaw write type, because that kind of write is generally doing something special anyway. For the CPSRWriteRaw callsites in the KVM code and inbound migration we definitely don't want to recalculate the hflags; the callsites in boot.c and arm-powerctl.c have to do a rebuild-hflags call themselves anyway because of other CPU state changes they make. This allows us to drop explicit arm_rebuild_hflags() calls in a couple of places where the only reason we needed to call it was the CPSR write. This fixes a bug where we were incorrectly failing to rebuild hflags in the code path for a gdbstub write to CPSR, which meant that you could make QEMU assert by breaking into a running guest, altering the CPSR to change the value of, for example, CPSR.E, and then continuing. Signed-off-by:
Peter Maydell <peter.maydell@linaro.org> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org> Message-id: 20210817201843.3829-1-peter.maydell@linaro.org
-
- Jul 13, 2021
-
-
Laurent Vivier authored
Updated running scripts/update-syscalltbl.sh Signed-off-by:
Laurent Vivier <laurent@vivier.eu> Message-Id: <20210708215756.268805-4-laurent@vivier.eu> Signed-off-by:
Laurent Vivier <laurent@vivier.eu>
-
- Jul 12, 2021
-
-
Philippe Mathieu-Daudé authored
We want to access the target errno indepently of the rest of the linux-user code. Move the header containing the generic errno definitions ('errno_defs.h') to 'generic/target_errno_defs.h', create a new 'target_errno_defs.h' in each target which itself includes 'generic/target_errno_defs.h'. Suggested-by:
Richard Henderson <richard.henderson@linaro.org> Reviewed-by:
Laurent Vivier <laurent@vivier.eu> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org> Signed-off-by:
Philippe Mathieu-Daudé <f4bug@amsat.org> Message-Id: <20210708170550.1846343-4-f4bug@amsat.org> Signed-off-by:
Laurent Vivier <laurent@vivier.eu>
-
- Jun 03, 2021
-
-
Richard Henderson authored
Use an enumeration instead of raw 32/64/80 values. Reviewed-by:
Alex Bennée <alex.bennee@linaro.org> Signed-off-by:
Richard Henderson <richard.henderson@linaro.org>
-
- May 15, 2021
-
-
Richard Henderson authored
In most cases we were already passing get_sp_from_cpustate directly to the function. In other cases, we were passing a local variable which already contained the same value. In the rest of the cases, we were passing the stack pointer out of env directly. Reviewed by: Warner Losh <imp@bsdimp.com> Signed-off-by:
Richard Henderson <richard.henderson@linaro.org> Message-Id: <20210426025334.1168495-5-richard.henderson@linaro.org> Signed-off-by:
Laurent Vivier <laurent@vivier.eu>
-
Richard Henderson authored
Note that target_restore_altstack uses the host memory pointer that we have already verified, so TARGET_EFAULT is not a possible return value. Note that using -EFAULT was a bug. Signed-off-by:
Richard Henderson <richard.henderson@linaro.org> Message-Id: <20210426025334.1168495-3-richard.henderson@linaro.org> Signed-off-by:
Laurent Vivier <laurent@vivier.eu>
-
Richard Henderson authored
Use bit masking instead of an if tree. Signed-off-by:
Richard Henderson <richard.henderson@linaro.org> Reviewed-by:
Peter Maydell <peter.maydell@linaro.org> Message-Id: <20210423165413.338259-5-richard.henderson@linaro.org> Signed-off-by:
Laurent Vivier <laurent@vivier.eu>
-
Richard Henderson authored
There is no such decoding in linux/arch/arm/nwfpe/fpmodule.c. Signed-off-by:
Richard Henderson <richard.henderson@linaro.org> Reviewed-by:
Peter Maydell <peter.maydell@linaro.org> Message-Id: <20210423165413.338259-4-richard.henderson@linaro.org> Signed-off-by:
Laurent Vivier <laurent@vivier.eu>
-
Richard Henderson authored
These antiquated instructions are arm-mode only. Buglink: https://bugs.launchpad.net/bugs/1925512 Signed-off-by:
Richard Henderson <richard.henderson@linaro.org> Reviewed-by:
Peter Maydell <peter.maydell@linaro.org> Message-Id: <20210423165413.338259-3-richard.henderson@linaro.org> Signed-off-by:
Laurent Vivier <laurent@vivier.eu>
-
Richard Henderson authored
Pull out the fpa11 emulation to a helper function. Signed-off-by:
Richard Henderson <richard.henderson@linaro.org> Reviewed-by:
Peter Maydell <peter.maydell@linaro.org> Message-Id: <20210423165413.338259-2-richard.henderson@linaro.org> Signed-off-by:
Laurent Vivier <laurent@vivier.eu>
-
- Mar 10, 2021
-
-
Philippe Mathieu-Daudé authored
We want to move the semihosting code out of hw/ in the next patch. This patch contains the mechanical steps, created using: $ git mv include/hw/semihosting/ include/ $ sed -i s,hw/semihosting,semihosting, $(git grep -l hw/semihosting) Signed-off-by:
Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by:
Alex Bennée <alex.bennee@linaro.org> Message-Id: <20210226131356.3964782-2-f4bug@amsat.org> Message-Id: <20210305135451.15427-2-alex.bennee@linaro.org>
-
- Jan 18, 2021
-
-
Keith Packard authored
The public API is now defined in hw/semihosting/common-semi.h. do_common_semihosting takes CPUState * instead of CPUARMState *. All internal functions have been renamed common_semi_ instead of arm_semi_ or arm_. Aside from the API change, there are no functional changes in this patch. Signed-off-by:
Keith Packard <keithp@keithp.com> Signed-off-by:
Alex Bennée <alex.bennee@linaro.org> Reviewed-by:
Alistair Francis <alistair.francis@wdc.com> Message-Id: <20210107170717.2098982-3-keithp@keithp.com> Message-Id: <20210108224256.2321-14-alex.bennee@linaro.org>
-