Bug 573771 - should set ISVM bit (ECX:31) for CPUID leaf 0x00000001
Summary: should set ISVM bit (ECX:31) for CPUID leaf 0x00000001
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: kernel-xen
Version: 5.4
Hardware: All
OS: Linux
low
medium
Target Milestone: rc
: ---
Assignee: Paolo Bonzini
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks: 514489 518435 599734
TreeView+ depends on / blocked
 
Reported: 2010-03-15 18:30 UTC by Paolo Bonzini
Modified: 2011-01-13 21:17 UTC (History)
9 users (show)

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.
Clone Of:
Environment:
Last Closed: 2011-01-13 21:17:50 UTC
Target Upstream Version:
Embargoed:


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


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2011:0017 0 normal SHIPPED_LIVE Important: Red Hat Enterprise Linux 5.6 kernel security and bug fix update 2011-01-13 10:37:42 UTC

Description Paolo Bonzini 2010-03-15 18:30:28 UTC
From http://msdn.microsoft.com/en-us/library/dd871279%28v=MSDN.10%29.aspx

IsVM TEST

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 09:54:05 UTC
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 19:42:01 UTC
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 08:48:35 UTC
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 08:52:11 UTC
(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 05:39:22 UTC
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 21:17:50 UTC
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.

http://rhn.redhat.com/errata/RHSA-2011-0017.html


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