qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] 381c42: bsd-user: remove sparc and sparc64


From: Peter Maydell
Subject: [Qemu-commits] [qemu/qemu] 381c42: bsd-user: remove sparc and sparc64
Date: Sat, 11 Sep 2021 08:38:51 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 381c42a186bd231693b4ef55ba5ebcc8eaaef1ba
      
https://github.com/qemu/qemu/commit/381c42a186bd231693b4ef55ba5ebcc8eaaef1ba
  Author: Warner Losh <imp@FreeBSD.org>
  Date:   2021-09-07 (Tue, 07 Sep 2021)

  Changed paths:
    M bsd-user/main.c
    R bsd-user/sparc/target_arch_sysarch.h
    R bsd-user/sparc/target_syscall.h
    R bsd-user/sparc64/target_arch_sysarch.h
    R bsd-user/sparc64/target_syscall.h
    M bsd-user/syscall.c

  Log Message:
  -----------
  bsd-user: remove sparc and sparc64

These are broken here and in the bsd-user fork. They won't be fixed as
FreeBSD has dropped support for sparc. If people wish to support this in
other BSDs, you're better off starting over than starting from these
files.

Signed-off-by: Warner Losh <imp@bsdimp.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


  Commit: 310df056cbbd76c00514f7380595c8e04e698e77
      
https://github.com/qemu/qemu/commit/310df056cbbd76c00514f7380595c8e04e698e77
  Author: Warner Losh <imp@FreeBSD.org>
  Date:   2021-09-07 (Tue, 07 Sep 2021)

  Changed paths:
    M bsd-user/elfload.c

  Log Message:
  -----------
  bsd-user: add copyright header to elfload.c

Add Stacey's copyright to elfload.c

Signed-off-by: Stacey Son <sson@FreeBSD.org>
Signed-off-by: Warner Losh <imp@bsdimp.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


  Commit: 4c0a4fe65e60396682127acbbae2eea2477f28bd
      
https://github.com/qemu/qemu/commit/4c0a4fe65e60396682127acbbae2eea2477f28bd
  Author: Warner Losh <imp@FreeBSD.org>
  Date:   2021-09-07 (Tue, 07 Sep 2021)

  Changed paths:
    M bsd-user/main.c

  Log Message:
  -----------
  bsd-user: Add Stacey's copyright to main.c

Add Stacey's updated copyright to main.c

Signed-off-by: Warner Losh <imp@bsdimp.com>
Signed-off-by: Stacey Son <sson@FreeBSD.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


  Commit: b211b3681a184685eafc6927096690728f427f1e
      
https://github.com/qemu/qemu/commit/b211b3681a184685eafc6927096690728f427f1e
  Author: Warner Losh <imp@bsdimp.com>
  Date:   2021-09-07 (Tue, 07 Sep 2021)

  Changed paths:
    M bsd-user/bsdload.c

  Log Message:
  -----------
  bsd-user: add license to bsdload.c

Pull in the license statement at the top of the bsdload.c file
from the bsd-user fork version of this file. No functional changes.

Signed-off-by: Warner Losh <imp@bsdimp.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


  Commit: a8998784aec15a25fd2c4495f2be2fe0465370fb
      
https://github.com/qemu/qemu/commit/a8998784aec15a25fd2c4495f2be2fe0465370fb
  Author: Warner Losh <imp@bsdimp.com>
  Date:   2021-09-07 (Tue, 07 Sep 2021)

  Changed paths:
    M bsd-user/bsdload.c

  Log Message:
  -----------
  bsd-user: style nits: bsdload.c whitespace to qemu standard

Signed-off-by: Warner Losh <imp@bsdimp.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


  Commit: dd869a96659abe061e854716964465ab38d256d6
      
https://github.com/qemu/qemu/commit/dd869a96659abe061e854716964465ab38d256d6
  Author: Warner Losh <imp@bsdimp.com>
  Date:   2021-09-07 (Tue, 07 Sep 2021)

  Changed paths:
    M bsd-user/elfload.c

  Log Message:
  -----------
  bsd-user: Remove all non-x86 code from elfload.c

bsd-user only builds x86 at the moment. Remove all non x86 code from
elfload.c. We'll move the x86 code to {i386,x86_64}/target_arch_elf.h
and bring it that support code from the forked bsd-user when the time
comes.

Signed-off-by: Warner Losh <imp@bsdimp.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


  Commit: 66ef252fab33d2113fd6cf399a1fd5e19ed26676
      
