RFR: 8261966: macOS M1: report in hs_err log if we are running x86 code in emulation mode (Rosetta)

Gerard Ziemski gziemski at openjdk.java.net
Fri Mar 19 14:56:39 UTC 2021


On Thu, 18 Mar 2021 19:03:26 GMT, Daniel D. Daugherty <dcubed at openjdk.org> wrote:

>> Please review this simple enhancement where we indicate in hs_err log file whether the CPU is being emulated. Right now the only use case is for Apple's M1 aarch64 running x64 code, i.e. "Rosetta" emulation.
>> 
>> This enhancement will insert `(EMULATED)` label after we print host CPU type, ex:
>> 
>> `Host: Oracles-MacBook-Pro-16.local, MacBookPro16,1 x86_64 2600 MHz (EMULATED), 12 cores, 32G, Darwin 19.6.0, macOS 10.15.7 (19H114)`
>
> In the bug report, @dholmes-ora mentions two different places where
> "(EMULATED)" should show up.  This change covers the first:
> 
>> Host: MacBookPro17,1 x86_64 2400 MHz, 8 cores, 16G, Darwin 20.3.0
>> 
>> becomes
>> 
>> Host: MacBookPro17,1 x86_64 (EMULATED) 2400 MHz, 8 cores, 16G, Darwin 20.3.0 
> 
> but I don't think that it covers the second:
> 
>> CPU: total 8 (initial active 8) (1 cores per cpu, 1 threads per core) family 6 model 44 stepping 0 microcode 0x0, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3, sse4.1, sse4.2, popcnt, aes, clmul, tsc, tscinvbit, tscinv, clflush
>> 
>> becomes:
>> 
>> CPU: (EMULATED) total 8 (initial active 8) (1 cores per cpu, 1 threads per core) family 6 model 44 stepping 0 microcode 0x0, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3, sse4.1, sse4.2, popcnt, aes, clmul, tsc, tscinvbit, tscinv, clflush 
> 
> Am I missing something here?

Thank you for the review Dan!

> In the bug report, @dholmes-ora mentions two different places where
> "(EMULATED)" should show up. This change covers the first:
> 
> > Host: MacBookPro17,1 x86_64 2400 MHz, 8 cores, 16G, Darwin 20.3.0
> > becomes
> > Host: MacBookPro17,1 x86_64 (EMULATED) 2400 MHz, 8 cores, 16G, Darwin 20.3.0
> 
> but I don't think that it covers the second:
> 
> > CPU: total 8 (initial active 8) (1 cores per cpu, 1 threads per core) family 6 model 44 stepping 0 microcode 0x0, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3, sse4.1, sse4.2, popcnt, aes, clmul, tsc, tscinvbit, tscinv, clflush
> > becomes:
> > CPU: (EMULATED) total 8 (initial active 8) (1 cores per cpu, 1 threads per core) family 6 model 44 stepping 0 microcode 0x0, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3, sse4.1, sse4.2, popcnt, aes, clmul, tsc, tscinvbit, tscinv, clflush
> 
> Am I missing something here?

I wasn't sure the 2nd case was needed.

The 1st case shows the architecture, so it's clearly needed there.

In the 2nd case we just show CPU features, with no explicit mention of the architecture, so I didn't think it was 100% relevant there.

Is the opinion here that we need to mark it as `EMULATED` in both of these cases?

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

PR: https://git.openjdk.java.net/jdk/pull/3077


More information about the hotspot-runtime-dev mailing list