953b69cc | 16-Sep-2021 |
Warner Losh <imp@bsdimp.com> |
bsd-user/mmap.c: mmap prefer MAP_ANON for BSD
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@bsd
bsd-user/mmap.c: mmap prefer MAP_ANON for BSD
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>
show more ...
|
14837a3f | 16-Sep-2021 |
Warner Losh <imp@bsdimp.com> |
bsd-user/mmap.c: mmap return ENOMEM on overflow
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
bsd-user/mmap.c: mmap return ENOMEM on overflow
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>
show more ...
|
36d5d891 | 16-Sep-2021 |
Warner Losh <imp@bsdimp.com> |
bsd-user/mmap.c: MAP_ symbols are defined, so no need for ifdefs
All these MAP_ symbols are always defined on supported FreeBSD versions (12.2 and newer), so remove the #ifdefs since they aren't nee
bsd-user/mmap.c: MAP_ symbols are defined, so no need for ifdefs
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>
show more ...
|
26778ac3 | 16-Sep-2021 |
Mikaël Urankar <mikael.urankar@gmail.com> |
bsd-user/mmap.c: check pread's return value to fix warnings with _FORTIFY_SOURCE
Simmilar to the equivalent linux-user: commit fb7e378cf9c, which added checking to pread's return value. Update to cu
bsd-user/mmap.c: check pread's return value to fix warnings with _FORTIFY_SOURCE
Simmilar to the equivalent linux-user: commit fb7e378cf9c, 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>
show more ...
|
948516a3 | 08-Jul-2017 |
Mikaël Urankar <mikael.urankar@gmail.com> |
bsd-user/mmap.c: Always zero MAP_ANONYMOUS memory in mmap_frag()
Similar to the equivalent linux-user commit e6deac9cf99
When mapping MAP_ANONYMOUS memory fragments, still need notice about to set
bsd-user/mmap.c: Always zero MAP_ANONYMOUS memory in mmap_frag()
Similar to the equivalent linux-user commit e6deac9cf99
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>
show more ...
|
76d0042b | 11-Sep-2021 |
Philippe Mathieu-Daudé <f4bug@amsat.org> |
user: Remove cpu_get_pic_interrupt() stubs
cpu_get_pic_interrupt() is now unreachable from user-mode, delete the unnecessary stubs.
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-
user: Remove cpu_get_pic_interrupt() stubs
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>
show more ...
|
be04f210 | 05-Aug-2021 |
Warner Losh <imp@FreeBSD.org> |
bsd-user: Update mapping to handle reserved and starting conditions
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 ran
bsd-user: Update mapping to handle reserved and starting conditions
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 18e80c55bb6 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>
show more ...
|
b8012648 | 07-Aug-2021 |
Colin Percival <cperciva@tarsnap.com> |
bsd-user: Add '-0 argv0' option to bsd-user/main.c
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
bsd-user: Add '-0 argv0' option to bsd-user/main.c
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>
show more ...
|
63cca106 | 07-Aug-2021 |
Warner Losh <imp@FreeBSD.org> |
bsd-user: Implement interlock for atomic operations
Implement the internlock in fork_start() and fork_end() to properly cope with atomic operations and to safely keep state for parent and child proc
bsd-user: Implement interlock for atomic operations
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>
show more ...
|
f0f7f9dc | 07-Aug-2021 |
Warner Losh <imp@FreeBSD.org> |
bsd-user: move gemu_log to later in the file
Signed-off-by: Warner Losh <imp@bsdimp.com> Acked-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Kyle Evans <kevans@FreeBSD.org> |
c09f12fe | 06-Aug-2021 |
Warner Losh <imp@FreeBSD.org> |
bsd-user: Refactor load_elf_sections and is_target_elf_binary
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>
bsd-user: Refactor load_elf_sections and is_target_elf_binary
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>
show more ...
|
0456a177 | 06-Aug-2021 |
Warner Losh <imp@FreeBSD.org> |
bsd-user: elfload.c style catch up patch
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 Hend
bsd-user: elfload.c style catch up patch
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>
show more ...
|
0475f8fa | 06-Aug-2021 |
Warner Losh <imp@FreeBSD.org> |
bsd-user: add stubbed out core dump support
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
bsd-user: add stubbed out core dump support
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>
show more ...
|
25fb5d38 | 06-Aug-2021 |
Warner Losh <imp@FreeBSD.org> |
bsd-user: Add target_os_user.h to capture the user/kernel structures
This file evolved over the years to capture the user/kernel interfaces, including those that changed over time.
Signed-off-by: S
bsd-user: Add target_os_user.h to capture the user/kernel structures
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>
show more ...
|
e4442059 | 06-Aug-2021 |
Warner Losh <imp@FreeBSD.org> |
bsd-user: Add target_arch_reg to describe a target's register set
target_reg_t is the normal register. target_fpreg_t is the floating point registers. target_copy_regs copies the registers out of CP
bsd-user: Add target_arch_reg to describe a target's register set
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>
show more ...
|
6a3b9bfd | 05-Aug-2021 |
Warner Losh <imp@FreeBSD.org> |
bsd-user: update debugging in mmap.c
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@Fre
bsd-user: update debugging in mmap.c
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>
show more ...
|
366c5c9f | 05-Aug-2021 |
Warner Losh <imp@FreeBSD.org> |
bsd-user: Rewrite target system call definintion glue
Rewrite target definnitions to interface with the FreeBSD system calls. This covers basic types (time_t, iovec, umtx_time, timespec, timeval, ru
bsd-user: Rewrite target system call definintion glue
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>
show more ...
|
2ab2b01c | 06-Aug-2021 |
Warner Losh <imp@FreeBSD.org> |
bsd-user: Remove dead #ifdefs from elfload.c
LOW_ELF_STACK doesn't exist on FreeBSD and likely never will. Remove it. Likewise, remove an #if 0 block that's not useful
Signed-off-by: Warner Losh <i
bsd-user: Remove dead #ifdefs from elfload.c
LOW_ELF_STACK doesn't exist on FreeBSD and likely never will. Remove it. Likewise, remove an #if 0 block that's not useful
Signed-off-by: Warner Losh <imp@bsdimp.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
show more ...
|
98b34d35 | 04-Aug-2021 |
Warner Losh <imp@FreeBSD.org> |
bsd-user: elf cleanup
Move OS-dependent defines into target_os_elf.h. Move the architectural dependent stuff into target_arch_elf.h. Adjust elfload.c to use target_create_elf_tables instead of creat
bsd-user: elf cleanup
Move OS-dependent defines into target_os_elf.h. Move the architectural dependent stuff into target_arch_elf.h. Adjust elfload.c to use target_create_elf_tables instead of create_elf_tables.
Signed-off-by: Warner Losh <imp@bsdimp.com> Signed-off-by: Stacey Son <sson@FreeBSD.org> Signed-off-by: Kyle Evans <kevans@FreeBSD.org> Signed-off-by: Justin Hibbits <chmeeedalf@gmail.com> Signed-off-by: Alexander Kabaev <kan@FreeBSD.ORG> Acked-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Kyle Evans <kevans@FreeBSD.org>
show more ...
|
c336094c | 04-Aug-2021 |
Warner Losh <imp@FreeBSD.org> |
bsd-user: Add architecture specific signal tramp code
Add a stubbed out version of setup_sigtramp. This is not yet used for x86, but is used for other architectures. This will be connected in future
bsd-user: Add architecture specific signal tramp code
Add a stubbed out version of setup_sigtramp. This is not yet used for x86, but is used for other architectures. This will be connected in future commits.
Signed-off-by: Stacey Son <sson@FreeBSD.org> Signed-off-by: Warner Losh <imp@bsdimp.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
show more ...
|
534217f7 | 04-Aug-2021 |
Warner Losh <imp@FreeBSD.org> |
bsd-user: Move stack initializtion into a per-os file.
Move all of the stack initialization into target_os_stack.h. Each BSD sets up processes a little differently.
Signed-off-by: Stacey Son <sson@
bsd-user: Move stack initializtion into a per-os file.
Move all of the stack initialization into target_os_stack.h. Each BSD sets up processes a little differently.
Signed-off-by: Stacey Son <sson@FreeBSD.org> Signed-off-by: Warner Losh <imp@bsdimp.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
show more ...
|
03ecf078 | 02-Sep-2021 |
Warner Losh <imp@FreeBSD.org> |
bsd-user: Implement --seed and initialize random state
Copy --seed implementation (translated from linux-user's newer command line scheme to the older one bsd-user still uses). Initialize the random
bsd-user: Implement --seed and initialize random state
Copy --seed implementation (translated from linux-user's newer command line scheme to the older one bsd-user still uses). Initialize the randomness with the glib if a specific seed is specified or use the qcrypto library if not.
Signed-off-by: Warner Losh <imp@bsdimp.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
show more ...
|
790baacc | 05-Aug-2021 |
Warner Losh <imp@FreeBSD.org> |
bsd-user: *BSD specific siginfo defintions
Add FreeBSD, NetBSD and OpenBSD values for the various signal info types and defines to decode different signals to discover more information about the spe
bsd-user: *BSD specific siginfo defintions
Add FreeBSD, NetBSD and OpenBSD values for the various signal info types and defines to decode different signals to discover more information about the specific signal types.
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>
show more ...
|
312a0b1c | 06-Aug-2021 |
Warner Losh <imp@FreeBSD.org> |
bsd-user: Add system independent stack, data and text limiting
Eliminate the x86 specific stack stuff in favor of more generic control over the process size: target_maxtsiz max text size ta
bsd-user: Add system independent stack, data and text limiting
Eliminate the x86 specific stack stuff in favor of more generic control over the process size: target_maxtsiz max text size target_dfldsiz initial data size limit target_maxdsiz max data size target_dflssiz initial stack size limit target_maxssiz max stack size target_sgrowsiz amount to grow stack These can be set on a per-arch basis, and the stack size can be set on the command line. Adjust the stack size parameters at startup.
Signed-off-by: Stacey Son <sson@FreeBSD.org> Signed-off-by: Warner Losh <imp@bsdimp.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
show more ...
|
82792244 | 04-Aug-2021 |
Warner Losh <imp@FreeBSD.org> |
bsd-user: Create target specific vmparam.h
Target specific values for vm parameters and details.
Signed-off-by: Stacey Son <sson@FreeBSD.org> Signed-off-by: Warner Losh <imp@bsdimp.com> Reviewed-by
bsd-user: Create target specific vmparam.h
Target specific values for vm parameters and details.
Signed-off-by: Stacey Son <sson@FreeBSD.org> Signed-off-by: Warner Losh <imp@bsdimp.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
show more ...
|