Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsVirtualCPU ¶
func IsVirtualCPU() bool
IsVirtualCPU checks if the cpu is a virtual CPU running on ESX. It checks for the HV bit in the ECX register of the CPUID leaf 0x1. Intel and AMD CPUs reserve this bit to indicate if the CPU is running in a HV. See https://en.wikipedia.org/wiki/CPUID#EAX.3D1:_Processor_Info_and_Feature_Bits for details. If this bit is set, the reserved cpuid levels are used to pass information from the HV to the guest. In ESX, this is the repeating string "VMwareVMware".
func IsVirtualWorld ¶
isVirtualWorld returns `true` if running in a VM and the backdoor is available. It also tries to elevate I/O privileges for the calling thread, which in some cases may be forbidden by the system (e.g Linux in `kernel_lockdown` mode does not allow `iopl` calls); the `ignoreAccessErrors` parameter allows to control library behavior in order to treat such errors as non-fatal.
Types ¶
This section is empty.