Re: [PATCH 07/10] tcg: implement bulletproof JIT

2020-10-14 Thread Joelle van Dyne
* and tcg_code_ptr_rw() which returns void *. I'll go that route unless there's any objections? -j On Wed, Oct 14, 2020 at 2:49 PM Richard Henderson wrote: > > On 10/14/20 1:58 PM, Joelle van Dyne wrote: > > Much of the code that uses the macro is like the following (from >

Re: [PATCH 07/10] tcg: implement bulletproof JIT

2020-10-14 Thread Joelle van Dyne
er a macro but "inline" is not ANSI C. Not sure what this project thinks about that considering the style checker prohibits C99 style comments. Personally I don't care much. -j On Wed, Oct 14, 2020 at 1:35 PM Richard Henderson wrote: > > On 10/14/20 9:03 AM, Joelle van Dy

Re: [PATCH 06/10] coroutine: add libucontext as external library

2020-10-13 Thread Joelle van Dyne
ue, 13 Oct 2020, Stefan Hajnoczi wrote: > > On Mon, Oct 12, 2020 at 04:29:35PM -0700, Joelle van Dyne wrote: > >> From: osy > >> > >> iOS does not support ucontext natively for aarch64 and the sigaltstack is > >> also unsupported (even worse, it fails s

Re: [PATCH 09/10] tcg: support JIT on Apple Silicon

2020-10-13 Thread Joelle van Dyne
t 2020 at 14:58, Paolo Bonzini wrote: > > > > On 13/10/20 01:29, Joelle van Dyne wrote: > > > From: osy > > > > > > https://developer.apple.com/documentation/apple_silicon/porting_just-in-time_compilers_to_apple_silicon > > > > > > For <

Re: [PATCH 08/10] tcg: mirror mapping RWX pages for iOS optional

2020-10-13 Thread Joelle van Dyne
t 13, 2020 at 6:52 AM Paolo Bonzini wrote: > > On 13/10/20 01:29, Joelle van Dyne wrote: > > From: osy > > > > This allows jailbroken devices with entitlements to switch the option off. > > > > Signed-off-by: Joelle van Dyne > > --- > > What is the advantage in doing so? > > Paolo >

Re: [PATCH 04/10] meson: option to build as shared library

2020-10-13 Thread Joelle van Dyne
wrote: > > On Tue, Oct 13, 2020 at 04:41:06PM +0200, BALATON Zoltan wrote: > > On Tue, 13 Oct 2020, Daniel P. Berrangé wrote: > > > On Mon, Oct 12, 2020 at 04:29:33PM -0700, Joelle van Dyne wrote: > > > > From: osy > > > > > > > > On iOS, we

[PATCH 06/10] coroutine: add libucontext as external library

2020-10-12 Thread Joelle van Dyne
van Dyne --- .gitmodules | 3 +++ configure | 23 --- libucontext | 1 + meson.build | 29 - meson_options.txt | 2 ++ util/coroutine-ucontext.c | 9 + 6 files changed, 63

[PATCH 05/10] slirp: update for iOS resolv fix

2020-10-12 Thread Joelle van Dyne
From: osy We cannot access /etc/resolv.conf on iOS so libslirp is modified to use libresolv instead. Signed-off-by: Joelle van Dyne --- .gitmodules | 2 +- meson.build | 2 ++ slirp | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitmodules b/.gitmodules index

[PATCH 10/10] block: check availablity for preadv/pwritev on mac

2020-10-12 Thread Joelle van Dyne
From: osy macOS 11/iOS 14 added preadv/pwritev APIs. Due to weak linking, configure will succeed with CONFIG_PREADV even when targeting a lower OS version. We therefore need to check at run time if we can actually use these APIs. Signed-off-by: Joelle van Dyne --- block/file-posix.c | 12

[PATCH 01/10] configure: option to disable host block devices

2020-10-12 Thread Joelle van Dyne
From: osy Some hosts (iOS) have a sandboxed filesystem and do not provide low-level APIs for interfacing with host block devices. Signed-off-by: Joelle van Dyne --- block/file-posix.c | 8 +++- configure | 4 meson.build| 1 + 3 files changed, 12 insertions(+), 1

[PATCH 03/10] qemu: add support for iOS host

2020-10-12 Thread Joelle van Dyne
sys_icache_invalidate() instead of GCC builtin for iOS tests: disable tests on iOS which uses system() Signed-off-by: Joelle van Dyne --- block.c | 2 +- block/file-posix.c| 30 --- configure | 43

[PATCH 08/10] tcg: mirror mapping RWX pages for iOS optional

2020-10-12 Thread Joelle van Dyne
From: osy This allows jailbroken devices with entitlements to switch the option off. Signed-off-by: Joelle van Dyne --- accel/tcg/tcg-all.c | 27 +- accel/tcg/translate-all.c | 60 +-- bsd-user/main.c | 2 +- include/sysemu

[PATCH 00/10] iOS and Apple Silicon host support

2020-10-12 Thread Joelle van Dyne
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

[PATCH 07/10] tcg: implement bulletproof JIT

2020-10-12 Thread Joelle van Dyne
and then invalidate the instruction cache in the RX mapping (where applicable). Because data cache flush is OS defined on some architectures, we do not provide implementations for non iOS platforms (ARM/x86). Signed-off-by: Joelle van Dyne --- accel/tcg/cpu-exec.c | 7 +++- accel/tcg/translate-all.c

[PATCH 09/10] tcg: support JIT on Apple Silicon

2020-10-12 Thread Joelle van Dyne
ing. * JIT write-protect is disabled by cpu_loop_exit() for interrupt handling. * JIT write-protect is disabled everywhere else. Signed-off-by: Joelle van Dyne --- accel/tcg/cpu-exec-common.c | 2 + accel/tcg/cpu-exec.c| 2 + accel/tcg/translate-all.c | 51 ++ config

[PATCH 04/10] meson: option to build as shared library

2020-10-12 Thread Joelle van Dyne
-by: Joelle van Dyne --- configure | 14 -- meson.build | 40 ++-- meson_options.txt | 2 ++ 3 files changed, 48 insertions(+), 8 deletions(-) diff --git a/configure b/configure index c474d7c221..37b27d9e35 100755 --- a/configure +++ b

[PATCH 02/10] configure: cross-compiling without cross_prefix

2020-10-12 Thread Joelle van Dyne
From: osy The iOS toolchain does not use the host prefix naming convention. We add a new option `--enable-cross-compile` that forces cross-compile even without a cross_prefix. Signed-off-by: Joelle van Dyne --- configure | 13 - 1 file changed, 12 insertions(+), 1 deletion

Re: [PATCH 00/10] iOS and Apple Silicon host support

2020-10-12 Thread Joelle van Dyne
I did run the style check tool. Of the errors/warnings, a few are from code moved from one place to another, re-formatting the moved code seems to break another rule (don't include irrelevant changes). On Mon, Oct 12, 2020 at 6:21 PM wrote: > > Patchew URL:

[PATCH RESEND v2 1/9] configure: option to disable host block devices

2020-10-18 Thread Joelle van Dyne
From: osy Some hosts (iOS) have a sandboxed filesystem and do not provide low-level APIs for interfacing with host block devices. Signed-off-by: Joelle van Dyne --- configure | 4 meson.build| 1 + block/file-posix.c | 8 +++- 3 files changed, 12 insertions(+), 1

[PATCH RESEND v2 2/9] configure: cross-compiling without cross_prefix

2020-10-18 Thread Joelle van Dyne
From: osy The iOS toolchain does not use the host prefix naming convention. We add a new option `--enable-cross-compile` that forces cross-compile even without a cross_prefix. Signed-off-by: Joelle van Dyne --- configure | 13 - 1 file changed, 12 insertions(+), 1 deletion

[PATCH RESEND v2 9/9] block: check availablity for preadv/pwritev on mac

2020-10-18 Thread Joelle van Dyne
From: osy macOS 11/iOS 14 added preadv/pwritev APIs. Due to weak linking, configure will succeed with CONFIG_PREADV even when targeting a lower OS version. We therefore need to check at run time if we can actually use these APIs. Signed-off-by: Joelle van Dyne --- block/file-posix.c | 12

[PATCH RESEND v2 8/9] tcg: support JIT on Apple Silicon

2020-10-18 Thread Joelle van Dyne
ing. * JIT write-protect is disabled by cpu_loop_exit() for interrupt handling. * JIT write-protect is disabled everywhere else. Signed-off-by: Joelle van Dyne --- configure | 20 + include/exec/exec-all.h | 2 + include/tcg/tcg-apple-jit.h |

[PATCH RESEND v2 7/9] tcg: mirror mapping RWX pages for iOS optional

2020-10-18 Thread Joelle van Dyne
From: osy This allows jailbroken devices with entitlements to switch the option off. Signed-off-by: Joelle van Dyne --- include/sysemu/tcg.h | 2 +- accel/tcg/tcg-all.c | 27 +- accel/tcg/translate-all.c | 60 +-- bsd-user/main.c

[PATCH v2 9/9] block: check availablity for preadv/pwritev on mac

2020-10-18 Thread Joelle van Dyne
From: osy macOS 11/iOS 14 added preadv/pwritev APIs. Due to weak linking, configure will succeed with CONFIG_PREADV even when targeting a lower OS version. We therefore need to check at run time if we can actually use these APIs. Signed-off-by: Joelle van Dyne --- block/file-posix.c | 12

[PATCH v2 6/9] tcg: implement mirror mapped JIT for iOS

2020-10-18 Thread Joelle van Dyne
on some architectures, we do not provide implementations for non iOS platforms (ARM/x86). Signed-off-by: Joelle van Dyne --- docs/devel/ios.rst | 40 +++ configure| 1 + include/exec/exec-all.h | 8 include/tcg/tcg.h| 17

[PATCH RESEND v2 4/9] coroutine: add libucontext as external library

2020-10-18 Thread Joelle van Dyne
van Dyne --- configure | 23 --- meson.build | 29 - util/coroutine-ucontext.c | 9 + .gitmodules | 3 +++ libucontext | 1 + meson_options.txt | 2 ++ 6 files changed, 63

[PATCH RESEND v2 0/9] iOS and Apple Silicon host support

2020-10-18 Thread Joelle van Dyne
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

[PATCH RESEND v2 3/9] qemu: add support for iOS host

2020-10-18 Thread Joelle van Dyne
sys_icache_invalidate() instead of GCC builtin for iOS tests: disable tests on iOS which uses system() Signed-off-by: Joelle van Dyne --- configure | 43 ++- meson.build | 2 +- tcg/aarch64/tcg-target.h | 10 + block.c

[PATCH RESEND v2 6/9] tcg: implement mirror mapped JIT for iOS

2020-10-18 Thread Joelle van Dyne
on some architectures, we do not provide implementations for non iOS platforms (ARM/x86). Signed-off-by: Joelle van Dyne --- docs/devel/ios.rst | 40 +++ configure| 1 + include/exec/exec-all.h | 8 include/tcg/tcg.h| 17

[PATCH RESEND v2 5/9] tcg: add const hints for code pointers

2020-10-18 Thread Joelle van Dyne
From: osy We will introduce mirror mapping for JIT segment with separate RX and RW access. Adding 'const' hints will make it easier to identify read-only accesses and allow us to easier catch bugs at compile time in the future. Signed-off-by: Joelle van Dyne --- include/tcg/tcg.h

[PATCH v2 3/9] qemu: add support for iOS host

2020-10-18 Thread Joelle van Dyne
sys_icache_invalidate() instead of GCC builtin for iOS tests: disable tests on iOS which uses system() Signed-off-by: Joelle van Dyne --- configure | 43 ++- meson.build | 2 +- tcg/aarch64/tcg-target.h | 10 + block.c

[PATCH v2 1/9] configure: option to disable host block devices

2020-10-18 Thread Joelle van Dyne
From: osy Some hosts (iOS) have a sandboxed filesystem and do not provide low-level APIs for interfacing with host block devices. Signed-off-by: Joelle van Dyne --- configure | 4 meson.build| 1 + block/file-posix.c | 8 +++- 3 files changed, 12 insertions(+), 1

[PATCH v2 4/9] coroutine: add libucontext as external library

2020-10-18 Thread Joelle van Dyne
van Dyne --- configure | 23 --- meson.build | 29 - util/coroutine-ucontext.c | 9 + .gitmodules | 3 +++ libucontext | 1 + meson_options.txt | 2 ++ 6 files changed, 63

[PATCH v2 0/9] iOS and Apple Silicon host support

2020-10-18 Thread Joelle van Dyne
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

[PATCH v2 5/9] tcg: add const hints for code pointers

2020-10-18 Thread Joelle van Dyne
From: osy We will introduce mirror mapping for JIT segment with separate RX and RW access. Adding 'const' hints will make it easier to identify read-only accesses and allow us to easier catch bugs at compile time in the future. Signed-off-by: Joelle van Dyne --- include/tcg/tcg.h

[PATCH v2 7/9] tcg: mirror mapping RWX pages for iOS optional

2020-10-18 Thread Joelle van Dyne
From: osy This allows jailbroken devices with entitlements to switch the option off. Signed-off-by: Joelle van Dyne --- include/sysemu/tcg.h | 2 +- accel/tcg/tcg-all.c | 27 +- accel/tcg/translate-all.c | 60 +-- bsd-user/main.c

[PATCH v2 8/9] tcg: support JIT on Apple Silicon

2020-10-18 Thread Joelle van Dyne
ing. * JIT write-protect is disabled by cpu_loop_exit() for interrupt handling. * JIT write-protect is disabled everywhere else. Signed-off-by: Joelle van Dyne --- configure | 20 + include/exec/exec-all.h | 2 + include/tcg/tcg-apple-jit.h |

[PATCH v2 2/9] configure: cross-compiling without cross_prefix

2020-10-18 Thread Joelle van Dyne
From: osy The iOS toolchain does not use the host prefix naming convention. We add a new option `--enable-cross-compile` that forces cross-compile even without a cross_prefix. Signed-off-by: Joelle van Dyne --- configure | 13 - 1 file changed, 12 insertions(+), 1 deletion

Re: [PATCH 05/10] slirp: update for iOS resolv fix

2020-10-14 Thread Joelle van Dyne
dré Lureau wrote: > > Hi > > > > On Tue, Oct 13, 2020 at 5:34 PM Philippe Mathieu-Daudé > > mailto:phi...@redhat.com>> wrote: > > > > On 10/13/20 1:29 AM, Joelle van Dyne wrote: > > > From: osy > <mailto:os...@users.noreply.github.c

Re: [PATCH 07/10] tcg: implement bulletproof JIT

2020-10-14 Thread Joelle van Dyne
Hi Philippe, Will work on splitting the patch for v2. Thanks for the tip on git.orderfile Hi Balaton, Reply inline. -j On Tue, Oct 13, 2020 at 7:58 AM BALATON Zoltan wrote: > > On Mon, 12 Oct 2020, Joelle van Dyne wrote: > > From: osy > > > > On iOS, we cannot al

Re: [PATCH 04/10] meson: option to build as shared library

2020-10-14 Thread Joelle van Dyne
6:46AM -0700, Joelle van Dyne wrote: > >> I will start a separate conversation of UTM's license compatibility. > >> > >> Regarding the patch, would some sort of warning message in configure > >> (if building as a shared library) regarding the license be wise? Or

Re: [PATCH v2 9/9] block: check availablity for preadv/pwritev on mac

2020-10-19 Thread Joelle van Dyne
On Mon, Oct 19, 2020 at 1:27 AM Thomas Huth wrote: > > On 19/10/2020 03.39, Joelle van Dyne wrote: > > From: osy > > That "From:" line looks wrong ... could you please fix the "Author" of your > patches / your git config? osy wrote the original change

Re: [PATCH v2 2/9] configure: cross-compiling without cross_prefix

2020-10-19 Thread Joelle van Dyne
h wrote: > > On 19/10/2020 10.07, Thomas Huth wrote: > >> On 19/10/2020 03.39, Joelle van Dyne wrote: > >>> From: osy > >>> > >>> The iOS toolchain does not use the host prefix naming convention. We add a > >>> new op

Re: [PATCH v2 6/9] tcg: implement mirror mapped JIT for iOS

2020-10-19 Thread Joelle van Dyne
TCG target. No matter how you split up the patches, it will look like a lot of changes. -j On Mon, Oct 19, 2020 at 4:48 AM BALATON Zoltan wrote: > > On Sun, 18 Oct 2020, Joelle van Dyne wrote: > > From: osy > > > > On iOS, we cannot allocate RWX pages without special entit

Re: [PATCH v2 5/9] tcg: add const hints for code pointers

2020-10-19 Thread Joelle van Dyne
You can --author "Joelle van Dyne " -j On Mon, Oct 19, 2020 at 4:19 PM Richard Henderson wrote: > > On 10/18/20 6:39 PM, Joelle van Dyne wrote: > > From: osy > > > > We will introduce mirror mapping for JIT segment with separate RX and RW > > access.

Re: [PATCH v2 5/9] tcg: add const hints for code pointers

2020-10-19 Thread Joelle van Dyne
Seems like I missed a few. Sorry about that. Will fix. -j On Mon, Oct 19, 2020 at 4:27 PM Richard Henderson wrote: > > On 10/18/20 6:39 PM, Joelle van Dyne wrote: > > From: osy > > > > We will introduce mirror mapping for JIT segment with separate RX and RW > >

[PATCH RESEND 2/4] tcg: implement mirror mapped JIT for Linux

2020-10-26 Thread Joelle van Dyne
case will be for other platforms that require strict W^X separation to run. Signed-off-by: Joelle van Dyne --- configure | 13 meson.build | 1 + include/exec/exec-all.h | 8 + include/tcg/tcg.h | 18 ++ accel/tcg/cpu-exec.c | 7

[PATCH RESEND 0/4] Mirror map JIT memory for TCG

2020-10-26 Thread Joelle van Dyne
e disabled with the runtime argument `-accel tcg,mirror-jit=off`. Although this patch only enables this feature for Linux, the main goal of this is to enable, through a future patch, iOS JIT on older devices which require strict W^X separation. Resending because of merge conflict to current master. -j Joell

[PATCH RESEND 1/4] tcg: add const hints for code pointers

2020-10-26 Thread Joelle van Dyne
We will introduce mirror mapping for JIT segment with separate RX and RW access. Adding 'const' hints will make it easier to identify read-only accesses and allow us to easier catch bugs at compile time in the future. Signed-off-by: Joelle van Dyne --- include/tcg/tcg.h| 8

[PATCH RESEND 3/4] tcg: use mirror map JIT in code generation

2020-10-26 Thread Joelle van Dyne
in the RX mapping (where applicable). Cache flushing is defined per-platform. GCC and Apple Clang are supported. Signed-off-by: Joelle van Dyne --- tcg/aarch64/tcg-target.h | 18 +++- tcg/arm/tcg-target.h | 15 +- tcg/i386/tcg-target.h| 26 +++-- tcg

[PATCH RESEND 4/4] tcg: make mirror mapped JIT optional

2020-10-26 Thread Joelle van Dyne
configured with --enable-debug-tcg. Signed-off-by: Joelle van Dyne --- include/sysemu/tcg.h | 2 +- accel/tcg/tcg-all.c | 31 - accel/tcg/translate-all.c | 57 ++- bsd-user/main.c | 2 +- linux-user/main.c | 2 +- qemu

[PATCH v3 2/7] configure: cross-compiling with empty cross_prefix

2020-10-27 Thread Joelle van Dyne
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 --- configure | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/configure b/configure index

[PATCH v3 4/7] coroutine: add libucontext as external library

2020-10-27 Thread Joelle van Dyne
iOS does not support ucontext natively for aarch64 and the sigaltstack is also unsupported (even worse, it fails silently, see: https://openradar.appspot.com/13002712 ) As a workaround we include a library implementation of ucontext and add it as a build option. Signed-off-by: Joelle van Dyne

[PATCH v3 6/7] tcg: implement JIT for iOS and Apple Silicon

2020-10-27 Thread Joelle van Dyne
() for interrupt handling. * JIT write-protect is disabled everywhere else. Reference: https://developer.apple.com/documentation/apple_silicon/porting_just-in-time_compilers_to_apple_silicon Signed-off-by: Joelle van Dyne --- docs/devel/index.rst| 1 + docs/devel/ios.rst | 39

[PATCH v3 3/7] qemu: add support for iOS host

2020-10-27 Thread Joelle van Dyne
() instead of GCC builtin for iOS tests: disable tests on iOS which uses system() Signed-off-by: Joelle van Dyne --- configure | 43 +- meson.build| 2 +- tcg/aarch64/tcg-target.h | 7 ++ block.c

[PATCH v3 0/7] iOS and Apple Silicon host support

2020-10-27 Thread Joelle van Dyne
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

[PATCH v3 1/7] configure: option to disable host block devices

2020-10-27 Thread Joelle van Dyne
Some hosts (iOS) have a sandboxed filesystem and do not provide low-level APIs for interfacing with host block devices. Signed-off-by: Joelle van Dyne --- configure | 4 meson.build| 1 + block/file-posix.c | 8 +++- 3 files changed, 12 insertions(+), 1 deletion

[PATCH v3 5/7] slirp: update build flags for iOS resolv fix

2020-10-27 Thread Joelle van Dyne
A future libslirp update will use libresolv on Darwin systems, so we add the flags in QEMU build now. Signed-off-by: Joelle van Dyne --- meson.build | 2 ++ 1 file changed, 2 insertions(+) diff --git a/meson.build b/meson.build index 0beb199303..2b45b9434d 100644 --- a/meson.build +++ b

[PATCH v3 7/7] block: check availablity for preadv/pwritev on mac

2020-10-27 Thread Joelle van Dyne
macOS 11/iOS 14 added preadv/pwritev APIs. Due to weak linking, configure will succeed with CONFIG_PREADV even when targeting a lower OS version. We therefore need to check at run time if we can actually use these APIs. Signed-off-by: Joelle van Dyne --- block/file-posix.c | 12 1

Re: [PATCH v2 6/9] tcg: implement mirror mapped JIT for iOS

2020-10-25 Thread Joelle van Dyne
nk it may be possible to map a file on an executable partition, but I can foresee countless issues there including some security issues. Anyone have any other ideas? -j On Mon, Oct 19, 2020 at 5:20 PM Richard Henderson wrote: > > On 10/19/20 3:39 PM, Joelle van Dyne wrote: > >&

Re: [PATCH v2 6/9] tcg: implement mirror mapped JIT for iOS

2020-10-25 Thread Joelle van Dyne
On Mon, Oct 19, 2020 at 5:20 PM Richard Henderson wrote: > > On 10/19/20 3:39 PM, Joelle van Dyne wrote: > >> Explicit cast may not be needed here so this could be a macro if caling it > >> differently helps or why don't you just use tcg_mirror_prr_rw

Re: [PATCH v2 2/9] configure: cross-compiling without cross_prefix

2020-10-25 Thread Joelle van Dyne
As the patch stands --cross-prefix="" works but I like having the --enable-cross-compile option because it's more clear of the intention (in logs and such). I've been struggling to come up with a concise modification to the help text for --cross-prefix that explains that empty PREFIX is allowed

[PATCH 0/4] Mirror map JIT memory for TCG

2020-10-26 Thread Joelle van Dyne
e disabled with the runtime argument `-accel tcg,mirror-jit=off`. Although this patch only enables this feature for Linux, the main goal of this is to enable, through a future patch, iOS JIT on older devices which require strict W^X separation. -j Joelle van Dyne (4): tcg: add const hints for code poin

[PATCH 2/4] tcg: implement mirror mapped JIT for Linux

2020-10-26 Thread Joelle van Dyne
case will be for other platforms that require strict W^X separation to run. Signed-off-by: Joelle van Dyne --- configure | 13 meson.build | 1 + include/exec/exec-all.h | 8 + include/tcg/tcg.h | 18 ++ accel/tcg/cpu-exec.c | 7

[PATCH 3/4] tcg: use mirror map JIT in code generation

2020-10-26 Thread Joelle van Dyne
in the RX mapping (where applicable). Cache flushing is defined per-platform. GCC and Apple Clang are supported. Signed-off-by: Joelle van Dyne --- tcg/aarch64/tcg-target.h | 18 +++- tcg/arm/tcg-target.h | 15 +- tcg/i386/tcg-target.h| 26 +++-- tcg

[PATCH 1/4] tcg: add const hints for code pointers

2020-10-26 Thread Joelle van Dyne
We will introduce mirror mapping for JIT segment with separate RX and RW access. Adding 'const' hints will make it easier to identify read-only accesses and allow us to easier catch bugs at compile time in the future. Signed-off-by: Joelle van Dyne --- include/tcg/tcg.h| 8

Re: [PATCH v2 0/9] iOS and Apple Silicon host support

2020-10-26 Thread Joelle van Dyne
On Mon, Oct 19, 2020 at 1:30 AM Thomas Huth wrote: > > On 19/10/2020 03.39, Joelle van Dyne wrote: > > 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 &

Re: [PATCH v2 2/9] configure: cross-compiling without cross_prefix

2020-10-26 Thread Joelle van Dyne
Just to be clear, you're in favor of removing the --enable-cross-compile option? I can do that if others agree but I'm not sure what the downside of adding this extra option is? -j On Mon, Oct 26, 2020 at 12:54 AM Paolo Bonzini wrote: > > On 25/10/20 20:24, Joelle van Dyne

[PATCH 4/4] tcg: make mirror mapped JIT optional

2020-10-26 Thread Joelle van Dyne
configured with --enable-debug-tcg. Signed-off-by: Joelle van Dyne --- include/sysemu/tcg.h | 2 +- accel/tcg/tcg-all.c | 31 - accel/tcg/translate-all.c | 57 ++- bsd-user/main.c | 2 +- linux-user/main.c | 2 +- qemu

Re: [PATCH v5 6/7] tcg: implement JIT for iOS and Apple Silicon

2020-11-24 Thread Joelle van Dyne
A lot of users of UTM are on iOS 13 (a large number of devices only have jailbreak for iOS 13 and below), but if the QEMU community thinks it's better that way, we are willing to compromise. -j On Tue, Nov 24, 2020 at 7:15 PM Alexander Graf wrote: > > > On 20.11.20 16:58, Joelle van D

Re: [PATCH v4 01/43] tcg: Do not flush icache for interpreter

2020-12-14 Thread Joelle van Dyne
On Mon, Dec 14, 2020 at 6:02 AM Richard Henderson wrote: > > This is currently a no-op within tci/tcg-target.h, but > is about to be moved to a more generic location. > > Signed-off-by: Richard Henderson Reviewed-by: Joelle van Dyne

Re: [PATCH v4 06/43] tcg: Move tcg epilogue pointer out of TCGContext

2020-12-14 Thread Joelle van Dyne
tcg/riscv/tcg-target.c.inc | 4 ++-- > tcg/s390/tcg-target.c.inc| 4 ++-- > tcg/sparc/tcg-target.c.inc | 2 +- > 11 files changed, 16 insertions(+), 15 deletions(-) Reviewed-by: Joelle van Dyne

Re: [PATCH v4 02/43] util: Extract flush_icache_range to cacheflush.c

2020-12-14 Thread Joelle van Dyne
On Mon, Dec 14, 2020 at 6:02 AM Richard Henderson wrote: > > This has been a tcg-specific function, but is also in use > by hardware accelerators via physmem.c. This can cause > link errors when tcg is disabled. > > Signed-off-by: Richard Henderson Reviewed-by: Joelle van Dyne

Re: [PATCH v4 04/43] util: Specialize flush_idcache_range for aarch64

2020-12-14 Thread Joelle van Dyne
ter interface > we require. This halves the number of cache operations required > when split-rwx is enabled. > > Cc: Joelle van Dyne > Signed-off-by: Richard Henderson Reviewed-by: Joelle van Dyne

Re: [PATCH v4 03/43] util: Enhance flush_icache_range with separate data pointer

2020-12-14 Thread Joelle van Dyne
are identical, so there is no > effective change in behaviour. > > Reviewed-by: Alex Bennée > Signed-off-by: Richard Henderson Reviewed-by: Joelle van Dyne

Re: [PATCH v4 17/43] tcg: Add --accel tcg,split-wx property

2020-12-14 Thread Joelle van Dyne
Should qemu-options.hx be updated? -j On Mon, Dec 14, 2020 at 6:02 AM Richard Henderson wrote: > > Plumb the value through to alloc_code_gen_buffer. This is not > supported by any os or tcg backend, so for now enabling it will > result in an error. > > Signed-off-by: Richard Henderson > --- >

Re: [PATCH v4 05/43] tcg: Move tcg prologue pointer out of TCGContext

2020-12-14 Thread Joelle van Dyne
/tcg.h | 9 - > tcg/tcg.c | 9 - > tcg/tci.c | 3 ++- > 3 files changed, 14 insertions(+), 7 deletions(-) Reviewed-by: Joelle van Dyne

Re: [PATCH v5 6/7] tcg: implement JIT for iOS and Apple Silicon

2020-12-11 Thread Joelle van Dyne
Sounds good, I will make that change in the next version. -j On Fri, Dec 11, 2020 at 4:36 AM Stefan Hajnoczi wrote: > > On Fri, Dec 11, 2020 at 10:54 AM Alexander Graf wrote: > > On 25.11.20 03:08, Joelle van Dyne wrote: > > > A lot of users of UTM are on iOS 13 (a large n

Re: [PATCH v3 00/41] Mirror map JIT memory for TCG

2020-11-07 Thread Joelle van Dyne
LGTM, tested and working on iOS. -j On Thu, Nov 5, 2020 at 7:29 PM Richard Henderson wrote: > > This is my take on Joelle's patch set: > https://lists.nongnu.org/archive/html/qemu-devel/2020-10/msg07837.html > > Changes for v3: > * Even more patches -- all tcg backends converted. > * Fixups

Re: [PATCH v3 16/41] accel/tcg: Support split-wx for darwin/iOS with vm_remap

2020-11-07 Thread Joelle van Dyne
On Thu, Nov 5, 2020 at 7:29 PM Richard Henderson wrote: > > Cribbed from code posted by Joelle van Dyne , > and rearranged to a cleaner structure. Completely untested. > > Signed-off-by: Richard Henderson Reviewed-by: Joelle van Dyne

[PATCH v4 5/7] slirp: update build flags for iOS resolv fix

2020-11-07 Thread Joelle van Dyne
A future libslirp update will use libresolv on Darwin systems, so we add the flags in QEMU build now. Reviewed-by: Stefan Hajnoczi Signed-off-by: Joelle van Dyne --- meson.build | 2 ++ 1 file changed, 2 insertions(+) diff --git a/meson.build b/meson.build index e62324d5ac..664d9f93a5 100644

[PATCH v4 1/7] configure: option to disable host block devices

2020-11-07 Thread Joelle van Dyne
Some hosts (iOS) have a sandboxed filesystem and do not provide low-level APIs for interfacing with host block devices. Signed-off-by: Joelle van Dyne --- configure| 4 meson.build | 1 + qapi/block-core.json | 4 +++- block/file-posix.c | 8 +++- 4 files changed

[PATCH v4 2/7] configure: cross-compiling with empty cross_prefix

2020-11-07 Thread Joelle van Dyne
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 --- configure | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/configure b/configure index

[PATCH v4 7/7] block: check availablity for preadv/pwritev on mac

2020-11-07 Thread Joelle van Dyne
macOS 11/iOS 14 added preadv/pwritev APIs. Due to weak linking, configure will succeed with CONFIG_PREADV even when targeting a lower OS version. We therefore need to check at run time if we can actually use these APIs. Signed-off-by: Joelle van Dyne --- block/file-posix.c | 12 1

[PATCH v4 3/7] qemu: add support for iOS host

2020-11-07 Thread Joelle van Dyne
id slirp_smb_cleanup(SlirpState *s) @@ -900,7 +900,7 @@ static int slirp_smb(SlirpState* s, const char *exported_dir, return 0; } -#endif /* !defined(_WIN32) */ +#endif /* !defined(_WIN32) && !defined(CONFIG_IOS) */ static int guestfwd_can_read(void *opaque) { diff --git a/qg

[PATCH v4 6/7] tcg: implement JIT for iOS and Apple Silicon

2020-11-07 Thread Joelle van Dyne
again before returning. * JIT write-protect is disabled by cpu_loop_exit() for interrupt handling. * JIT write-protect is disabled everywhere else. See https://developer.apple.com/documentation/apple_silicon/porting_just-in-time_compilers_to_apple_silicon Signed-off-by: Joelle van Dyne

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

2020-11-07 Thread Joelle van Dyne
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

[PATCH v4 4/7] coroutine: add libucontext as external library

2020-11-07 Thread Joelle van Dyne
iOS does not support ucontext natively for aarch64 and the sigaltstack is also unsupported (even worse, it fails silently, see: https://openradar.appspot.com/13002712 ) As a workaround we include a library implementation of ucontext and add it as a build option. Signed-off-by: Joelle van Dyne

Re: [PATCH v3 16/41] accel/tcg: Support split-wx for darwin/iOS with vm_remap

2020-11-10 Thread Joelle van Dyne
n writes: > > > Cribbed from code posted by Joelle van Dyne , > > and rearranged to a cleaner structure. Completely untested. > > > > Signed-off-by: Richard Henderson > > --- > > accel/tcg/translate-all.c | 65 +++ > > 1 fil

Re: [PATCH v5 7/7] block: check availablity for preadv/pwritev on mac

2020-11-20 Thread Joelle van Dyne
, *)) { preadv_checked = true; } else { preadv_present = false; return -ENOSYS; } } #endif return preadv(fd, iov, nr_iov, offset); } -j On Fri, Nov 20, 2020 at 10:21 AM Philippe Mathieu-Daudé wrote: > > On 11/20/20 4:49 PM, Joelle va

Re: [PATCH v5 7/7] block: check availablity for preadv/pwritev on mac

2020-11-20 Thread Joelle van Dyne
No, because if you build on a macOS 11 host but try to run it on macOS 10.15 then it will crash. -j On Fri, Nov 20, 2020 at 4:32 AM Philippe Mathieu-Daudé wrote: > > On 11/9/20 12:24 AM, Joelle van Dyne wrote: > > macOS 11/iOS 14 added preadv/pwritev APIs. Due to weak linkin

Re: [PATCH v5 6/7] tcg: implement JIT for iOS and Apple Silicon

2020-11-20 Thread Joelle van Dyne
On Fri, Nov 20, 2020 at 3:08 AM Alexander Graf wrote: > > > On 09.11.20 00:24, Joelle van Dyne wrote: > > When entitlements are available (macOS or jailbroken iOS), a hardware > > feature called APRR exists on newer Apple Silicon that can cheaply mark JIT > > pages

Re: [PATCH v3 00/41] Mirror map JIT memory for TCG

2020-11-16 Thread Joelle van Dyne
Hi, I'm wondering what the progress is for this patch set and the iOS support one? I know 5.2 is frozen, so will this be considered for 6.0? Apple Silicon Macs are out now and a few people are asking about QEMU support :) -j On Thu, Nov 5, 2020 at 9:29 PM Richard Henderson wrote: > > This is my

Re: [PATCH v3 00/41] Mirror map JIT memory for TCG

2020-11-17 Thread Joelle van Dyne
Sorry, are you asking for a review from me? I don’t know if I’m qualified to review the other patches but I did review the iOS patch. -j On Tue, Nov 17, 2020 at 9:20 AM Richard Henderson wrote: > > On 11/16/20 7:47 PM, Joelle van Dyne wrote: > > Hi, I'm wondering what

[PATCH v5 6/7] tcg: implement JIT for iOS and Apple Silicon

2020-11-08 Thread Joelle van Dyne
again before returning. * JIT write-protect is disabled by cpu_loop_exit() for interrupt handling. * JIT write-protect is disabled everywhere else. See https://developer.apple.com/documentation/apple_silicon/porting_just-in-time_compilers_to_apple_silicon Signed-off-by: Joelle van Dyne

[PATCH v5 2/7] configure: cross-compiling with empty cross_prefix

2020-11-08 Thread Joelle van Dyne
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 --- configure | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/configure b/configure index

[PATCH v5 1/7] configure: option to disable host block devices

2020-11-08 Thread Joelle van Dyne
Some hosts (iOS) have a sandboxed filesystem and do not provide low-level APIs for interfacing with host block devices. Signed-off-by: Joelle van Dyne --- configure| 4 meson.build | 1 + qapi/block-core.json | 10 +++--- block/file-posix.c | 10 +- 4

[PATCH v5 0/7] iOS and Apple Silicon host support

2020-11-08 Thread Joelle van Dyne
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

[PATCH v5 7/7] block: check availablity for preadv/pwritev on mac

2020-11-08 Thread Joelle van Dyne
macOS 11/iOS 14 added preadv/pwritev APIs. Due to weak linking, configure will succeed with CONFIG_PREADV even when targeting a lower OS version. We therefore need to check at run time if we can actually use these APIs. Signed-off-by: Joelle van Dyne --- block/file-posix.c | 12 1

[PATCH v5 4/7] coroutine: add libucontext as external library

2020-11-08 Thread Joelle van Dyne
iOS does not support ucontext natively for aarch64 and the sigaltstack is also unsupported (even worse, it fails silently, see: https://openradar.appspot.com/13002712 ) As a workaround we include a library implementation of ucontext and add it as a build option. Signed-off-by: Joelle van Dyne

  1   2   3   4   >