qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] d19401: bsd-user/main.c: Drop syscall flavor


From: Peter Maydell
Subject: [Qemu-commits] [qemu/qemu] d19401: bsd-user/main.c: Drop syscall flavor arg -bsd
Date: Tue, 01 Mar 2022 11:49:11 -0800

  Branch: refs/heads/staging
  Home:   https://github.com/qemu/qemu
  Commit: d19401825d17e484a9cbddf90902c99c9c75cf35
      
https://github.com/qemu/qemu/commit/d19401825d17e484a9cbddf90902c99c9c75cf35
  Author: Warner Losh <imp@bsdimp.com>
  Date:   2022-02-26 (Sat, 26 Feb 2022)

  Changed paths:
    M bsd-user/main.c

  Log Message:
  -----------
  bsd-user/main.c: Drop syscall flavor arg -bsd

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>


  Commit: 872b349f61c6262206595036cfd1f5ad5877d081
      
https://github.com/qemu/qemu/commit/872b349f61c6262206595036cfd1f5ad5877d081
  Author: Warner Losh <imp@bsdimp.com>
  Date:   2022-02-26 (Sat, 26 Feb 2022)

  Changed paths:
    M bsd-user/x86_64/target_arch_cpu.h

  Log Message:
  -----------
  bsd-user/x86_64/target_arch_cpu.h: int $80 never was a BSD system call on 
amd64

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>


  Commit: 2614aed71e44660a1edd6b05027c0ab028e8efd5
      
https://github.com/qemu/qemu/commit/2614aed71e44660a1edd6b05027c0ab028e8efd5
  Author: Warner Losh <imp@bsdimp.com>
  Date:   2022-02-26 (Sat, 26 Feb 2022)

  Changed paths:
    M bsd-user/x86_64/target_arch_cpu.h

  Log Message:
  -----------
  bsd-user/x86_64/target_arch_cpu.h: Remove openbsd syscall

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>


  Commit: 8f4b48164f13dbc3d19946e22b1ef77064bfa979
      
https://github.com/qemu/qemu/commit/8f4b48164f13dbc3d19946e22b1ef77064bfa979
  Author: Warner Losh <imp@bsdimp.com>
  Date:   2022-02-26 (Sat, 26 Feb 2022)

  Changed paths:
    M bsd-user/i386/target_arch_cpu.h

  Log Message:
  -----------
  bsd-user/i386/target_arch_cpu.h: Remove openbsd syscall

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>


  Commit: e555e709bb0ad6238a6caf3301838ac550713693
      
https://github.com/qemu/qemu/commit/e555e709bb0ad6238a6caf3301838ac550713693
  Author: Warner Losh <imp@bsdimp.com>
  Date:   2022-02-26 (Sat, 26 Feb 2022)

  Changed paths:
    M bsd-user/arm/target_arch_cpu.h

  Log Message:
  -----------
  bsd-user/arm/target_arch_cpu.h: Only support FreeBSD sys calls

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>


  Commit: f1f22450e2bce1d3ca91f8e2c2514da7bff37fdd
      
https://github.com/qemu/qemu/commit/f1f22450e2bce1d3ca91f8e2c2514da7bff37fdd
  Author: Warner Losh <imp@bsdimp.com>
  Date:   2022-02-26 (Sat, 26 Feb 2022)

  Changed paths:
    M bsd-user/arm/target_arch_thread.h

  Log Message:
  -----------
  bsd-user/arm/target_arch_thread.h: Assume a FreeBSD target

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>


  Commit: 0724067284fad14e23ce5286f3b9cb6e4e16d1a7
      
https://github.com/qemu/qemu/commit/0724067284fad14e23ce5286f3b9cb6e4e16d1a7
  Author: Warner Losh <imp@bsdimp.com>
  Date:   2022-02-26 (Sat, 26 Feb 2022)

  Changed paths:
    M bsd-user/x86_64/target_arch_thread.h

  Log Message:
  -----------
  bsd-user/x86_64/target_arch_thread.h: Assume a FreeBSD target

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>


  Commit: a941a16f6f52b287df2d2aa307cc81ee207c42a1
      
