RFR: 8264273: macOS: zero VM is broken due to no member named 'is_cpu_emulated' after JDK-8261966

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

RFR: 8264273: macOS: zero VM is broken due to no member named 'is_cpu_emulated' after JDK-8261966

Jie Fu-2
Hi all,

Zero VM on macOS is broken after JDK-8261966.
Let's fix it.

Thanks.
Best regards,
Jie

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

Commit messages:
 - 8264273: macOS: zero VM is broken due to no member named 'is_cpu_emulated' after JDK-8261966

Changes: https://git.openjdk.java.net/jdk/pull/3216/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=3216&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8264273
  Stats: 2 lines in 2 files changed: 0 ins; 0 del; 2 mod
  Patch: https://git.openjdk.java.net/jdk/pull/3216.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/3216/head:pull/3216

PR: https://git.openjdk.java.net/jdk/pull/3216
Reply | Threaded
Open this post in threaded view
|

Re: RFR: 8264273: macOS: zero VM is broken due to no member named 'is_cpu_emulated' after JDK-8261966

Ioi Lam-2
On Fri, 26 Mar 2021 12:09:33 GMT, Jie Fu <[hidden email]> wrote:

> Hi all,
>
> Zero VM on macOS is broken after JDK-8261966.
> Let's fix it.
>
> Thanks.
> Best regards,
> Jie

LGTM.

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

Marked as reviewed by iklam (Reviewer).

PR: https://git.openjdk.java.net/jdk/pull/3216
Reply | Threaded
Open this post in threaded view
|

Re: RFR: 8264273: macOS: zero VM is broken due to no member named 'is_cpu_emulated' after JDK-8261966

Vladimir Kempik-3
On Fri, 26 Mar 2021 17:47:07 GMT, Ioi Lam <[hidden email]> wrote:

>> Hi all,
>>
>> Zero VM on macOS is broken after JDK-8261966.
>> Let's fix it.
>>
>> Thanks.
>> Best regards,
>> Jie
>
> LGTM.

looks good and won't conflict with similar fix in just integrated jep-391

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

PR: https://git.openjdk.java.net/jdk/pull/3216
Reply | Threaded
Open this post in threaded view
|

Re: RFR: 8264273: macOS: zero VM is broken due to no member named 'is_cpu_emulated' after JDK-8261966

Jie Fu-2
In reply to this post by Ioi Lam-2
On Fri, 26 Mar 2021 17:47:07 GMT, Ioi Lam <[hidden email]> wrote:

>> Hi all,
>>
>> Zero VM on macOS is broken after JDK-8261966.
>> Let's fix it.
>>
>> Thanks.
>> Best regards,
>> Jie
>
> LGTM.

Thanks @iklam and @VladimirKempik  for your review.

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

PR: https://git.openjdk.java.net/jdk/pull/3216
Reply | Threaded
Open this post in threaded view
|

Integrated: 8264273: macOS: zero VM is broken due to no member named 'is_cpu_emulated' after JDK-8261966

Jie Fu-2
In reply to this post by Jie Fu-2
On Fri, 26 Mar 2021 12:09:33 GMT, Jie Fu <[hidden email]> wrote:

> Hi all,
>
> Zero VM on macOS is broken after JDK-8261966.
> Let's fix it.
>
> Thanks.
> Best regards,
> Jie

This pull request has now been integrated.

Changeset: 38e0a58f
Author:    Jie Fu <[hidden email]>
URL:       https://git.openjdk.java.net/jdk/commit/38e0a58f
Stats:     2 lines in 2 files changed: 0 ins; 0 del; 2 mod

8264273: macOS: zero VM is broken due to no member named 'is_cpu_emulated' after JDK-8261966

Reviewed-by: iklam

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

PR: https://git.openjdk.java.net/jdk/pull/3216
Reply | Threaded
Open this post in threaded view
|

Re: RFR: 8264273: macOS: zero VM is broken due to no member named 'is_cpu_emulated' after JDK-8261966

David Holmes-2
In reply to this post by Jie Fu-2
On Sat, 27 Mar 2021 09:53:18 GMT, Jie Fu <[hidden email]> wrote:

>> LGTM.
>
> Thanks @iklam and @VladimirKempik  for your review.

Why is the member missing under a Zero build? Whether or not the CPU is emulated is a feature of the OS and the binary - the compiler/interpreter mode is not relevant. This looks like the wrong fix to me.

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

PR: https://git.openjdk.java.net/jdk/pull/3216
Reply | Threaded
Open this post in threaded view
|

Re: RFR: 8264273: macOS: zero VM is broken due to no member named 'is_cpu_emulated' after JDK-8261966

Jie Fu-2
On Mon, 29 Mar 2021 05:17:19 GMT, David Holmes <[hidden email]> wrote:

> Why is the member missing under a Zero build? Whether or not the CPU is emulated is a feature of the OS and the binary - the compiler/interpreter mode is not relevant. This looks like the wrong fix to me.

VM_Version::is_cpu_emulated() seems to be also CPU-dependent since its implementations of x86 and aarch64 are different.

Did you mean we should copy the aarch64's implementation for bsd_zero build?
Thanks.

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

PR: https://git.openjdk.java.net/jdk/pull/3216
Reply | Threaded
Open this post in threaded view
|

Re: RFR: 8264273: macOS: zero VM is broken due to no member named 'is_cpu_emulated' after JDK-8261966

David Holmes
On 29/03/2021 4:36 pm, Jie Fu wrote:
> On Mon, 29 Mar 2021 05:17:19 GMT, David Holmes <[hidden email]> wrote:
>
>> Why is the member missing under a Zero build? Whether or not the CPU is emulated is a feature of the OS and the binary - the compiler/interpreter mode is not relevant. This looks like the wrong fix to me.
>
> VM_Version::is_cpu_emulated() seems to be also CPU-dependent since its implementations of x86 and aarch64 are different.

Whether a given CPU is emulated is a feature of the actual OS and CPU,
depending on the binary you execute. For example, if you try to execute
an x64 binary on a macOS Aarch64 system, then that system will emulate
the x64 CPU to run that binary.

> Did you mean we should copy the aarch64's implementation for bsd_zero build?

Hmmm. So zero pretends to be a CPU because it is CPU-agnostic when it
comes to interpreted code. But a zero x64 binary should still be able to
run on macos Aarch64 in emulation mode. But to do that VM_Version code
has to be the x64 implementation of VM_Version. I don't see any easy fix
for this.

So the build problem is resolved, but you can't run a zero x64 binary in
emulated mode.

Thanks,
David

> Thanks.
>
> -------------
>
> PR: https://git.openjdk.java.net/jdk/pull/3216
>