https://github.com/qemu/qemu/commit/66ef252fab33d2113fd6cf399a1fd5e19ed26676
  Author: Warner Losh <imp@bsdimp.com>
  Date:   2021-09-10 (Fri, 10 Sep 2021)

  Changed paths:
    M bsd-user/elfload.c
    A bsd-user/i386/target_arch_elf.h
    A bsd-user/x86_64/target_arch_elf.h

  Log Message:
  -----------
  bsd-user: move arch specific defines out of elfload.c

Move the architecture specific defines to target_arch_elf.h and delete
them from elfload.c. Only retain ifdefs appropriate for i386 and x86_64.
Add the copyright/license comments, and guard ifdefs.

Signed-off-by: Warner Losh <imp@bsdimp.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


  Commit: d37853f92f71688cb440e5d18121b97b7ed1c353
      
https://github.com/qemu/qemu/commit/d37853f92f71688cb440e5d18121b97b7ed1c353
  Author: Warner Losh <imp@bsdimp.com>
  Date:   2021-09-10 (Fri, 10 Sep 2021)

  Changed paths:
    M bsd-user/bsdload.c
    M bsd-user/main.c
    M bsd-user/qemu.h

  Log Message:
  -----------
  bsd-user: pass the bsd_param into loader_exec

Pass the bsd_param into loader_exec, and adjust. We use it to track the
inital stack allocation and to set stack, open files, and other state
shared between bsdload.c and elfload.c

Signed-off-by: Warner Losh <imp@bsdimp.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>


  Commit: 223005f0584ece2868b0b5ac11b06f3984aad569
      
https://github.com/qemu/qemu/commit/223005f0584ece2868b0b5ac11b06f3984aad569
  Author: Warner Losh <imp@bsdimp.com>
  Date:   2021-09-10 (Fri, 10 Sep 2021)

  Changed paths:
    M bsd-user/bsdload.c

  Log Message:
  -----------
  bsd-user: Fix calculation of size to allocate

It was incorrect to subtract off the size of an unsigned int here.  In
bsd-user fork, this change was made when moving the arch specific items
to specific files.  The size in BSD that's available for the arguments
does not need a return address subtracted from it.

Signed-off-by: Warner Losh <imp@bsdimp.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


  Commit: 1b50ff64a52b08bebb17d947eb95c18ba88fa20f
      
https://github.com/qemu/qemu/commit/1b50ff64a52b08bebb17d947eb95c18ba88fa20f
  Author: Warner Losh <imp@bsdimp.com>
  Date:   2021-09-10 (Fri, 10 Sep 2021)

  Changed paths:
    M bsd-user/bsdload.c
    M bsd-user/qemu.h

  Log Message:
  -----------
  bsd-user: implement path searching

Use the PATH to find the executable given a bare argument. We need to do
this so we can implement mixing native and emulated binaries (e.g.,
execing a x86 native binary from an emulated arm binary to optimize
parts of the build). By finding the binary, we will know how to exec it.

Signed-off-by: Stacey Son <sson@FreeBSD.org>
Signed-off-by: Warner Losh <imp@bsdimp.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


  Commit: 7ee0986965ca868476eeca1c661198cb5a8b3c29
      
https://github.com/qemu/qemu/commit/7ee0986965ca868476eeca1c661198cb5a8b3c29
  Author: Warner Losh <imp@bsdimp.com>
  Date:   2021-09-10 (Fri, 10 Sep 2021)

  Changed paths:
    M bsd-user/elfload.c
    M bsd-user/qemu.h

  Log Message:
  -----------
  bsd-user: Eliminate elf personality

The linux kernel supports a number of different ELF binaries. The Linux userland
emulator inheritted some of that. And we inheritted it from there. However, for
BSD there's only one kind of ELF file supported per platform, so there's no need
to cope with historical quirks. Simply the code as a result.

Signed-off-by: Warner Losh <imp@bsdimp.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


  Commit: ffa03665532d0b995cf547637d54a6af16b741c7
      
https://github.com/qemu/qemu/commit/ffa03665532d0b995cf547637d54a6af16b741c7
  Author: Warner Losh <imp@bsdimp.com>
  Date:   2021-09-10 (Fri, 10 Sep 2021)

  Changed paths:
    M bsd-user/bsdload.c
    M bsd-user/elfload.c
    M bsd-user/qemu.h

  Log Message:
  -----------
  bsd-user: remove a.out support

Remove still-born a.out support. The BSDs switched from a.out to ELF 20+ years
ago. It's out of scope for bsd-user, and what little support there was would
simply wind up at a not-implemented message. Simplify the whole mess by removing
it entirely. Should future support be required, it would be better to start from
scratch.

