[Top][All Lists]

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

Re: [PATCH v2] tcg: Fix execution on Apple Silicon

From: Roman Bolshakov
Subject: Re: [PATCH v2] tcg: Fix execution on Apple Silicon
Date: Mon, 4 Jan 2021 00:21:47 +0300

On Sun, Jan 03, 2021 at 08:52:52AM -0800, Joelle van Dyne wrote:
> MAC_OS_VERSION_11_0 is always defined. You can see in
> usr/include/AvailabilityVersions.h

It's not defined on my old MPB that has Catalina (10.15.7). The last
entries are:

#define MAC_OS_X_VERSION_10_15      101500
#define MAC_OS_X_VERSION_10_15_1    101501

I was able to compile the patch on Catalina without any issues (and I've
checked Catalina SDK doesn't provide pthread_jit_write_protect).

> ...
> #define MAC_OS_X_VERSION_10_15      101500
> #define MAC_OS_X_VERSION_10_15_1    101501
> #define MAC_OS_X_VERSION_10_16      101600
> #define MAC_OS_VERSION_11_0         110000
> The proper way is to do an __builtin_available check but that assumes
> you have the symbol for pthread_jit_write_protect_np which you won't
> if building on 10.15, so you need a configure time check as well.

__builtin_available is a clang extension and I'm not sure if it's
available on GCC. But I can surely add a config-time check in v3 if you
find it more preferred for iOS host support.

> I have a newer version of my patch that I haven't submitted yet
> because I was waiting for some other patches to go in first, but I can
> decouple it from the iOS stuff and submit it as a separate patchset.

I'm sorry I stepped in... I didn't want to bother anyone during NY
holidays and couldn't ask for new patch revision. So I hacked it for
myself because I recently got M1 laptop and some spare time off work. In
the patch I wanted to avoid conflicts with your iOS host support patches
by limiting the patch only to macOS.

Hopefully, qemu_thread_jit_write/execute provides the room to add
reverse-enginereed implementation of pthread_jit_write_protect_np for
iOS 13 in UTM app.


reply via email to

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