Movatterモバイル変換


[0]ホーム

URL:


Skip to main content

This browser is no longer supported.

Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.

Download Microsoft EdgeMore info about Internet Explorer and Microsoft Edge
Table of contentsExit editor mode

Feature and Interface Discovery

Feedback

In this article

Guest software interacts with the hypervisor through a variety of mechanisms. Many of these mirror the traditional mechanisms used by software to interact with the underlying processor. As such, these mechanisms are architecture-specific. On the x64 architecture, the following mechanisms are used:

  • CPUID instruction – Used for static feature and version information.
  • MSRs (model-specific registers) – Used for status and control values.
  • Memory-mapped registers – Used for status and control values.
  • Processor interrupts – Used for asynchronous events, notifications and messages.

In addition to these architecture-specific interfaces, the hypervisor provides a simple procedural interface implemented withhypercalls.

Hypervisor Discovery

Before using any hypervisor interfaces, software should first determine whether it’s running within a virtualized environment. On x64 platforms that conform to this specification, this is done by executing the CPUID instruction with an input (EAX) value of 1. Upon execution, code should check bit 31 of register ECX (the “hypervisor present bit”). If this bit is set, a hypervisor is present. In a non-virtualized environment, the bit will be clear.

CPUID.01h.ECX:31 // if set, virtualization present

If the “hypervisor present bit” is set, additional CPUID leafs can be queried for more information about the conformant hypervisor and its capabilities. Two such leaves are guaranteed to be available:0x40000000 and0x40000001. Subsequently-numbered leaves may also be available.

Standard Hypervisor CPUID Leaves

When the leaf at0x40000000 is queried, the hypervisor will return information that provides the maximum hypervisor CPUID leaf number and a vendor ID signature.

RegisterInformation Provided
EAXThe maximum input value for hypervisor CPUID information
EBXHypervisor Vendor ID Signature
ECXHypervisor Vendor ID Signature
EDXHypervisor Vendor ID Signature

If the leaf at0x40000001 is queried, it will return a value representing a vendor-neutral hypervisor interface identification. This determines the semantics of the leaves from0x4000002 through0x400000FF.

RegisterInformation Provided
EAXHypervisor Interface Signature.
EBXReserved
ECXReserved
EDXReserved

These two leaves allow the guest to query the hypervisor vendor ID and interface independently. The vendor ID is provided only for informational and diagnostic purposes. It is recommended that software only base compatibility decisions on the interface signature reported through leaf0x40000001.

Microsoft Hypervisor CPUID Leaves

On hypervisors conforming to the Microsoft hypervisor CPUID interface, the0x40000000 and0x40000001 leaf registers will have the following values.

Hypervisor CPUID Leaf Range - 0x40000000

EAX determines the maximum hypervisor CPUID leaf. EBX-EDX contain the hypervisor vendor ID signature. The vendor ID signature should be used only for reporting and diagnostic purposes.

RegisterInformation Provided
EAXThe maximum input value for hypervisor CPUID information. On Microsoft hypervisors, this will be at least0x40000005.
EBX0x7263694D—“Micr”
ECX0x666F736F—“osof”
EDX0x76482074—“t Hv”

Hypervisor Vendor-Neutral Interface Identification - 0x40000001

EAX contains the hypervisor interface identification signature. This determines the semantics of the leaves from0x40000002 through0x400000FF.

RegisterInformation Provided
EAX0x31237648—“Hv#1”
EBXReserved
ECXReserved
EDXReserved

Hypervisors conforming to the “Hv#1” interface also provide at least the following leaves.

Hypervisor System Identity - 0x40000002

RegisterBitsInformation Provided
EAXBuild Number
EBX31-16Major Version
15-0Minor Version

Hypervisor Feature Identification - 0x40000003

EAX and EBX indicate which features are available to the partition based upon the current partition privileges.