Signed-off-by: Warner Losh <imp@bsdimp.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>


  Commit: d8fcdad2d663e3d7d0d87ab428f6ac960b5990b9
      
https://github.com/qemu/qemu/commit/d8fcdad2d663e3d7d0d87ab428f6ac960b5990b9
  Author: Warner Losh <imp@bsdimp.com>
  Date:   2021-09-10 (Fri, 10 Sep 2021)

  Changed paths:
    M bsd-user/bsdload.c

  Log Message:
  -----------
  bsd-user: TARGET_NGROUPS unused in this file, remove

Signed-off-by: Warner Losh <imp@bsdimp.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


  Commit: b62f790cfb2621ed1d4bd6ef6661fc68bab1e1ed
      
https://github.com/qemu/qemu/commit/b62f790cfb2621ed1d4bd6ef6661fc68bab1e1ed
  Author: Warner Losh <imp@bsdimp.com>
  Date:   2021-09-10 (Fri, 10 Sep 2021)

  Changed paths:
    M bsd-user/elfload.c

  Log Message:
  -----------
  bsd-user: elfload: simplify bswap a bit.

Reduce the number of ifdefs by always calling the swapping routine, but
making them empty when swapping isn't needed.

Signed-off-by: Warner Losh <imp@bsdimp.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


  Commit: d42df502e322100c1cae355efb8b8e380867c8fa
      
https://github.com/qemu/qemu/commit/d42df502e322100c1cae355efb8b8e380867c8fa
  Author: Warner Losh <imp@bsdimp.com>
  Date:   2021-09-10 (Fri, 10 Sep 2021)

  Changed paths:
    M bsd-user/main.c
    M bsd-user/qemu.h

  Log Message:
  -----------
  bsd-user: assume pthreads and support of __thread

All compilers for some time have supported this. Follow linux-user and
eliminate the #define THREAD and unconditionally insert __thread where
needed. Please insert: "(see 24cb36a61c6: "configure: Make NPTL
non-optional")"

Signed-off-by: Warner Losh <imp@bsdimp.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>


  Commit: cce7ae5c06897a87092456622cf9d46486306a64
      
https://github.com/qemu/qemu/commit/cce7ae5c06897a87092456622cf9d46486306a64
  Author: Warner Losh <imp@FreeBSD.org>
  Date:   2021-09-10 (Fri, 10 Sep 2021)

  Changed paths:
    A bsd-user/freebsd/host-os.h
    A bsd-user/netbsd/host-os.h
    A bsd-user/openbsd/host-os.h

  Log Message:
  -----------
  bsd-user: add host-os.h

Host OS specific bits for this implementation go in this file.

Signed-off-by: Stacey Son <sson@FreeBSD.org>
Signed-off-by: Warner Losh <imp@bsdimp.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


  Commit: d1dc9ab3afd51f0a8d6a6b19edca3dd345deb32d
      
https://github.com/qemu/qemu/commit/d1dc9ab3afd51f0a8d6a6b19edca3dd345deb32d
  Author: Warner Losh <imp@FreeBSD.org>
  Date:   2021-09-10 (Fri, 10 Sep 2021)

  Changed paths:
    M bsd-user/freebsd/host-os.h
    M bsd-user/main.c
    M bsd-user/netbsd/host-os.h
    M bsd-user/openbsd/host-os.h

  Log Message:
  -----------
  bsd-user: Include host-os.h from main

Include host-os.h from main.c to pick up the default OS to emulate.  Set
that default in main().

Signed-off-by: Stacey Son <sson@FreeBSD.org>
Signed-off-by: Warner Losh <imp@bsdimp.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


  Commit: 01a298a57ed3cd1fefbe70c691d74247c8f84906
      
https://github.com/qemu/qemu/commit/01a298a57ed3cd1fefbe70c691d74247c8f84906
  Author: Warner Losh <imp@bsdimp.com>
  Date:   2021-09-10 (Fri, 10 Sep 2021)

  Changed paths:
    M bsd-user/main.c
    M bsd-user/qemu.h

  Log Message:
  -----------
  bsd-user: save the path to the qemu emulator

Save the path to the qemu emulator. This will be used later when we have
a more complete implementation of exec.

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>


  Commit: e2a74729181c51a0c9dff03bb7a99fc267bec996
      
