--- old/src/hotspot/os_cpu/bsd_x86/os_bsd_x86.cpp 2020-07-17 11:07:02.974099473 -0700 +++ new/src/hotspot/os_cpu/bsd_x86/os_bsd_x86.cpp 2020-07-17 11:07:02.787099464 -0700 @@ -801,6 +801,18 @@ #endif // AMD64 } +juint os::cpu_microcode_revision() { + juint result = 0; + char data[8]; + size_t sz = sizeof(data); + int ret = sysctlbyname("machdep.cpu.microcode_version", data, &sz, NULL, 0); + if (ret == 0) { + if (sz == 4) result = *((juint*)data); + if (sz == 8) result = *((juint*)data + 1); // upper 32-bits + } + return result; +} + //////////////////////////////////////////////////////////////////////////////// // thread stack