RegisterBitsInformation Provided
EAXCorresponds to bits 31-0 of HV_PARTITION_PRIVILEGE_MASK
EBXCorresponds to bits 63-32 of HV_PARTITION_PRIVILEGE_MASK
ECX4-0Reserved
5Invariant Mperf is available
6Supervisor shadow stack is available
7Architectural PMU is available
8Exception trap intercept is available
31-9Reserved
EDX0Deprecated (previously indicated availability of the MWAIT instruction)
1Guest debugging support is available
2Performance Monitor support is available
3Support for physical CPU dynamic partitioning events is available
4Support for passing hypercall input parameter block via XMM registers is available
5Support for a virtual guest idle state is available
6Support for hypervisor sleep state is available
7Support for querying NUMA distances is available
8Support for determining timer frequencies is available
9Support for injecting synthetic machine checks is available
10Support for guest crash MSRs is available
11Support for debug MSRs is available
12Support for NPIEP is available
13DisableHypervisorAvailable
14ExtendedGvaRangesForFlushVirtualAddressListAvailable
15Support for returning hypercall output via XMM registers is available
16Reserved
17SintPollingModeAvailable
18HypercallMsrLockAvailable
19Use direct synthetic timers
20Support for PAT register available for VSM
21Support for bndcfgs register available for VSM
22Reserved
23Support for synthetic time unhalted timer available
25-24Reserved
26Intel’s Last Branch Record (LBR) feature supported
31-27Reserved

Implementation Recommendations - 0x40000004

Indicates which behaviors the hypervisor recommends the OS implement for optimal performance.

RegisterBitsInformation Provided
EAX0Recommend using hypercall for address space switches rather than MOV to CR3 instruction.
1Recommend using hypercall for local TLB flushes rather than INVLPG or MOV to CR3 instructions.
2Recommend using hypercall for remote TLB flushes rather than inter-processor interrupts.
3Recommend using MSRs for accessing APIC registers EOI, ICR and TPR rather than their memory-mapped counterparts.
4Recommend using the hypervisor-provided MSR to initiate a system RESET.
5Recommend using relaxed timing for this partition. If used, the VM should disable any watchdog timeouts that rely on the timely delivery of external interrupts.
6Recommend using DMA remapping.
7Recommend using interrupt remapping.
8Reserved.
9Recommend deprecating AutoEOI.
10Recommend using SyntheticClusterIpi hypercall.
11Recommend using the newer ExProcessorMasks interface.
12Indicates that the hypervisor is nested within a Hyper-V partition.
13Recommend using INT for MBEC system calls.
14Recommend a nested hypervisor using the enlightened VMCS interface. Also indicates that additional nested enlightenments may be available (see leaf 0x4000000A).
15UseSyncedTimeline – Indicates the partition should consume the QueryPerformanceCounter bias provided by the root partition.
16Reserved
17UseDirectLocalFlushEntire – Indicates the guest should toggle CR4.PGE to flush the entire TLB, as this is more performant than making a hypercall.
18NoNonArchitecturalCoreSharing - indicates that core sharing is not possible. This can be used as an optimization to avoid the performance overhead of STIBP.
31-19Reserved
EBXRecommended number of attempts to retry a spinlock failure before notifying the hypervisor about the failures. 0xFFFFFFFF indicates never notify.
ECX6-0ImplementedPhysicalAddressBits – Reports the physical address width (MAXPHYADDR) reported by the system’s physical processors. If all bits contain 0, the feature is not supported. Note that the value reported is the actual number of physical address bits, and not the bit position used to represent that number.
31-7Reserved
EDXReserved

Hypervisor Implementation Limits - 0x40000005

Describes the scale limits supported in the current hypervisor implementation. If any value is zero, the hypervisor does not expose the corresponding information; otherwise, they have these meanings.

RegisterInformation Provided
EAXThe maximum number of virtual processors supported
EBXThe maximum number of logical processors supported
ECXThe maximum number of physical interrupt vectors available for interrupt remapping.
EDXReserved