https://github.com/qemu/qemu/commit/e2a74729181c51a0c9dff03bb7a99fc267bec996
  Author: Warner Losh <imp@FreeBSD.org>
  Date:   2021-09-10 (Fri, 10 Sep 2021)

  Changed paths:
    A bsd-user/i386/target_arch.h
    A bsd-user/i386/target_arch_cpu.c
    M bsd-user/main.c
    A bsd-user/x86_64/target_arch.h
    A bsd-user/x86_64/target_arch_cpu.c
    M configure
    M meson.build

  Log Message:
  -----------
  bsd-user: start to move target CPU functions to target_arch*

Move the CPU functions into target_arch_cpu.c that are unique to each
CPU. These are defined in target_arch.h.

Signed-off-by: Stacey Son <sson@FreeBSD.org>
Signed-off-by: Warner Losh <imp@bsdimp.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


  Commit: 031fe7af8a856cf42b0d1d9fb6188acbf7b64fd1
      
https://github.com/qemu/qemu/commit/031fe7af8a856cf42b0d1d9fb6188acbf7b64fd1
  Author: Warner Losh <imp@FreeBSD.org>
  Date:   2021-09-10 (Fri, 10 Sep 2021)

  Changed paths:
    M bsd-user/i386/target_arch_cpu.c
    A bsd-user/i386/target_arch_cpu.h
    M bsd-user/main.c
    M bsd-user/qemu.h
    M bsd-user/x86_64/target_arch_cpu.c
    A bsd-user/x86_64/target_arch_cpu.h

  Log Message:
  -----------
  bsd-user: Move per-cpu code into target_arch_cpu.h

Move cpu_loop() into target_cpu_loop(), and put that in
target_arch_cpu.h for each architecture.

Signed-off-by: Stacey Son <sson@FreeBSD.org>
Signed-off-by: Warner Losh <imp@bsdimp.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


  Commit: a8fe6d5d627f2fa9136dc1255e6dc7c67a0c45c3
      
https://github.com/qemu/qemu/commit/a8fe6d5d627f2fa9136dc1255e6dc7c67a0c45c3
  Author: Warner Losh <imp@FreeBSD.org>
  Date:   2021-09-10 (Fri, 10 Sep 2021)

  Changed paths:
    M bsd-user/elfload.c
    A bsd-user/freebsd/target_os_thread.h
    M bsd-user/i386/target_arch_elf.h
    A bsd-user/i386/target_arch_thread.h
    A bsd-user/netbsd/target_os_thread.h
    A bsd-user/openbsd/target_os_thread.h
    M bsd-user/x86_64/target_arch_elf.h
    A bsd-user/x86_64/target_arch_thread.h

  Log Message:
  -----------
  bsd-user: pull in target_arch_thread.h update target_arch_elf.h

Update target_arch_elf.h to remove thread_init. Move its contents to
target_arch_thread.h and rename to target_thread_init(). Update
elfload.c to call it. Create thread_os_thread.h to hold the os specific
parts of the thread and threat manipulation routines. Currently, it just
includes target_arch_thread.h. target_arch_thread.h contains the at the
moment unused target_thread_set_upcall which will be used in the future
when creating actual thread (i386 has this stubbed, but other
architectures in the bsd-user tree have real ones). FreeBSD doesn't do
AT_HWCAP, so remove that code. Linux does, and this code came from there.

These changes are all interrelated and could be brokend down, but seem
to represent a reviewable changeset since most of the change is boiler
plate.

Signed-off-by: Stacey Son <sson@FreeBSD.org>
Signed-off-by: Warner Losh <imp@bsdimp.com>
Reviewed-by: Kyle Evans <kevans@FreeBSD.org>


  Commit: ab77bd844b55b6b0e04c552d7e992911ff75ccd7
      
https://github.com/qemu/qemu/commit/ab77bd844b55b6b0e04c552d7e992911ff75ccd7
  Author: Warner Losh <imp@FreeBSD.org>
  Date:   2021-09-10 (Fri, 10 Sep 2021)

  Changed paths:
    M bsd-user/qemu.h

  Log Message:
  -----------
  bsd-user: Include more things in qemu.h

Include more header files to match bsd-user fork.

Signed-off-by: Warner Losh <imp@bsdimp.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


  Commit: e5e44263067b0c0d401ca6deb745fd152d0a3996
      
https://github.com/qemu/qemu/commit/e5e44263067b0c0d401ca6deb745fd152d0a3996
  Author: Warner Losh <imp@FreeBSD.org>
  Date:   2021-09-10 (Fri, 10 Sep 2021)

  Changed paths:
    M bsd-user/qemu.h

  Log Message:
  -----------
  bsd-user: define max args in terms of pages

For 32-bit platforms, pass in up to 256k of args. For 64-bit, bump that
to 512k.