https://github.com/qemu/qemu/commit/a941a16f6f52b287df2d2aa307cc81ee207c42a1
  Author: Warner Losh <imp@bsdimp.com>
  Date:   2022-02-26 (Sat, 26 Feb 2022)

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

  Log Message:
  -----------
  bsd-user: Remove bsd_type

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>


  Commit: 66eed099f46f4c8749e0a509197a18c0d064b761
      
https://github.com/qemu/qemu/commit/66eed099f46f4c8749e0a509197a18c0d064b761
  Author: Warner Losh <imp@bsdimp.com>
  Date:   2022-02-26 (Sat, 26 Feb 2022)

  Changed paths:
    A bsd-user/freebsd/os-syscall.c

  Log Message:
  -----------
  bsd-user/freebsd/os-syscall.c: Move syscall processing here

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>


  Commit: a1ea19481fb2d4db5fcf9b2362a4826efb65b328
      
https://github.com/qemu/qemu/commit/a1ea19481fb2d4db5fcf9b2362a4826efb65b328
  Author: Warner Losh <imp@bsdimp.com>
  Date:   2022-02-26 (Sat, 26 Feb 2022)

  Changed paths:
    M bsd-user/freebsd/meson.build
    M bsd-user/meson.build

  Log Message:
  -----------
  bsd-user: Move system call building to os-syscall.c

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


  Commit: 304f944e51045176e8c55a8c8cb054ca5b2c8a23
      
https://github.com/qemu/qemu/commit/304f944e51045176e8c55a8c8cb054ca5b2c8a23
  Author: Warner Losh <imp@bsdimp.com>
  Date:   2022-02-26 (Sat, 26 Feb 2022)

  Changed paths:
    R bsd-user/syscall.c

  Log Message:
  -----------
  bsd-user/sycall.c: Now obsolete, remove

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


  Commit: deeff83b47683a078c7f2ff057f4388258246f55
      
https://github.com/qemu/qemu/commit/deeff83b47683a078c7f2ff057f4388258246f55
  Author: Warner Losh <imp@bsdimp.com>
  Date:   2022-02-26 (Sat, 26 Feb 2022)

  Changed paths:
    M bsd-user/freebsd/os-syscall.c
    M bsd-user/qemu.h

  Log Message:
  -----------
  bsd-user/freebsd/os-syscall.c: Add get_errno and host_to_target_errno

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>


  Commit: c5c84d16519abf3909bad77ef03db36801f560d5
      
https://github.com/qemu/qemu/commit/c5c84d16519abf3909bad77ef03db36801f560d5
  Author: Warner Losh <imp@bsdimp.com>
  Date:   2022-02-26 (Sat, 26 Feb 2022)

  Changed paths:
    A bsd-user/bsd-file.h
    M bsd-user/freebsd/os-syscall.c

  Log Message:
  -----------
  bsd-user/bsd-file.h: Implementation details for the filesystem calls

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>


  Commit: 647afdf1836548146b77c6ca68e93c7acfe35738
      
https://github.com/qemu/qemu/commit/647afdf1836548146b77c6ca68e93c7acfe35738
  Author: Warner Losh <imp@bsdimp.com>
  Date:   2022-02-26 (Sat, 26 Feb 2022)

  Changed paths:
    A bsd-user/arm/target.h
    A bsd-user/i386/target.h
    M bsd-user/qemu.h
    A bsd-user/x86_64/target.h

  Log Message:
  -----------
  bsd-user: introduce target.h

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>


  Commit: 0ff0508286106c2b71cdc8e83e5ad93003b91be4
      
