Hypervisor detector for Windows

Yasumasa Suenaga suenaga at oss.nttdata.com
Sat Jul 25 05:51:15 UTC 2020

Hi all,

When I got hs_err log on Windows, I saw "HyperV virtualization detected" in it in spite of running on host OS.

I tried to file it to JBS and to fix it, but I have some questions for this.
(This feature has been introduced in JDK-8219241)

   - According to [1] (it is mentioned in the source code), we need to check bit 31 in ECX when CPUID is called with EAX = 1h. Why it would not do so?

   - Why would VM_Version::check_virtualizations() call CPUID with 40000000h to 4000FF00h? 40000000h should be used if we want to get vendor ID.

   - Why VM_Version::check_virt_cpuid() is separated for GNU C (GAS) and MacroAssembler? I guess we can use MacroAssembler for x86 / x86_64.

   - In case of Hyper-V, host OS is treated as root partition [2], so we cannot use this CPUID solution for Hyper-V. I guess we need to check it with other solutions like [3].



[1] https://kb.vmware.com/s/article/1009458
[2] https://docs.microsoft.com/virtualization/hyper-v-on-windows/reference/hyper-v-architecture
[3] https://stackoverflow.com/questions/10544498/detect-the-virtualization-layer-from-a-guest-instancevm-vpc-or-hyper-v-in-c

More information about the hotspot-runtime-dev mailing list