Signed-off-by: Kyle Evans <kevans@freebsd.org>
Signed-off-by: Warner Losh <imp@bsdimp.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


  Commit: 82792244daa3f500c8cc83c7532754b32e285eb8
      
https://github.com/qemu/qemu/commit/82792244daa3f500c8cc83c7532754b32e285eb8
  Author: Warner Losh <imp@FreeBSD.org>
  Date:   2021-09-10 (Fri, 10 Sep 2021)

  Changed paths:
    A bsd-user/freebsd/target_os_vmparam.h
    A bsd-user/i386/target_arch_vmparam.h
    M bsd-user/qemu.h
    A bsd-user/x86_64/target_arch_vmparam.h

  Log Message:
  -----------
  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>


  Commit: 312a0b1cbf941c37d3d3aeb1ed651613e04262b5
      
https://github.com/qemu/qemu/commit/312a0b1cbf941c37d3d3aeb1ed651613e04262b5
  Author: Warner Losh <imp@FreeBSD.org>
  Date:   2021-09-10 (Fri, 10 Sep 2021)

  Changed paths:
    M bsd-user/elfload.c
    M bsd-user/main.c
    M bsd-user/qemu.h

  Log Message:
  -----------
  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>


  Commit: 790baacc63c1cb29bfc3bf0755f49ca73a348eae
      
https://github.com/qemu/qemu/commit/790baacc63c1cb29bfc3bf0755f49ca73a348eae
  Author: Warner Losh <imp@FreeBSD.org>
  Date:   2021-09-10 (Fri, 10 Sep 2021)

  Changed paths:
    A bsd-user/freebsd/target_os_siginfo.h
    A bsd-user/freebsd/target_os_signal.h
    A bsd-user/i386/target_arch_signal.h
    A bsd-user/netbsd/target_os_siginfo.h
    A bsd-user/netbsd/target_os_signal.h
    A bsd-user/openbsd/target_os_siginfo.h
    A bsd-user/openbsd/target_os_signal.h
    M bsd-user/qemu.h
    M bsd-user/syscall_defs.h
    A bsd-user/x86_64/target_arch_signal.h

  Log Message:
  -----------
  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>


  Commit: 03ecf078fab7b3ce6fdd373a902211918efeab89
      
https://github.com/qemu/qemu/commit/03ecf078fab7b3ce6fdd373a902211918efeab89
  Author: Warner Losh <imp@FreeBSD.org>
  Date:   2021-09-10 (Fri, 10 Sep 2021)

  Changed paths:
    M bsd-user/main.c

  Log Message:
  -----------
  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>


  Commit: 534217f7848dc2055fae08928689c0ac4f0a45e1
      
https://github.com/qemu/qemu/commit/534217f7848dc2055fae08928689c0ac4f0a45e1
  Author: Warner Losh <imp@FreeBSD.org>
  Date:   2021-09-10 (Fri, 10 Sep 2021)

  Changed paths:
    A bsd-user/freebsd/target_os_stack.h
    A bsd-user/netbsd/target_os_stack.h
    A bsd-user/openbsd/target_os_stack.h

  Log Message:
  -----------
  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>


  Commit: c336094c5c4c1159b96b7bff074579f055e8aea2
      
https://github.com/qemu/qemu/commit/c336094c5c4c1159b96b7bff074579f055e8aea2
  Author: Warner Losh <imp@FreeBSD.org>
  Date:   2021-09-10 (Fri, 10 Sep 2021)

  Changed paths:
    A bsd-user/i386/target_arch_sigtramp.h
    A bsd-user/x86_64/target_arch_sigtramp.h

  Log Message:
  -----------
  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>


  Commit: 98b34d354b5da78880cb39dc3a7db91c790f7c7d
      
https://github.com/qemu/qemu/commit/98b34d354b5da78880cb39dc3a7db91c790f7c7d
  Author: Warner Losh <imp@FreeBSD.org>
  Date:   2021-09-10 (Fri, 10 Sep 2021)

  Changed paths:
    M bsd-user/elfload.c
    A bsd-user/freebsd/target_os_elf.h
    A bsd-user/netbsd/target_os_elf.h
    A bsd-user/openbsd/target_os_elf.h
    M bsd-user/qemu.h

  Log Message:
  -----------
  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>


  Commit: 2ab2b01c2b75d75758255c66ece81fde636e7f2b
      
https://github.com/qemu/qemu/commit/2ab2b01c2b75d75758255c66ece81fde636e7f2b
  Author: Warner Losh <imp@FreeBSD.org>
  Date:   2021-09-10 (Fri, 10 Sep 2021)

  Changed paths:
    M bsd-user/elfload.c

  Log Message:
  -----------
  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>


  Commit: 366c5c9f8d8222443c09fccdd7b7e164aae1c671
      
