--- old/src/hotspot/os_cpu/linux_x86/os_linux_x86.cpp 2020-07-17 11:07:03.824099514 -0700 +++ new/src/hotspot/os_cpu/linux_x86/os_linux_x86.cpp 2020-07-17 11:07:03.637099505 -0700 @@ -620,6 +620,29 @@ #endif // AMD64 } +juint os::cpu_microcode_revision() { + juint result = 0; +#if defined(IA32) || defined(AMD64) + // Other platforms have less repetitive cpuinfo files + char * line = NULL; + size_t len = 0; + ssize_t read; + FILE *fp = fopen("/proc/cpuinfo", "r"); + if (fp) { + while ((read = getline(&line, &len, fp)) != -1) { + if (len > 10 && strstr(line, "microcode") != NULL) { + char* rev = strchr(line, ':'); + if (rev != NULL) sscanf(rev + 1, "%x", &result); + break; + } + } + free(line); + fclose(fp); + } +#endif // x86 platforms + return result; +} + bool os::is_allocatable(size_t bytes) { #ifdef AMD64 // unused on amd64?