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

David Holmes david.holmes at oracle.com
Mon Mar 29 10:00:20 UTC 2021


On 29/03/2021 4:36 pm, Jie Fu wrote:
> On Mon, 29 Mar 2021 05:17:19 GMT, David Holmes <dholmes at openjdk.org> 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
> 


More information about the hotspot-runtime-dev mailing list