< prev index next >
src/hotspot/cpu/x86/vm_version_x86.hpp
Print this page
@@ -87,11 +87,12 @@
: 1,
aes : 1,
: 1,
osxsave : 1,
avx : 1,
- : 3;
+ : 2,
+ hv : 1;
} bits;
};
union StdCpuid1Edx {
uint32_t value;
@@ -346,10 +347,11 @@
#define CPU_FLUSH ((uint64_t)UCONST64( 0x20000000000)) // flush instruction
#define CPU_FLUSHOPT ((uint64_t)UCONST64( 0x40000000000)) // flushopt instruction
#define CPU_CLWB ((uint64_t)UCONST64( 0x80000000000)) // clwb instruction
#define CPU_AVX512_VBMI2 ((uint64_t)UCONST64(0x100000000000)) // VBMI2 shift left double instructions
#define CPU_AVX512_VBMI ((uint64_t)UCONST64(0x200000000000)) // Vector BMI instructions
+#define CPU_HV_PRESENT ((uint64_t)UCONST64(0x400000000000)) // for hypervisor detection
// NB! When adding new CPU feature detection consider updating vmStructs_x86.hpp, vmStructs_jvmci.hpp, and VM_Version::get_processor_features().
enum Extended_Family {
// AMD
@@ -578,10 +580,12 @@
result |= CPU_AVX512_VBMI;
if (_cpuid_info.sef_cpuid7_ecx.bits.avx512_vbmi2 != 0)
result |= CPU_AVX512_VBMI2;
}
}
+ if (_cpuid_info.std_cpuid1_ecx.bits.hv != 0)
+ result |= CPU_HV_PRESENT;
if (_cpuid_info.sef_cpuid7_ebx.bits.bmi1 != 0)
result |= CPU_BMI1;
if (_cpuid_info.std_cpuid1_edx.bits.tsc != 0)
result |= CPU_TSC;
if (_cpuid_info.ext_cpuid7_edx.bits.tsc_invariance != 0)
@@ -869,10 +873,11 @@
static bool supports_avx512_vpclmulqdq() { return (_features & CPU_AVX512_VPCLMULQDQ) != 0; }
static bool supports_avx512_vaes() { return (_features & CPU_AVX512_VAES) != 0; }
static bool supports_avx512_vnni() { return (_features & CPU_AVX512_VNNI) != 0; }
static bool supports_avx512_vbmi() { return (_features & CPU_AVX512_VBMI) != 0; }
static bool supports_avx512_vbmi2() { return (_features & CPU_AVX512_VBMI2) != 0; }
+ static bool supports_hv() { return (_features & CPU_HV_PRESENT) != 0; }
// Intel features
static bool is_intel_family_core() { return is_intel() &&
extended_cpu_family() == CPU_FAMILY_INTEL_CORE; }
@@ -1021,10 +1026,15 @@
static bool supports_clwb() { return false; }
#endif // _LP64
// support functions for virtualization detection
private:
- static void check_virt_cpuid(uint32_t idx, uint32_t *regs);
+ static void check_virt_cpuid(uint32_t *regs);
static void check_virtualizations();
+
+#ifdef _WINDOWS
+ static bool is_in_VM();
+#endif
+
};
#endif // CPU_X86_VM_VERSION_X86_HPP
< prev index next >