Implementation Hardware Features - 0x40000006

Indicates which hardware-specific features have been detected and are currently in use by the hypervisor.

RegisterBitsInformation Provided
EAX0Support for APIC overlay assist is detected and in use.
1Support for MSR bitmaps is detected and in use.
2Support for architectural performance counters is detected and in use.
3Support for second level address translation is detected and in use.
4Support for DMA remapping is detected and in use.
5Support for interrupt remapping is detected and in use.
6Indicates that a memory patrol scrubber is present in the hardware.
7DMA protection is in use.
8HPET is requested.
9Synthetic timers are volatile.
13-10The hypervisor level of the current guest - '0' if non-nested.
14Physical destination mode required.
15Use VMFUNC for alias map switch.
16Support for hardware memory zeroing is present.
17Support for Unrestricted Guest is present.
18Support for resource allocation (RDT-A, PQOS-A) is present.
19Support for resource monitoring (RDT-M, PQOS-M) is present.
20Support for guest virtual PMU is present.
21Support for guest virtual LBR is present.
22Support for guest virtual IPT is present.
23Support for APIC emulation is present.
24ACPI WDAT table is detected and in use by the hypervisor.
31-25Reserved
EBXReserved
ECXReserved
EDXReserved

Nested Hypervisor Feature Identification - 0x40000009

Describes the features exposed to the partition by the hypervisor when running nested. EAX describes access to virtual MSRs. EDX describes access to hypercalls.

RegisterBitsInformation Provided
EAX1-0Reserved
2AccessSynicRegs
3Reserved
4AccessIntrCtrlRegs
5AccessHypercallMsrs
6AccessVpIndex
11-7Reserved
12AccessReenlightenmentControls
31-13Reserved
EBXReserved
ECXReserved
EDX3-0Reserved
4XmmRegistersForFastHypercallAvailable
14-5Reserved
15FastHypercallOutputAvailable
16Reserved
17SintPollingModeAvailable
31-18Reserved

Hypervisor Nested Virtualization Features - 0x4000000A

Indicates which nested virtualization optimizations are available to a nested hypervisor.

RegisterBitsInformation Provided
EAX7-0Enlightened VMCS version (low)
15-8Enlightened VMCS version (high)
16Reserved
17Indicates support for direct virtual flush hypercalls.
18Indicates support for the HvCallFlushGuestPhysicalAddressSpace and HvCallFlushGuestPhysicalAddressList hypercalls (on x64 platforms).
19Indicates support for using an enlightened MSR bitmap.
20Indicates support for combining virtualization exceptions in the page fault exception class.
21Indicates support for non-zero value of the 0x00002802 (GuestIa32DebugCtl) field in the VMCS.
22Indicates support for the enlightened TLB on AMD platforms. ASID flushes do not affect TLB entries derived from the NPT. Hypercalls must be used to invalidate NPT TLB entries. Also indicates support for the HvCallFlushGuestPhysicalAddressSpace and HvCallFlushGuestPhysicalAddressList hypercalls.
31-21Reserved
EBX0Indicates support for the GuestPerfGlobalCtrl and HostPerfGlobalCtrl fields in the enlightened VMCS.
31-1Reserved
ECXReserved
EDXReserved

Versioning

The hypervisor version information is encoded in leaf0x40000002. Two version numbers are provided: the main version and the service version.

The main version includes a major and minor version number and a build number. These correspond to Microsoft Windows release numbers. The service version describes changes made to the main version.

Clients are strongly encouraged to check for hypervisor features by using CPUID leaves0x40000003 through0x40000005 rather than by comparing against version ranges.


Feedback

Was this page helpful?

YesNoNo

Need help with this topic?

Want to try using Ask Learn to clarify or guide you through this topic?

Suggest a fix?

  • Last updated on

In this article

Was this page helpful?

YesNo
NoNeed help with this topic?

Want to try using Ask Learn to clarify or guide you through this topic?

Suggest a fix?