mbox

[PULL,00/14] Bsd user for 9.1 patches

Message ID 20240723180725.99114-1-imp@bsdimp.com
State New
Headers show

Pull-request

git@gitlab.com:bsdimp/qemu.git tags/bsd-user-for-9.1-pull-request

Message

Warner Losh July 23, 2024, 6:07 p.m. UTC
The following changes since commit 3cce8bd4d737f2ca688bbdcb92cd5cc683245bbd:

  Merge tag 'ui-pull-request' of https://gitlab.com/marcandre.lureau/qemu into staging (2024-07-23 15:23:05 +1000)

are available in the Git repository at:

  git@gitlab.com:bsdimp/qemu.git tags/bsd-user-for-9.1-pull-request

for you to fetch changes up to afdb6be1bd8528395af65a087bd668bf7a42ab99:

  bsd-user: Add aarch64 build to tree (2024-07-23 10:56:30 -0600)

----------------------------------------------------------------
bsd-user: Misc changes for 9.1 (I hope)

This patch series includes two main sets of patches. To make it simple to
review, I've included the changes from my student which the later changes depend
on. I've included a change from Jessica and Doug as well. I've reviewed them,
but more eyes never hurt.

I've also included a number of 'touch up' patches needed either to get the
aarch64 building, or to implmement suggestions from prior review cycles. The
main one is what's charitably described as a kludge: force aarch64 to use 4k
pages. The qemu-project (and blitz branch) hasn't had the necessary changes to
bsd-user needed to support variable page size.

Sorry this is so late... Live has conspired to delay me.
-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - https://gpgtools.org

iQIzBAABCgAdFiEEIDX4lLAKo898zeG3bBzRKH2wEQAFAmaf8RUACgkQbBzRKH2w
EQAnYA/9F6NbHwV8C6c5zxiKR2PIXvER21khu+c3wwCMgm+Sy4yEIJxtX+L0St1I
7L4MkgSByeOJmAmw1h0xbWY4IGmTC0ylnyPLq4WIKHP2XnGgs2zYx/CWpEs20QWH
bORg7KXpmTsK3Ag0ilQHTH7HspW3xhZGia4C0uaxYU+E3nns04Mp/TFzbLxq1VfP
xJ8DKjVS39StoBjaWlkKN4TnmD1eXPl4WC+9aElVZJX5DicJHN2Cz3sjIZppJOFg
AXBdeKUXBh5o2oxxRxIv5P/wUROl5NuOpEzE80Ed3B4okbzXdIbsYA07t+UlcoXk
2YMEWfzPmH8nveD5w8T3YtVAlzEJMjWgVeFZg43lT+aHktX3ixstQUkumzAm3A1Z
1TsXtP4D4ZRgeH991V+ZbA/2D0mxg03Z5kldw+jcoYUkjQNOMEy/i0ewNPhX4V/d
l+YIeoxXEu06/v+ibjzL3/WMEvSofYw9nK3/BNGE9rfsNh8tKTFh8Ro+i6wQgKBB
XOgQeuv+X1nwQ1xeZvl8uunFxN5yJqTyw2O6JN6z+3xnPMnBGz8yvkipdQPv5yRg
GJEau8H0C9xesaCtURwNX0AC9BrZpoZ8/5zuLE9MGyyXuoN6jBkt/k6z+e4EL1j5
x7Ezp+srEhlG+g+yozgeDIk3W0YdCPDwBNKDvzwSuNS5prLMrg8=
=Bdnq
-----END PGP SIGNATURE-----

----------------------------------------------------------------

Doug Rabson (1):
  bsd-user: Simplify the implementation of execve

Jessica Clarke (1):
  bsd-user: Sync fork_start/fork_end with linux-user

Stacey Son (6):
  bsd-user:Add CPU initialization and management functions
  bsd-user:Add AArch64 register handling and related functions
  bsd-user:Add ARM AArch64 signal handling support
  bsd-user:Add get_mcontext function for ARM AArch64
  bsd-user:Add set_mcontext function for ARM AArch64
  bsd-user:Add AArch64 improvements and signal handling functions

