Skip to content
Commit 4b19f97e authored by Mike Gilbert's avatar Mike Gilbert Committed by Zbigniew Jędrzejewski-Szmek
Browse files

basic: detect_vm_cpuid: fix hypervisor detection

The __get_cpuid() function only calls __cpuid() if __get_cpuid_max()
returns a value that is less than or equal to the leaf value.

In QEMU/KVM, I found that the special hypervisor leaf value (0x40000000U)
is always larger than the value retured by __get_cpuid_max().

Avoid this problem by calling the __cpuid() macro directly once we have
checked the hypervisor bit from leaf 1.

Fixes: d31b0033
(cherry picked from commit 8481e3e7)
parent c46365e5
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment