mbox series

[v4,0/7] iOS and Apple Silicon host support

Message ID 20201108052605.45840-1-j@getutm.app
Headers show
Series iOS and Apple Silicon host support | expand

Message

Joelle van Dyne Nov. 8, 2020, 5:25 a.m. UTC
Based-on: 20201106032921.600200-1-richard.henderson@linaro.org
([PATCH v3 00/41] Mirror map JIT memory for TCG)

These set of changes brings QEMU TCG to iOS devices and future Apple Silicon
devices. They were originally developed last year and have been working in the
UTM app. Recently, we ported the changes to master, re-wrote a lot of the build
script changes for meson, and broke up the patches into more distinct units.

A summary of the changes:

* `CONFIG_IOS` defined when building for iOS and iOS specific changes (as well
  as unsupported code) are gated behind it.
* A new dependency, libucontext is added since iOS does not have native ucontext
  and broken support for sigaltstack. libucontext is available as a new option
  for coroutine backend.
* For (recent) jailbroken iOS devices as well as upcoming Apple Silicon devices,
  there are new rules for applications supporting JIT (with the proper
  entitlement). These rules are implemented as well.

Since v4:

* Updated QAPI schema for CONFIG_HOST_BLOCK_DEVICE
* Updated maintainers file for iOS host support
* Moved system() changes to osdep.h
* Fixed typo in libucontext meson.build change

Since v3:

* Moved mirror JIT support to a different patch set.
* Removed dependency on `pthread_jit_write_protect_np` because it was redundent
  and also crashes if called on a non-jailbroken iOS device.
* Removed `--enable-cross-compile` option
* Fixed checkpatch errors
* Fixed iOS build on master due to new test recently added which calls system()

Since v2:

* Changed getting mirror pointer from a macro to inline functions
* Split constification of TCG code pointers to separate patch
* Removed slirp updates (will send future patch once slirp changes are in)
* Removed shared library patch (will send future patch)

-j

Joelle van Dyne (7):
  configure: option to disable host block devices
  configure: cross-compiling with empty cross_prefix
  qemu: add support for iOS host
  coroutine: add libucontext as external library
  slirp: update build flags for iOS resolv fix
  tcg: implement JIT for iOS and Apple Silicon
  block: check availablity for preadv/pwritev on mac

 docs/devel/index.rst        |  1 +
 docs/devel/ios.rst          | 28 ++++++++++++
 configure                   | 76 +++++++++++++++++++++++++++++---
 meson.build                 | 33 +++++++++++++-
 qapi/block-core.json        |  4 +-
 include/exec/exec-all.h     |  2 +
 include/qemu/osdep.h        | 11 +++++
 include/tcg/tcg-apple-jit.h | 86 +++++++++++++++++++++++++++++++++++++
 include/tcg/tcg.h           |  3 ++
 accel/tcg/cpu-exec-common.c |  2 +
 accel/tcg/cpu-exec.c        |  2 +
 accel/tcg/translate-all.c   | 46 ++++++++++++++++++++
 block.c                     |  2 +-
 block/file-posix.c          | 51 ++++++++++++++++------
 net/slirp.c                 | 16 +++----
 qga/commands-posix.c        |  6 +++
 tcg/tcg.c                   |  4 ++
 util/coroutine-ucontext.c   |  9 ++++
 .gitmodules                 |  3 ++
 MAINTAINERS                 |  7 +++
 libucontext                 |  1 +
 meson_options.txt           |  2 +
 tests/qtest/meson.build     |  7 ++-
 23 files changed, 367 insertions(+), 35 deletions(-)
 create mode 100644 docs/devel/ios.rst
 create mode 100644 include/tcg/tcg-apple-jit.h
 create mode 160000 libucontext

Comments

Thomas Huth Nov. 9, 2020, 6:52 p.m. UTC | #1
On 08/11/2020 06.26, Joelle van Dyne wrote:
> The iOS toolchain does not use the host prefix naming convention. So we need
> to enable cross-compile options while allowing the PREFIX to be blank.
> 
> Signed-off-by: Joelle van Dyne <j@getutm.app>
> ---
>  configure | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/configure b/configure
> index 97a879808d..fda7a875f7 100755
> --- a/configure
> +++ b/configure
> @@ -234,6 +234,7 @@ cpu=""
>  iasl="iasl"
>  interp_prefix="/usr/gnemul/qemu-%M"
>  static="no"
> +cross_compile="no"
>  cross_prefix=""
>  audio_drv_list=""
>  block_drv_rw_whitelist=""
> @@ -458,6 +459,7 @@ for opt do
>    optarg=$(expr "x$opt" : 'x[^=]*=\(.*\)')
>    case "$opt" in
>    --cross-prefix=*) cross_prefix="$optarg"
> +                    cross_compile="yes"
>    ;;
>    --cc=*) CC="$optarg"
>    ;;
> @@ -1657,7 +1659,7 @@ $(echo Available targets: $default_target_list | \
>    --target-list-exclude=LIST exclude a set of targets from the default target-list
>  
>  Advanced options (experts only):
> -  --cross-prefix=PREFIX    use PREFIX for compile tools [$cross_prefix]
> +  --cross-prefix=PREFIX    use PREFIX for compile tools, PREFIX can be blank [$cross_prefix]
>    --cc=CC                  use C compiler CC [$cc]
>    --iasl=IASL              use ACPI compiler IASL [$iasl]
>    --host-cc=CC             use C compiler CC [$host_cc] for code run at
> @@ -6933,7 +6935,7 @@ if has $sdl2_config; then
>  fi
>  echo "strip = [$(meson_quote $strip)]" >> $cross
>  echo "windres = [$(meson_quote $windres)]" >> $cross
> -if test -n "$cross_prefix"; then
> +if test "$cross_compile" = "yes"; then
>      cross_arg="--cross-file config-meson.cross"
>      echo "[host_machine]" >> $cross
>      if test "$mingw32" = "yes" ; then
> 

Reviewed-by: Thomas Huth <thuth@redhat.com>