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

David Holmes dholmes at openjdk.java.net
Wed Mar 24 02:10:42 UTC 2021


On Tue, 23 Mar 2021 15:55:58 GMT, Gerard Ziemski <gziemski 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 in the **Host** and **CPU** section, ex:
>> 
>> 
>> `Host: Oracles-MacBook-Pro-16.local, MacBookPro16,1 x86_64 2600 MHz, 12 cores, 32G, Darwin 19.6.0, macOS 10.15.7 (19H114)`
>> 
>> becomes
>> 
>> `Host: Oracles-MacBook-Pro-16.local, "MacBookPro16,1" x86_64 (EMULATED) 2600 MHz, 12 cores, 32G, Darwin 19.6.0, macOS 10.15.7 (19H114)`
>> 
>> and
>> 
>> `CPU: total 12 (initial active 12) (6 cores per cpu, 2 threads per core) family 6 model 158 stepping 10 microcode 0xde, cx8, cmov, fxsr, ht, mmx, 3dnowpref, sse, sse2, sse3, ssse3, sse4.1, sse4.2, popcnt, lzcnt, tsc, tscinvbit, avx, avx2, aes, erms, clmul, bmi1, bmi2, adx, fma, vzeroupper, clflush, clflushopt
>> `
>> 
>> becomes
>> 
>> `CPU: (EMULATED) total 12 (initial active 12) (6 cores per cpu, 2 threads per core) family 6 model 158 stepping 10 microcode 0xde, cx8, cmov, fxsr, ht, mmx, 3dnowpref, sse, sse2, sse3, ssse3, sse4.1, sse4.2, popcnt, lzcnt, tsc, tscinvbit, avx, avx2, aes, erms, clmul, bmi1, bmi2, adx, fma, vzeroupper, clflush, clflushopt
>> `
>> 
>> I also took the opportunity here to fix the model name by adding **"** around it as Apple uses commas in the name, which makes it harder to parse the **Host** section, since we also use commas to delineate, ex: `MacBookPro16,1` becomes `"MacBookPro16,1"`
>
> Gerard Ziemski has updated the pull request incrementally with one additional commit since the last revision:
> 
>   assign const string directly instead of using strcpy

LGTM too!

Thanks,
David

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

Marked as reviewed by dholmes (Reviewer).

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


More information about the hotspot-runtime-dev mailing list