Warner Losh (6):
  bsd-user:Add ARM AArch64 support and capabilities
  bsd-user:Add setup_sigframe_arch function for ARM AArch64
  bsd-user: Hard wire aarch64 to be 4k pages only
  bsd-user: Define TARGET_SIGSTACK_ALIGN and use it to round stack
  bsd-user: Make compile for non-linux user-mode stuff
  bsd-user: Add aarch64 build to tree

 bsd-user/aarch64/signal.c               | 137 +++++++++++++++++
 bsd-user/aarch64/target_arch.h          |  29 ++++
 bsd-user/aarch64/target_arch_cpu.c      |  31 ++++
 bsd-user/aarch64/target_arch_cpu.h      | 189 ++++++++++++++++++++++++
 bsd-user/aarch64/target_arch_elf.h      | 163 ++++++++++++++++++++
 bsd-user/aarch64/target_arch_reg.h      |  56 +++++++
 bsd-user/aarch64/target_arch_signal.h   |  82 ++++++++++
 bsd-user/aarch64/target_arch_sigtramp.h |  48 ++++++
 bsd-user/aarch64/target_arch_sysarch.h  |  42 ++++++
 bsd-user/aarch64/target_arch_thread.h   |  61 ++++++++
 bsd-user/aarch64/target_arch_vmparam.h  |  74 ++++++++++
 bsd-user/aarch64/target_syscall.h       |  51 +++++++
 bsd-user/arm/target_arch_signal.h       |   2 +
 bsd-user/freebsd/os-proc.c              | 118 +--------------
 bsd-user/i386/target_arch_signal.h      |   2 +
 bsd-user/main.c                         |  44 ++----
 bsd-user/qemu.h                         |   3 +
 bsd-user/signal.c                       |   9 +-
 bsd-user/x86_64/target_arch_signal.h    |   2 +
 configs/targets/aarch64-bsd-user.mak    |   3 +
 target/arm/cpu-param.h                  |   4 +
 target/arm/gdbstub64.c                  |   4 +
 22 files changed, 1001 insertions(+), 153 deletions(-)
 create mode 100644 bsd-user/aarch64/signal.c
 create mode 100644 bsd-user/aarch64/target_arch.h
 create mode 100644 bsd-user/aarch64/target_arch_cpu.c
 create mode 100644 bsd-user/aarch64/target_arch_cpu.h
 create mode 100644 bsd-user/aarch64/target_arch_elf.h
 create mode 100644 bsd-user/aarch64/target_arch_reg.h
 create mode 100644 bsd-user/aarch64/target_arch_signal.h
 create mode 100644 bsd-user/aarch64/target_arch_sigtramp.h
 create mode 100644 bsd-user/aarch64/target_arch_sysarch.h
 create mode 100644 bsd-user/aarch64/target_arch_thread.h
 create mode 100644 bsd-user/aarch64/target_arch_vmparam.h
 create mode 100644 bsd-user/aarch64/target_syscall.h
 create mode 100644 configs/targets/aarch64-bsd-user.mak

Comments

Richard Henderson July 24, 2024, 8:55 a.m. UTC | #1
On 7/24/24 04:07, Warner Losh wrote:
> The following changes since commit 3cce8bd4d737f2ca688bbdcb92cd5cc683245bbd:
> 
>    Merge tag 'ui-pull-request' ofhttps://gitlab.com/marcandre.lureau/qemu into staging (2024-07-23 15:23:05 +1000)
> 
> are available in the Git repository at:
> 
>    git@gitlab.com:bsdimp/qemu.git tags/bsd-user-for-9.1-pull-request
> 
> for you to fetch changes up to afdb6be1bd8528395af65a087bd668bf7a42ab99:
> 
>    bsd-user: Add aarch64 build to tree (2024-07-23 10:56:30 -0600)
> 
> ----------------------------------------------------------------
> bsd-user: Misc changes for 9.1 (I hope)
> 
> This patch series includes two main sets of patches. To make it simple to
> review, I've included the changes from my student which the later changes depend
> on. I've included a change from Jessica and Doug as well. I've reviewed them,
> but more eyes never hurt.
> 
> I've also included a number of 'touch up' patches needed either to get the
> aarch64 building, or to implmement suggestions from prior review cycles. The
> main one is what's charitably described as a kludge: force aarch64 to use 4k
> pages. The qemu-project (and blitz branch) hasn't had the necessary changes to
> bsd-user needed to support variable page size.
> 
> Sorry this is so late... Live has conspired to delay me.