https://github.com/qemu/qemu/commit/366c5c9f8d8222443c09fccdd7b7e164aae1c671
  Author: Warner Losh <imp@FreeBSD.org>
  Date:   2021-09-10 (Fri, 10 Sep 2021)

  Changed paths:
    R bsd-user/bsd-mman.h
    M bsd-user/mmap.c
    M bsd-user/syscall_defs.h

  Log Message:
  -----------
  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>


  Commit: 6a3b9bfde0aff84d1bf2901c89a0d7485e1229d0
      
https://github.com/qemu/qemu/commit/6a3b9bfde0aff84d1bf2901c89a0d7485e1229d0
  Author: Warner Losh <imp@FreeBSD.org>
  Date:   2021-09-10 (Fri, 10 Sep 2021)

  Changed paths:
    M bsd-user/mmap.c

  Log Message:
  -----------
  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>


  Commit: e4442059ddcc985207ac857a9509a606fe4bd179
      
https://github.com/qemu/qemu/commit/e4442059ddcc985207ac857a9509a606fe4bd179
  Author: Warner Losh <imp@FreeBSD.org>
  Date:   2021-09-10 (Fri, 10 Sep 2021)

  Changed paths:
    A bsd-user/i386/target_arch_reg.h
    A bsd-user/x86_64/target_arch_reg.h

  Log Message:
  -----------
  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>


  Commit: 25fb5d383d0713fa07d7a3518f8f993841e4e73b
      
https://github.com/qemu/qemu/commit/25fb5d383d0713fa07d7a3518f8f993841e4e73b
  Author: Warner Losh <imp@FreeBSD.org>
  Date:   2021-09-10 (Fri, 10 Sep 2021)

  Changed paths:
    A bsd-user/freebsd/target_os_user.h

  Log Message:
  -----------
  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>


  Commit: 0475f8fac5b576597a50104050451e4ce4fcfc20
      
https://github.com/qemu/qemu/commit/0475f8fac5b576597a50104050451e4ce4fcfc20
  Author: Warner Losh <imp@FreeBSD.org>
  Date:   2021-09-10 (Fri, 10 Sep 2021)

  Changed paths:
    A bsd-user/elfcore.c
    M bsd-user/elfload.c
    M bsd-user/qemu.h

  Log Message:
  -----------
  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>


  Commit: 0456a1772b479eada7160509e21f7e3a613f70e6
      
https://github.com/qemu/qemu/commit/0456a1772b479eada7160509e21f7e3a613f70e6
  Author: Warner Losh <imp@FreeBSD.org>
  Date:   2021-09-10 (Fri, 10 Sep 2021)

  Changed paths:
    M bsd-user/elfload.c

  Log Message:
  -----------
  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>


  Commit: c09f12feba6ed3faf06a2a22a988c4428a18eb51
      
https://github.com/qemu/qemu/commit/c09f12feba6ed3faf06a2a22a988c4428a18eb51
  Author: Warner Losh <imp@FreeBSD.org>
  Date:   2021-09-10 (Fri, 10 Sep 2021)

  Changed paths:
    M bsd-user/elfload.c

  Log Message:
  -----------
  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>


  Commit: f0f7f9dca986bebf2a0b88dd83f84f5e39a61462
      
https://github.com/qemu/qemu/commit/f0f7f9dca986bebf2a0b88dd83f84f5e39a61462
  Author: Warner Losh <imp@FreeBSD.org>
  Date:   2021-09-10 (Fri, 10 Sep 2021)

  Changed paths:
    M bsd-user/main.c

  Log Message:
  -----------
  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>


  Commit: 63cca1067ac70df2d71c0064f7bf53e19334223c
      
https://github.com/qemu/qemu/commit/63cca1067ac70df2d71c0064f7bf53e19334223c
  Author: Warner Losh <imp@FreeBSD.org>
  Date:   2021-09-10 (Fri, 10 Sep 2021)

  Changed paths:
    M bsd-user/main.c

  Log Message:
  -----------
  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>


  Commit: b8012648b38274aa996f1477c422a79e2d44110b
      
https://github.com/qemu/qemu/commit/b8012648b38274aa996f1477c422a79e2d44110b
  Author: Colin Percival <cperciva@tarsnap.com>
  Date:   2021-09-10 (Fri, 10 Sep 2021)

  Changed paths:
    M bsd-user/main.c

  Log Message:
  -----------
  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>


  Commit: be04f210f954bed8663943a94ece50c2ca410231
      
