Microsoft's Server Virtualization Validation Test contains an IsVM component, which directs that applications should be able to determine if they are running inside a virtualized environment by performing a CPUID check. With this update, applications running on a Windows operating system are able to determine whether they are running inside a virtualized environment.
To support utility or application software that may need to determine if it is executing in a virtualized environment, the IsVM test determines if virtualization products correctly expose the CPUID information to the virtual instance of Windows or applications. Software in the virtual instance of Windows can determine if it is running within a virtualized environment by executing the CPUID instruction with an input (EAX register) value of 1. When the CPUID instruction is executed by the software and it checks bit 31 of register ECX, the “hypervisor-present” bit should be set by the virtualization product.
Created attachment 400419 [details]
program to aid verification
This program will print one of the following four strings:
PV guest, hypervisor present bit set
HVM guest, hypervisor present bit set
PV guest, hypervisor present bit *NOT* set
HVM guest, hypervisor present bit *NOT* set
I used it for testing and it could be used for verification of this bug (especially for PV guests; for HVM you could use x86info -r too).
You can download this test kernel from http://people.redhat.com/jwilson/el5
Please update the appropriate value in the Verified field
(cf_verified) to indicate this fix has been successfully
verified. Include a comment with verification details.
Created attachment 470817 [details]
`x86info -r` for HVM on AMD
Here is a test result using the code in the attachment.
(I conducted the test on -194 and -238 of kernel-xen, on both PV and HVM guests, and on Intel and AMD CPUs. The 'N' stands for 'hypervisor present bit *NOT* set', the 'Y' stands for 'hypervisor present bit set'.)
| | | CPU |
| kernel-xen | Guest +-------+------+
| | | Intel| AMD |
| | PV | N | N |
| -194.el5 +--------+-------+------+
| | HVM | N | N |
| | PV | Y | Y |
| -238.el5 +--------+-------+------+
| | HVM | Y | N |
The IsVM bit is present on none of the guests over -194 host. After upgraded to -238 host kernel, the IsVM bit is present on most of the guests, except for HVM on an AMD.
(In reply to comment #8)
> Created attachment 470817 [details]
> `x86info -r` for HVM on AMD
> Here is a test result using the code in the attachment.
Confusing... I mean the code in Paolo's attachment in comment 1.
OK. Since this works for Intel, I'll put it in VERIFIED.
For the AMD case I'll do more test and report in a new bug.
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.