Bug 573771 - should set ISVM bit (ECX:31) for CPUID leaf 0x00000001
should set ISVM bit (ECX:31) for CPUID leaf 0x00000001
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: kernel-xen (Show other bugs)
All Linux
low Severity medium
: rc
: ---
Assigned To: Paolo Bonzini
Virtualization Bugs
: ZStream
Depends On:
Blocks: 514489 518435 599734
  Show dependency treegraph
Reported: 2010-03-15 14:30 EDT by Paolo Bonzini
Modified: 2011-01-13 16:17 EST (History)
9 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
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.
Story Points: ---
Clone Of:
Last Closed: 2011-01-13 16:17:50 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
program to aid verification (625 bytes, text/plain)
2010-03-16 05:54 EDT, Paolo Bonzini
no flags Details
`x86info -r` for HVM on AMD (3.07 KB, text/plain)
2010-12-27 03:48 EST, Jinxin Zheng
no flags Details

  None (edit)
Description Paolo Bonzini 2010-03-15 14:30:28 EDT
From http://msdn.microsoft.com/en-us/library/dd871279%28v=MSDN.10%29.aspx


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.
Comment 1 Paolo Bonzini 2010-03-16 05:54:05 EDT
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).
Comment 3 Jarod Wilson 2010-04-21 15:42:01 EDT
in kernel-2.6.18-197.el5
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.
Comment 8 Jinxin Zheng 2010-12-27 03:48:35 EST
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.
Comment 9 Jinxin Zheng 2010-12-27 03:52:11 EST
(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.
Comment 12 Jinxin Zheng 2010-12-28 00:39:22 EST
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.
Comment 14 errata-xmlrpc 2011-01-13 16:17:50 EST
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.


Note You need to log in before you can comment on or make changes to this bug.