https://github.com/qemu/qemu/commit/0ff0508286106c2b71cdc8e83e5ad93003b91be4
  Author: Warner Losh <imp@bsdimp.com>
  Date:   2022-02-26 (Sat, 26 Feb 2022)

  Changed paths:
    M bsd-user/qemu.h

  Log Message:
  -----------
  bsd-user: Define target_arg64

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>


  Commit: a5b8816636ebd7665d96122c5568192e04c5a888
      
https://github.com/qemu/qemu/commit/a5b8816636ebd7665d96122c5568192e04c5a888
  Author: Warner Losh <imp@bsdimp.com>
  Date:   2022-02-26 (Sat, 26 Feb 2022)

  Changed paths:
    M bsd-user/syscall_defs.h

  Log Message:
  -----------
  bsd-user: Add safe system call macros

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>


  Commit: c26fc53906b175b3639e030a287e7188534009b9
      
https://github.com/qemu/qemu/commit/c26fc53906b175b3639e030a287e7188534009b9
  Author: Peter Maydell <peter.maydell@linaro.org>
  Date:   2022-03-01 (Tue, 01 Mar 2022)

  Changed paths:
    A bsd-user/arm/target.h
    M bsd-user/arm/target_arch_cpu.h
    M bsd-user/arm/target_arch_thread.h
    A bsd-user/bsd-file.h
    M bsd-user/freebsd/meson.build
    A bsd-user/freebsd/os-syscall.c
    A bsd-user/i386/target.h
    M bsd-user/i386/target_arch_cpu.h
    M bsd-user/main.c
    M bsd-user/meson.build
    M bsd-user/qemu.h
    R bsd-user/syscall.c
    M bsd-user/syscall_defs.h
    A bsd-user/x86_64/target.h
    M bsd-user/x86_64/target_arch_cpu.h
    M bsd-user/x86_64/target_arch_thread.h

  Log Message:
  -----------
  Merge remote-tracking branch 
'remotes/bsdimp/tags/bsd-user-preen-2022q1-pull-request' into staging

bsd-user: Prepare for future upstream of system calls.

This series of patches does three things.

First, it starts to give up on the idea that you can run FooBSD binaries on
BarBSD. They are too different to make that happen any time soon, though I've
kept the support for Net/OpenBSD, even though they haven't built. We'll need a
lot of work to make that happen, though, and I need to simplify to get things
upstream.

Second, it starts to move some of the ifdef trees into target.h.

Third, it starts to upstream bsd-file.h, but the remainder of the file in the
bsd-user fork had some issues that will be resolved before next quarter's
update.

# gpg: Signature made Mon 28 Feb 2022 18:11:47 GMT
# 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/bsd-user-preen-2022q1-pull-request:
  bsd-user: Add safe system call macros
  bsd-user: Define target_arg64
  bsd-user: introduce target.h
  bsd-user/bsd-file.h: Implementation details for the filesystem calls
  bsd-user/freebsd/os-syscall.c: Add get_errno and host_to_target_errno
  bsd-user/sycall.c: Now obsolete, remove
  bsd-user: Move system call building to os-syscall.c
  bsd-user/freebsd/os-syscall.c: Move syscall processing here
  bsd-user: Remove bsd_type
  bsd-user/x86_64/target_arch_thread.h: Assume a FreeBSD target
  bsd-user/arm/target_arch_thread.h: Assume a FreeBSD target
  bsd-user/arm/target_arch_cpu.h: Only support FreeBSD sys calls
  bsd-user/i386/target_arch_cpu.h: Remove openbsd syscall
  bsd-user/x86_64/target_arch_cpu.h: Remove openbsd syscall
  bsd-user/x86_64/target_arch_cpu.h: int $80 never was a BSD system call on 
amd64
  bsd-user/main.c: Drop syscall flavor arg -bsd

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


Compare: https://github.com/qemu/qemu/compare/09591fcf6eb3...c26fc53906b1



reply via email to

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