Something didn't get committed properly, as it doesn't build:

$ ninja
[343/1144] Compiling C object 
libqemu-aarch64-bsd-user.a.p/bsd-user_aarch64_target_arch_cpu.c.o
FAILED: libqemu-aarch64-bsd-user.a.p/bsd-user_aarch64_target_arch_cpu.c.o
cc -m64 -Ilibqemu-aarch64-bsd-user.a.p -I. -I../src -Itarget/arm -I../src/target/arm 
-I../src/common-user/host/x86_64 -I../src/bsd-user/include -Ibsd-user/freebsd 
-I../src/bsd-user/freebsd -I../src/bsd-user/host/x86_64 -Ibsd-user -I../src/bsd-user 
-I../src/bsd-user/aarch64 -Iqapi -Itrace -Iui/shader -I/usr/local/include/capstone 
-I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include 
-fdiagnostics-color=auto -Wall -Winvalid-pch -std=gnu11 -O2 -g -fstack-protector-strong 
-Wempty-body -Wendif-labels -Wexpansion-to-defined -Wformat-security -Wformat-y2k 
-Wignored-qualifiers -Winit-self -Wmissing-format-attribute -Wmissing-prototypes 
-Wnested-externs -Wold-style-definition -Wredundant-decls -Wstrict-prototypes 
-Wtype-limits -Wundef -Wvla -Wwrite-strings -Wno-gnu-variable-sized-type-not-at-end 
-Wno-initializer-overrides -Wno-missing-include-dirs -Wno-psabi -Wno-shift-negative-value 
-Wno-string-plus-int -Wno-tautological-type-limit-compare -Wno-typedef-redefinition 
-Wthread-safety -iquote . -iquote /home/rth/qemu/src -iquote /home/rth/qemu/src/include 
-iquote /home/rth/qemu/src/host/include/x86_64 -iquote 
/home/rth/qemu/src/host/include/generic -iquote /home/rth/qemu/src/tcg/i386 -pthread 
-msse2 -mcx16 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE 
-fno-strict-aliasing -fno-common -fwrapv -ftrivial-auto-var-init=zero 
-fzero-call-used-regs=used-gpr -fPIE -DCOMPILING_PER_TARGET 
'-DCONFIG_TARGET="aarch64-bsd-user-config-target.h"' 
'-DCONFIG_DEVICES="aarch64-bsd-user-config-devices.h"' -MD -MQ 
libqemu-aarch64-bsd-user.a.p/bsd-user_aarch64_target_arch_cpu.c.o -MF 
libqemu-aarch64-bsd-user.a.p/bsd-user_aarch64_target_arch_cpu.c.o.d -o 
libqemu-aarch64-bsd-user.a.p/bsd-user_aarch64_target_arch_cpu.c.o -c 
../src/bsd-user/aarch64/target_arch_cpu.c
In file included from ../src/bsd-user/aarch64/target_arch_cpu.c:20:
In file included from ../src/bsd-user/aarch64/target_arch.h:23:
../src/bsd-user/qemu.h:38:10: fatal error: 'target.h' file not found
    38 | #include "target.h"
       |          ^~~~~~~~~~
1 error generated.


r~
Warner Losh July 24, 2024, 8:25 p.m. UTC | #2
On Wed, Jul 24, 2024 at 2:55 AM Richard Henderson <
richard.henderson@linaro.org> wrote:

