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

Gerard Ziemski gziemski at openjdk.java.net
Mon Mar 22 17:33:55 UTC 2021


> 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:

  remove white space

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

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/3077/files
  - new: https://git.openjdk.java.net/jdk/pull/3077/files/ba76a81f..3488d268

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=3077&range=03
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=3077&range=02-03

  Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
  Patch: https://git.openjdk.java.net/jdk/pull/3077.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/3077/head:pull/3077

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


More information about the hotspot-runtime-dev mailing list