- 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
Replace the global variables with inlined helper functions. getpagesize() is very likely annotated with a "const" function attribute (at least with glibc), and thus optimization should apply even better. This avoids the need for a constructor initialization too. Signed-off-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20220323155743.1585078-12-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>
-
- Mar 22, 2022
-
-
Marc-André Lureau authored
One less qemu-specific macro. It also helps to make some headers/units only depend on glib, and thus moved in standalone projects eventually. Signed-off-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by:
Richard W.M. Jones <rjones@redhat.com>
-
- Feb 27, 2022
-
-
Warner Losh authored
Add a series of macros to create system call macros that go via the safe_syscall path. Signed-off-by:
Kyle Evans <kevans@FreeBSD.org> Signed-off-by:
Warner Losh <imp@bsdimp.com> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org>
-
Warner Losh authored
target_arg64 is a generic way to extract 64-bits from a pair of arguments. On 32-bit platforms, it returns them joined together as appropriate. On 64-bit platforms, it returns the first arg because it's already 64-bits. Signed-off-by:
Stacey Son <sson@FreeBSD.org> Signed-off-by:
Warner Losh <imp@bsdimp.com> Reviewed-by:
Kyle Evans <kevans@FreeBSD.org> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org>
-
Warner Losh authored
Create target.h. This file is intended to be simple and describe basic things about the architecture. If something is a basic feature of the architecture, it belongs here. Should we need something that's per-BSD there will be a target-os.h that will live in the per-bsd directories. Define regpairs_aligned to reflect whether or not registers are 'paired' for 64-bit arguments or not. This will be false for all 64-bit targets, and will be true on those architectures that pair (currently just armv7 and powerpc on FreeBSD 14.x). Signed-off-by:
Warner Losh <imp@bsdimp.com> Reviewed-by:
Kyle Evans <kevans@FreeBSD.org> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org>
-
Warner Losh authored
An include file that pulls in all the definitions needed for the file related system calls. This also includes the host definitions to implement the system calls and some helper routines to lock/unlock different aspects of the system call arguments. Signed-off-by:
Warner Losh <imp@bsdimp.com> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org>
-
- Feb 26, 2022
-
-
Warner Losh authored
Add the helper functions get_errno and host_to_target_errno. get_errno returns either the system call results, or the -errno when system call indicates failure by returning -1. Host_to_target_errno returns errno (since on FreeBSD they are the same on all architectures) along with a comment about why it's the identity. Signed-off-by:
Warner Losh <imp@bsdimp.com> Reviewed-by:
Kyle Evans <kevans@FreeBSD.org> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org>
-
Warner Losh authored
Signed-off-by:
Warner Losh <imp@bsdimp.com> Reviewed-by:
Kyle Evans <kevans@FreeBSD.org> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org>
-
Warner Losh authored
Signed-off-by:
Warner Losh <imp@bsdimp.com> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org>
-
Warner Losh authored
While there is some commonality between *BSD syscall processing, there's a number of differences and the system call numbers and ABIs have been independent since the late 90s. Move FreeBSD's proessing here and delete it. The upstream implementation is somewhat different than the current implementation. It will be much easier to upstream these from scratch, justifying the final result, rather than working out the diffs and justifying the changes. Also tweak a comment to qemu standard form. Signed-off-by:
Warner Losh <imp@bsdimp.com> Reviewed-by:
Kyle Evans <kevans@FreeBSD.org> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org>
-
Warner Losh authored
Remove keeping track of which type of bsd we're running on. It's no longer referenced in the code. Building bsd-user on NetBSD or OpenBSD isn't possible, let alone running that code. Stop pretending that we can do the cross BSD thing since there's been a large divergence since 2000 that makes this nearly impossible between FreeBSD and {Net,Open}BSD and at least quite difficult between NetBSD and OpenBSD. Signed-off-by:
Warner Losh <imp@bsdimp.com> Reviewed-by:
Kyle Evans <kevans@FreeBSD.org> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org>
-
Warner Losh authored
Since we can't run on anything else, assume for the moment that this is a FreeBSD target. In the future, we'll need to handle this properly via some include file in bsd-user/*bsd/x86_64/mumble.h. There's a number of other diffs that would be needed to make things work on OtherBSD, so it doesn't make sense to preseve this one detail today. Signed-off-by:
Warner Losh <imp@bsdimp.com> Reviewed-by:
Kyle Evans <kevans@FreeBSD.org> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org>
-
Warner Losh authored
Since we can't run on anything else, assume for the moment that this is a FreeBSD target. In the future, we'll need to handle this properly via some include file in bsd-user/*bsd/arm/mumble.h. There's a number of other diffs that would be needed to make things work on OtherBSD, so it doesn't make sense to preseve this one detail today. Signed-off-by:
Warner Losh <imp@bsdimp.com> Reviewed-by:
Kyle Evans <kevans@FreeBSD.org> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org>
-
Warner Losh authored
Since we don't build on OpenBSD, only do FreeBSD system calls here. In the future, we'll need to move this to some place like bsd-user/freebsd/arm/mumble.h, but until then just leave this inline. This reflects changes to the upstream. Signed-off-by:
Warner Losh <imp@bsdimp.com> Reviewed-by:
Kyle Evans <kevans@FreeBSD.org> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org>
-
Warner Losh authored
This doesn't build on openbsd at the moment, and this could should arguably be in bsd-user/*bsd/i386 somewhere. Until we refactor to support OpenBSD/NetBSD again, drop it here. Signed-off-by:
Warner Losh <imp@bsdimp.com> Reviewed-by:
Kyle Evans <kevans@FreeBSD.org> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org>
-
Warner Losh authored
This doesn't build on openbsd at the moment, and this could should arguably be in bsd-user/*bsd/x86_64 somewhere. Until we refactor to support OpenBSD/NetBSD again, drop it here. Signed-off-by:
Warner Losh <imp@bsdimp.com> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org> Reviewed-by:
Kyle Evans <kevans@FreeBSD.org>
-
Warner Losh authored
Although initial versions of NetBSD did use int $80, it was replaced by syscall before any releases. OpenBSD and FreeBSD always did syscall. Signed-off-by:
Warner Losh <imp@bsdimp.com> Reviewed-by:
Kyle Evans <kevans@FreeBSD.org> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org>
-
Warner Losh authored
We've not realistically been able to actually run any bsd program on any other bsd program. They are too diverged to do this easily. The current code is setup to do it, but implementing it is hard. Stop pretending that we can do this. Signed-off-by:
Warner Losh <imp@bsdimp.com> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org>
-
- Feb 21, 2022
-
-
Philippe Mathieu-Daudé authored
Many files use "qemu/log.h" declarations but neglect to include it (they inherit it via "exec/exec-all.h"). "exec/exec-all.h" is a core component and shouldn't be used that way. Move the "qemu/log.h" inclusion locally to each unit requiring it. Signed-off-by:
Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org> Acked-by:
Thomas Huth <thuth@redhat.com> Message-Id: <20220207082756.82600-10-f4bug@amsat.org> Signed-off-by:
Thomas Huth <thuth@redhat.com>
-
- Feb 01, 2022
-
-
Warner Losh authored
The capsicum signal stuff is new with FreeBSD 14, rev 1400026, so only define QEMU_SI_CAPSICUM there. Only copy _capsicum when QEMU_SI_CAPSICUM is defined. Default to no info being passed for signals we make no guess about. Signed-off-by:
Warner Losh <imp@bsdimp.com> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org>
-
- Jan 31, 2022
-
-
Warner Losh authored
Signed-off-by:
Warner Losh <imp@bsdimp.com> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org>
-
Warner Losh authored
Rename the parameter name for target_cpu_reset's CPUArchState * arg from cpu to env. Signed-off-by:
Warner Losh <imp@bsdimp.com> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org>
-
Warner Losh authored
Implement the meat of the sigaltstack(2) system call with do_sigaltstack. With that, all the stubbed out routines are complete, so remove now-incorrect comment. Signed-off-by:
Stacey Son <sson@FreeBSD.org> Signed-off-by:
Kyle Evans <kevans@freebsd.org> Signed-off-by:
Warner Losh <imp@bsdimp.com> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org>
-
Warner Losh authored
Implement the meat of the sigaction(2) system call with do_sigaction and helper routiner block_signals (which is also used to implemement signal masking so it's global). Signed-off-by:
Stacey Son <sson@FreeBSD.org> Signed-off-by:
Kyle Evans <kevans@freebsd.org> Signed-off-by:
Warner Losh <imp@bsdimp.com> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org>
-
Warner Losh authored
Implements the meat of a sigreturn(2) system call via do_sigreturn, and helper reset_signal_mask. Fix the prototype of do_sigreturn in qemu.h and remove do_rt_sigreturn since it's linux only. Signed-off-by:
Stacey Son <sson@FreeBSD.org> Signed-off-by:
Kyle Evans <kevans@freebsd.org> Signed-off-by:
Warner Losh <imp@bsdimp.com> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org>
-
- Jan 28, 2022
-
-
Warner Losh authored
Process the currently queued signals. Signed-off-by:
Stacey Son <sson@FreeBSD.org> Signed-off-by:
Kyle Evans <kevans@freebsd.org> Signed-off-by:
Warner Losh <imp@bsdimp.com> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org>
-
Warner Losh authored
Convert siginfo from targer to host. Signed-off-by:
Stacey Son <sson@FreeBSD.org> Signed-off-by:
Kyle Evans <kevans@freebsd.org> Signed-off-by:
Warner Losh <imp@bsdimp.com> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org>
-
Warner Losh authored
Handle a queued signal. Signed-off-by:
Stacey Son <sson@FreeBSD.org> Signed-off-by:
Kyle Evans <kevans@freebsd.org> Signed-off-by:
Warner Losh <imp@bsdimp.com> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org>
-
Warner Losh authored
setup_frame sets up a signalled stack frame. Associated routines to extract the pointer to the stack frame and to support alternate stacks. Signed-off-by:
Stacey Son <sson@FreeBSD.org> Signed-off-by:
Kyle Evans <kevans@freebsd.org> Signed-off-by:
Warner Losh <imp@bsdimp.com> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org>
-
Warner Losh authored
target_sigemptyset: resets a set to having no bits set target_sigaddset: adds a signal to a set target_sigismember: returns true when signal is a member host_to_target_sigset_internal: convert host sigset to target host_to_target_sigset: convert host sigset to target target_to_host_sigset_internal: convert target sigset to host target_to_host_sigset: convert target sigset to host Signed-off-by:
Stacey Son <sson@FreeBSD.org> Signed-off-by:
Kyle Evans <kevans@freebsd.org> Signed-off-by:
Warner Losh <imp@bsdimp.com> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org>
-
Warner Losh authored
Fill in queue signal implementation, as well as routines allocate and delete elements of the signal queue. Signed-off-by:
Stacey Son <sson@FreeBSD.org> Signed-off-by:
Kyle Evans <kevans@freebsd.org> Signed-off-by:
Warner Losh <imp@bsdimp.com> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org>
-
Warner Losh authored
Force delivering a signal and generating a core file. It's a global function for the moment... Signed-off-by:
Stacey Son <sson@FreeBSD.org> Signed-off-by:
Kyle Evans <kevans@freebsd.org> Signed-off-by:
Warner Losh <imp@bsdimp.com> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org>
-
Warner Losh authored
print_taken_signal() prints signals when we're tracing signals. Signed-off-by:
Stacey Son <sson@FreeBSD.org> Signed-off-by:
Kyle Evans <kevans@freebsd.org> Signed-off-by:
Warner Losh <imp@bsdimp.com> Reviewed-by:
Peter Maydell <peter.maydell@linaro.org> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org>
-
Warner Losh authored
Implement host_signal_handler to handle signals generated by the host and to do safe system calls. Signed-off-by:
Stacey Son <sson@FreeBSD.org> Signed-off-by:
Kyle Evans <kevans@freebsd.org> Signed-off-by:
Warner Losh <imp@bsdimp.com> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org>
-
Warner Losh authored
Signed-off-by:
Kyle Evans <kevans@freebsd.org> Signed-off-by:
Warner Losh <imp@bsdimp.com> Reviewed-by:
Peter Maydell <peter.maydell@linaro.org> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org>
-
Warner Losh authored
Implement conversion of host to target siginfo. Signed-off-by:
Stacey Son <sson@FreeBSD.org> Signed-off-by:
Kyle Evans <kevans@freebsd.org> Signed-off-by:
Warner Losh <imp@bsdimp.com> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org>
-
Warner Losh authored
Add the bsd-user specific events and infrastructure. Only include the linux-user trace events for linux-user, not bsd-user. Signed-off-by:
Stacey Son <sson@FreeBSD.org> Signed-off-by:
Kyle Evans <kevans@freebsd.org> Signed-off-by:
Warner Losh <imp@bsdimp.com> Reviewed-by:
Peter Maydell <peter.maydell@linaro.org> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org>
-
Warner Losh authored
Start to add the host signal functionality to the build. Signed-off-by:
Warner Losh <imp@bsdimp.com> Reviewed-by:
Peter Maydell <peter.maydell@linaro.org> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org>
-