https://github.com/qemu/qemu/commit/be04f210f954bed8663943a94ece50c2ca410231
  Author: Warner Losh <imp@FreeBSD.org>
  Date:   2021-09-10 (Fri, 10 Sep 2021)

  Changed paths:
    M bsd-user/main.c
    M bsd-user/mmap.c
    M bsd-user/qemu.h

  Log Message:
  -----------
  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>


  Commit: 99c44988d5ba1866a411450c877ed818b1b70081
      
https://github.com/qemu/qemu/commit/99c44988d5ba1866a411450c877ed818b1b70081
  Author: Peter Maydell <peter.maydell@linaro.org>
  Date:   2021-09-11 (Sat, 11 Sep 2021)

  Changed paths:
    R bsd-user/bsd-mman.h
    M bsd-user/bsdload.c
    A bsd-user/elfcore.c
    M bsd-user/elfload.c
    A bsd-user/freebsd/host-os.h
    A bsd-user/freebsd/target_os_elf.h
    A bsd-user/freebsd/target_os_siginfo.h
    A bsd-user/freebsd/target_os_signal.h
    A bsd-user/freebsd/target_os_stack.h
    A bsd-user/freebsd/target_os_thread.h
    A bsd-user/freebsd/target_os_user.h
    A bsd-user/freebsd/target_os_vmparam.h
    A bsd-user/i386/target_arch.h
    A bsd-user/i386/target_arch_cpu.c
    A bsd-user/i386/target_arch_cpu.h
    A bsd-user/i386/target_arch_elf.h
    A bsd-user/i386/target_arch_reg.h
    A bsd-user/i386/target_arch_signal.h
    A bsd-user/i386/target_arch_sigtramp.h
    A bsd-user/i386/target_arch_thread.h
    A bsd-user/i386/target_arch_vmparam.h
    M bsd-user/main.c
    M bsd-user/mmap.c
    A bsd-user/netbsd/host-os.h
    A bsd-user/netbsd/target_os_elf.h
    A bsd-user/netbsd/target_os_siginfo.h
    A bsd-user/netbsd/target_os_signal.h
    A bsd-user/netbsd/target_os_stack.h
    A bsd-user/netbsd/target_os_thread.h
    A bsd-user/openbsd/host-os.h
    A bsd-user/openbsd/target_os_elf.h
    A bsd-user/openbsd/target_os_siginfo.h
    A bsd-user/openbsd/target_os_signal.h
    A bsd-user/openbsd/target_os_stack.h
    A bsd-user/openbsd/target_os_thread.h
    M bsd-user/qemu.h
    R bsd-user/sparc/target_arch_sysarch.h
    R bsd-user/sparc/target_syscall.h
    R bsd-user/sparc64/target_arch_sysarch.h
    R bsd-user/sparc64/target_syscall.h
    M bsd-user/syscall.c
    M bsd-user/syscall_defs.h
    A bsd-user/x86_64/target_arch.h
    A bsd-user/x86_64/target_arch_cpu.c
    A bsd-user/x86_64/target_arch_cpu.h
    A bsd-user/x86_64/target_arch_elf.h
    A bsd-user/x86_64/target_arch_reg.h
    A bsd-user/x86_64/target_arch_signal.h
    A bsd-user/x86_64/target_arch_sigtramp.h
    A bsd-user/x86_64/target_arch_thread.h
    A bsd-user/x86_64/target_arch_vmparam.h
    M configure
    M meson.build

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/bsdimp/tags/pull-bsd-user-20210910' 
into staging

This series of patches gets me to the point that I can run "Hello World" on i386
and x86_64. This is for static binaries only, that are relatively small, but
it's better than the 100% instant mmap failre that is the current state of all
things bsd-user in upstream qemu. Future patch sets will refine this, add
the missing system calls, fix bugs preventing more sophisticated programms
from running and add a bunch of new architecture support.

There's three large themes in these patches, though the changes that
represent them are interrelated making it hard to separate out further.
1. Reorganization to support multiple OS and architectures (though I've only
   tested FreeBSD, other BSDs might not even compile yet).
2. Diff reduction with the bsd-user fork for several files. These diffs include
   changes that borrowed from linux-user as well as changes to make things work
   on FreeBSD. The records keeping when this was done, however, was poor at
   best, so many of the specific borrowings are going unacknowledged here, apart
   from this general ack. These diffs also include some minor code shuffling.
   Some of the changes are done specifically to make it easier to rebase
   the bsd-user fork's changes when these land in the tree (a number of changes
   have been pushed there to make this more possible).
