- Dec 20, 2021
-
-
Richard Henderson authored
We have no need to reference bsd_user_ss outside of bsd-user. Go ahead and merge it directly into specific_ss. 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
Move linux-user safe-syscall.S and safe-syscall-error.c to common-user so that bsd-user can also use it. Also move safe-syscall.h to include/user/. Since there is nothing here that is related to the guest, as opposed to the host, build it once. 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
Pull the internal errno used by qemu internally its own header file, for use by safe-syscall.S. 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 03, 2021
-
-
Warner Losh authored
Until the signal support is merged from the bsd-user fork, we need stubs for cpu_loop_exit_sigsegv and cpu_loop_exit_sigbus to link. These call abort after logging a message. Since singals aren't supported here yet, this is sufficient. Signed-off-by:
Warner Losh <imp@bsdimp.com> Message-Id: <20211102225248.52999-2-imp@bsdimp.com> Tested-by:
Richard Henderson <richard.henderson@linaro.org> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org> Signed-off-by:
Richard Henderson <richard.henderson@linaro.org>
-
- Oct 18, 2021
-
-
Warner Losh authored
Create dummy signal queueing function so we can start to integrate other architectures (at the cost of signals remaining broken) to tame the dependency graph a bit and to bring in signals in a more controlled fashion. Log unimplemented events to it in the mean time. 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
To avoid a name clash with FreeBSD's sigqueue data structure in signalvar.h, rename sigqueue to qemu_sigqueue. This structure is currently defined, but unused. Signed-off-by:
Warner Losh <imp@bsdimp.com> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org> Reviewed-by:
Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by:
Kyle Evans <kevans@FreeBSD.org>
-
Warner Losh authored
do_freebsd_arch_sysarch() exists in $ARCH/target_arch_sysarch.h for x86. Call it from do_freebsd_sysarch() and remove the mostly duplicate version in syscall.c. Future changes will move it to os-sys.c and support other architectures. 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
Similar to the same function in linux-user: this stops all the current tasks. Signed-off-by:
Stacey Son <sson@FreeBSD.org> 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
The 'used' field in TaskState is write only. Remove it from TaskState. Signed-off-by:
Warner Losh <imp@bsdimp.com> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org> Reviewed-by:
Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by:
Kyle Evans <kevans@FreeBSD.org>
-
Warner Losh authored
Some architectures publish AT_HWCAP2 as well as AT_HWCAP. Those architectures will define ELF_HWCAP2 in their target_arch_elf.h files for the value for this process. If it is defined, then publish it. Signed-off-by:
Warner Losh <imp@bsdimp.com> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org> Reviewed-by:
Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by:
Kyle Evans <kevans@FreeBSD.org>
-
Warner Losh authored
All architectures have a ELF_HWCAP, so remove the fallback ifdef. Place ELF_HWCAP in the same order as on native FreeBSD. Signed-off-by:
Warner Losh <imp@bsdimp.com> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org> Reviewed-by:
Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by:
Kyle Evans <kevans@FreeBSD.org>
-
Warner Losh authored
Move TARGET_MC_GET_CLEAR_RET to freebsd/target_os_signal.h since it's architecture agnostic on FreeBSD. Signed-off-by:
Warner Losh <imp@bsdimp.com> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org> Reviewed-by:
Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by:
Kyle Evans <kevans@FreeBSD.org>
-
Stacey Son authored
To emulate signals and interrupted system calls, we need to have the same mechanisms we have in the kernel, including these errno values. Signed-off-by:
Stacey Son <sson@FreeBSD.org> 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
Make get_errno and is_error global so files other than syscall.c can use them. Signed-off-by:
Warner Losh <imp@bsdimp.com> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org> Reviewed-by:
Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by:
Kyle Evans <kevans@FreeBSD.org>
-
Warner Losh authored
Signed-off-by:
Warner Losh <imp@bsdimp.com> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org> Reviewed-by:
Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by:
Kyle Evans <kevans@FreeBSD.org>
-
Warner Losh authored
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
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
To increase flexibility, only descend into *-user when that is configured. This allows *-user to selectively include directories based on the host OS which may not exist on all hosts. Adopt Paolo's suggestion of checking the configuration in the directories that know about the configuration. Message-Id: <20210926220103.1721355-2-f4bug@amsat.org> Message-Id: <20210926220103.1721355-3-f4bug@amsat.org> Signed-off-by:
Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by:
Warner Losh <wlosh@bsdimp.com> Acked-by:
Paolo Bonzini <pbonzinni@redhat.com> Reviewed-by:
Kyle Evans <kevans@FreeBSD.org>
-
Warner Losh authored
Similar to the equivalent linux-user change 86abac06. All error conditions that target_mprotect checks are also checked by target_mmap. EACCESS cannot happen because we are just removing PROT_WRITE. ENOMEM should not happen because we are modifying a whole VMA (and we have bigger problems anyway if it happens). Fixes a Coverity false positive, where Coverity complains about target_mprotect's return value being passed to tb_invalidate_phys_range. Signed-off-by:
Mikaël Urankar <mikael.urankar@gmail.com> Signed-off-by:
Warner Losh <imp@bsdimp.com> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org> Reviewed-by:
Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by:
Kyle Evans <kevans@FreeBSD.org>
-
Kyle Evans authored
jemalloc requires a working MAP_EXCL. Ensure that no page is double mapped when specified. In addition, use guest_range_valid_untagged to test for valid ranges of pages rather than an incomplete inlined version of the test that might be wrong. 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
Switch checks for !(flags & MAP_ANONYMOUS) with checks for fd != -1. MAP_STACK and MAP_GUARD both require fd == -1 and don't require mapping the fd either. Add analysis from Guy Yur detailing the different cases for MAP_GUARD and MAP_STACK. Signed-off-by:
Guy Yur <guyyur@gmail.com> [ partially merged before, finishing the job and documenting origin] 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
Convert DEBUG_MMAP to qemu_log CPU_LOG_PAGE. Signed-off-by:
Warner Losh <imp@bsdimp.com> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org> Reviewed-by:
Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by:
Kyle Evans <kevans@FreeBSD.org>
-
- Oct 17, 2021
-
-
Warner Losh authored
MAP_ANON and MAP_ANONYMOUS are identical. Prefer MAP_ANON for BSD since the file is now a confusing mix of the two. Signed-off-by:
Warner Losh <imp@bsdimp.com> Reviewed-by:
Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org> Reviewed-by:
Kyle Evans <kevans@FreeBSD.org>
-
Warner Losh authored
mmap should return ENOMEM on len overflow rather than EINVAL. Return EINVAL when len == 0 and ENOMEM when the rounded to a page length is 0. Found by make check-tcg. Signed-off-by:
Warner Losh <imp@bsdimp.com> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org> Reviewed-by:
Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by:
Kyle Evans <kevans@FreeBSD.org>
-
Warner Losh authored
All these MAP_ symbols are always defined on supported FreeBSD versions (12.2 and newer), so remove the #ifdefs since they aren't needed. Signed-off-by:
Warner Losh <imp@bsdimp.com> Reviewed-by:
Philippe Mathieu-Daudé <f4bug@amsat.org> Acked-by:
Richard Henderson <richard.henderson@linaro.org> Reviewed-by:
Kyle Evans <kevans@FreeBSD.org>
-
Mikaël Urankar authored
Simmilar to the equivalent linux-user: commit fb7e378c, which added checking to pread's return value. Update to current qemu standards with {} around the if statement. Signed-off-by:
Mikaël Urankar <mikael.urankar@gmail.com> Signed-off-by:
Warner Losh <imp@bsdimp.com> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org> Reviewed-by:
Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by:
Kyle Evans <kevans@FreeBSD.org>
-
Mikaël Urankar authored
Similar to the equivalent linux-user commit e6deac9c When mapping MAP_ANONYMOUS memory fragments, still need notice about to set it zero, or it will cause issues. Signed-off-by:
Mikaël Urankar <mikael.urankar@gmail.com> Signed-off-by:
Warner Losh <imp@bsdimp.com> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org> Reviewed-by:
Kyle Evans <kevans@FreeBSD.org>
-
- Sep 14, 2021
-
-
Philippe Mathieu-Daudé authored
cpu_get_pic_interrupt() is now unreachable from user-mode, delete the unnecessary stubs. Signed-off-by:
Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by:
Warner Losh <imp@bsdimp.com> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org> Message-Id: <20210911165434.531552-25-f4bug@amsat.org> Signed-off-by:
Richard Henderson <richard.henderson@linaro.org>
-
- Sep 10, 2021
-
-
Warner Losh authored
Update the reserved base based on what platform we're on, as well as the start of the mmap range. Update routines that find va ranges to interact with the reserved ranges as well as properly align the mapping (this is especially important for targets whose page size does not match the host's). Loop where appropriate when the initial address space offered by mmap does not meet the contraints. This has 18e80c55 from linux-user folded in to the upstream bsd-user code as well. Signed-off-by:
Mikaël Urankar <mikael.urankar@gmail.com> Signed-off-by:
Stacey Son <sson@FreeBSD.org> Signed-off-by:
Warner Losh <imp@bsdimp.com> Acked-by:
Richard Henderson <richard.henderson@linaro.org> Reviewed-by:
Kyle Evans <kevans@FreeBSD.org>
-
Colin Percival authored
Previously it was impossible to emulate a program with a file name different from its argv[0]. With this change, you can run qemu -0 fakename realname args which runs the program "realname" with an argv of "fakename args". Signed-off-by:
Colin Percival <cperciva@tarsnap.com> Signed-off-by:
Warner Losh <imp@bsdimp.com> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org>
-
Warner Losh authored
Implement the internlock in fork_start() and fork_end() to properly cope with atomic operations and to safely keep state for parent and child processes. Signed-off-by:
Stacey Son <sson@FreeBSD.org> Signed-off-by:
Warner Losh <imp@bsdimp.com> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org>
-
Warner Losh authored
Signed-off-by:
Warner Losh <imp@bsdimp.com> Acked-by:
Richard Henderson <richard.henderson@linaro.org> Reviewed-by:
Kyle Evans <kevans@FreeBSD.org>
-
Warner Losh authored
Factor out load_elf_sections and is_target_elf_binary out of load_elf_interp. Signed-off-by:
Mikaël Urankar <mikael.urankar@gmail.com> Signed-off-by:
Stacey Son <sson@FreeBSD.org> Signed-off-by:
Warner Losh <imp@bsdimp.com> Reviewed-by:
Kyle Evans <kevans@FreeBSD.org>
-
Warner Losh authored
Various style fixes to elfload.c that were too painful to make earlier in this series. Signed-off-by:
Warner Losh <imp@bsdimp.com> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org>
-
Warner Losh authored
Add a stubbed-out version of the bsd-user fork's core dump support. This allows elfload.c to be almost the same between what's upstream and what's in qemu-project upstream w/o the burden of reviewing the core dump support. Signed-off-by:
Stacey Son <sson@FreeBSD.org> Signed-off-by:
Warner Losh <imp@bsdimp.com> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org>
-
Warner Losh authored
This file evolved over the years to capture the user/kernel interfaces, including those that changed over time. Signed-off-by:
Stacey Son <sson@FreeBSD.org> Signed-off-by:
Michal Meloun <mmel@FreeBSD.org> Signed-off-by:
Warner Losh <imp@bsdimp.com> Acked-by:
Richard Henderson <richard.henderson@linaro.org> Reviewed-by:
Kyle Evans <kevans@FreeBSD.org>
-
Warner Losh authored
target_reg_t is the normal register. target_fpreg_t is the floating point registers. target_copy_regs copies the registers out of CPU context for things like core dumps. Signed-off-by:
Stacey Son <sson@FreeBSD.org> Signed-off-by:
Warner Losh <imp@bsdimp.com> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org>
-
Warner Losh authored
Update the debugging code for new features and different targets. Signed-off-by:
Mikaël Urankar <mikael.urankar@gmail.com> Signed-off-by:
Sean Bruno <sbruno@FreeBSD.org> Signed-off-by:
Kyle Evans <kevans@FreeBSD.org> Signed-off-by:
Warner Losh <imp@bsdimp.com> Acked-by:
Richard Henderson <richard.henderson@linaro.org> Reviewed-by:
Kyle Evans <kevans@FreeBSD.org>
-
Warner Losh authored
Rewrite target definnitions to interface with the FreeBSD system calls. This covers basic types (time_t, iovec, umtx_time, timespec, timeval, rusage, rwusage) and basic defines (mmap, rusage). Also included are FreeBSD version-specific variations. Signed-off-by:
Stacey Son <sson@FreeBSD.org> Signed-off-by:
Warner Losh <imp@bsdimp.com> Acked-by:
Richard Henderson <richard.henderson@linaro.org> Reviewed-by:
Kyle Evans <kevans@FreeBSD.org>
-