> On 7/24/24 04:07, Warner Losh wrote:
> > The following changes since commit
> 3cce8bd4d737f2ca688bbdcb92cd5cc683245bbd:
> >
> >    Merge tag 'ui-pull-request' ofhttps://
> gitlab.com/marcandre.lureau/qemu into staging (2024-07-23 15:23:05 +1000)
> >
> > are available in the Git repository at:
> >
> >    git@gitlab.com:bsdimp/qemu.git tags/bsd-user-for-9.1-pull-request
> >
> > for you to fetch changes up to afdb6be1bd8528395af65a087bd668bf7a42ab99:
> >
> >    bsd-user: Add aarch64 build to tree (2024-07-23 10:56:30 -0600)
> >
> > ----------------------------------------------------------------
> > bsd-user: Misc changes for 9.1 (I hope)
> >
> > This patch series includes two main sets of patches. To make it simple to
> > review, I've included the changes from my student which the later
> changes depend
> > on. I've included a change from Jessica and Doug as well. I've reviewed
> them,
> > but more eyes never hurt.
> >
> > I've also included a number of 'touch up' patches needed either to get
> the
> > aarch64 building, or to implmement suggestions from prior review cycles.
> The
> > main one is what's charitably described as a kludge: force aarch64 to
> use 4k
> > pages. The qemu-project (and blitz branch) hasn't had the necessary
> changes to
> > bsd-user needed to support variable page size.
> >
> > Sorry this is so late... Live has conspired to delay me.
>
> Something didn't get committed properly, as it doesn't build:
>
> $ ninja
> [343/1144] Compiling C object
> libqemu-aarch64-bsd-user.a.p/bsd-user_aarch64_target_arch_cpu.c.o
> FAILED: libqemu-aarch64-bsd-user.a.p/bsd-user_aarch64_target_arch_cpu.c.o
> cc -m64 -Ilibqemu-aarch64-bsd-user.a.p -I. -I../src -Itarget/arm
> -I../src/target/arm
> -I../src/common-user/host/x86_64 -I../src/bsd-user/include
> -Ibsd-user/freebsd
> -I../src/bsd-user/freebsd -I../src/bsd-user/host/x86_64 -Ibsd-user
> -I../src/bsd-user
> -I../src/bsd-user/aarch64 -Iqapi -Itrace -Iui/shader
> -I/usr/local/include/capstone
> -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include
> -I/usr/local/include
> -fdiagnostics-color=auto -Wall -Winvalid-pch -std=gnu11 -O2 -g
> -fstack-protector-strong
> -Wempty-body -Wendif-labels -Wexpansion-to-defined -Wformat-security
> -Wformat-y2k
> -Wignored-qualifiers -Winit-self -Wmissing-format-attribute
> -Wmissing-prototypes
> -Wnested-externs -Wold-style-definition -Wredundant-decls
> -Wstrict-prototypes
> -Wtype-limits -Wundef -Wvla -Wwrite-strings
> -Wno-gnu-variable-sized-type-not-at-end
> -Wno-initializer-overrides -Wno-missing-include-dirs -Wno-psabi
> -Wno-shift-negative-value
> -Wno-string-plus-int -Wno-tautological-type-limit-compare
> -Wno-typedef-redefinition
> -Wthread-safety -iquote . -iquote /home/rth/qemu/src -iquote
> /home/rth/qemu/src/include
> -iquote /home/rth/qemu/src/host/include/x86_64 -iquote
> /home/rth/qemu/src/host/include/generic -iquote
> /home/rth/qemu/src/tcg/i386 -pthread
> -msse2 -mcx16 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
> -fno-strict-aliasing -fno-common -fwrapv -ftrivial-auto-var-init=zero
> -fzero-call-used-regs=used-gpr -fPIE -DCOMPILING_PER_TARGET
> '-DCONFIG_TARGET="aarch64-bsd-user-config-target.h"'
> '-DCONFIG_DEVICES="aarch64-bsd-user-config-devices.h"' -MD -MQ
> libqemu-aarch64-bsd-user.a.p/bsd-user_aarch64_target_arch_cpu.c.o -MF
> libqemu-aarch64-bsd-user.a.p/bsd-user_aarch64_target_arch_cpu.c.o.d -o
> libqemu-aarch64-bsd-user.a.p/bsd-user_aarch64_target_arch_cpu.c.o -c
> ../src/bsd-user/aarch64/target_arch_cpu.c
> In file included from ../src/bsd-user/aarch64/target_arch_cpu.c:20:
> In file included from ../src/bsd-user/aarch64/target_arch.h:23:
> ../src/bsd-user/qemu.h:38:10: fatal error: 'target.h' file not found
>     38 | #include "target.h"
>        |          ^~~~~~~~~~
> 1 error generated.
>

Doh! A missing git add indeed. That change didn't cherry-pick from blitz
(since
it was something I'd invented for an upstream review that didn't fold back
into
blitz properly and I didn't notice until I started prepping this series and
fixed it
in blitz)... I goofed up doing it by hand. Will send v2 out shortly.  Sorry
for the noise.

Warner