3. Filling in the missing pieces to make things work. There's many changes to
   elfload to make it load things in the right places, to find the interpreter
   better, etc. There's changes to mmap.c to make the mappings work better and
   there's changes to main.c that were inspired, at least, by now-ancient 
changes
   to linux-user's main.c.

I ran checkpatch.pl on this, and there's 350-odd errors it identifies (the vast
majoirty come from BSD's fetish for tabs), so there will need to be a V2 to fix
this at the very least. In addition, the change set is big (about +~4.5k/-~2.5k
lines), so I anticipate some iteration as well just based on its sheer
size. I've tried to keep each set small to make it easy to review in isolation,
but I've also allowed some interrelated ones to get a little bigger than I'd
normally like. I've not done the customary documentation of the expected
checkpatch.pl output because it is large, and because I wanted to get review
of the other parts rolling to get this project unstuck. Future versions of the
patch will document the expected output.

In addition, I noticed a number of places where I could modernize to make the
code match things like linux-user better. I've resisted the urge to do these at
this time, since it would complicate merging the other ~30k lines of diff that
remains after this batch. Future batches should generally be smaller once this
one has landed since they are, by and large, either a bunch of new files to
support armv7, aarch64, riscv64, mips, mipsel, mips64, ppc, ppc64 and ppc64le,
or are adding system calls, which can be done individually or small groups. I've
removed sparc and sparc64 support as they've been removed from FreeBSD and
have been near totally busted for years.

Stacey Son did the bulk of this work originally, but since I had to move things
around so much and/or retool that work in non-trivial ways, I've kept myself as
author, and added his signed-off-by line. I'm unsure of the qemu standard
practice for this, but am happy to learn if this is too far outside its current
mainstream. For a while Sean Bruno did the merges from upstream, and he's
credited using his signed-off-by in appropriate places, though for this patch
set there's only a few. I've tried to ensure that others who have work in
individual patches that I've aggregated together also are reflected in their
signed-off-by. Given the chaotic stat of the upstream repo for its early
history, this may be the best that can be reconstructed at this late date. Most
of these files are 'foundational' so have existed from the earliest days when
record keeping wasn't quite what I'd wish for in hindsight. There was only
really one change that I could easily cherry-pick (Colin's), so I did that.

# gpg: Signature made Fri 10 Sep 2021 21:24:08 BST
# gpg:                using RSA key 2035F894B00AA3CF7CCDE1B76C1CD1287DB01100
# gpg: Good signature from "Warner Losh <wlosh@netflix.com>" [unknown]
# gpg:                 aka "Warner Losh <imp@bsdimp.com>" [unknown]
# gpg:                 aka "Warner Losh <imp@freebsd.org>" [unknown]
# gpg:                 aka "Warner Losh <imp@village.org>" [unknown]
# gpg:                 aka "Warner Losh <wlosh@bsdimp.com>" [unknown]
# gpg: WARNING: This key is not certified with a trusted signature!
# gpg:          There is no indication that the signature belongs to the owner.
# Primary key fingerprint: 2035 F894 B00A A3CF 7CCD  E1B7 6C1C D128 7DB0 1100

* remotes/bsdimp/tags/pull-bsd-user-20210910: (42 commits)
  bsd-user: Update mapping to handle reserved and starting conditions
  bsd-user: Add '-0 argv0' option to bsd-user/main.c
  bsd-user: Implement interlock for atomic operations
  bsd-user: move gemu_log to later in the file
  bsd-user: Refactor load_elf_sections and is_target_elf_binary
  bsd-user: elfload.c style catch up patch
  bsd-user: add stubbed out core dump support
  bsd-user: Add target_os_user.h to capture the user/kernel structures
  bsd-user: Add target_arch_reg to describe a target's register set
  bsd-user: update debugging in mmap.c
  bsd-user: Rewrite target system call definintion glue
  bsd-user: Remove dead #ifdefs from elfload.c
  bsd-user: elf cleanup
  bsd-user: Add architecture specific signal tramp code
  bsd-user: Move stack initializtion into a per-os file.
  bsd-user: Implement --seed and initialize random state
  bsd-user: *BSD specific siginfo defintions
  bsd-user: Add system independent stack, data and text limiting
  bsd-user: Create target specific vmparam.h
  bsd-user: define max args in terms of pages
  ...

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>


Compare: https://github.com/qemu/qemu/compare/3bb60406639d...99c44988d5ba



reply via email to

[Prev in Thread] Current Thread [Next in Thread]