Edit

Feature and Interface Discovery

This section describes how guest software detects the presence of a hypervisor and queries its capabilities, features, and version information using architecture-specific discovery mechanisms.

Feature and Interface Discovery (x64)

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 with hypercalls.

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 and 0x40000001. Subsequently-numbered leaves may also be available.

Standard Hypervisor CPUID Leaves

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

Register Information Provided
EAX The maximum input value for hypervisor CPUID information
EBX Hypervisor Vendor ID Signature
ECX Hypervisor Vendor ID Signature
EDX Hypervisor Vendor ID Signature

If the leaf at 0x40000001 is queried, it will return a value representing a vendor-neutral hypervisor interface identification. This determines the semantics of the leaves from 0x4000002 through 0x400000FF.

Register Information Provided
EAX Hypervisor Interface Signature.
EBX Reserved
ECX Reserved
EDX Reserved

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 leaf 0x40000001.

Microsoft Hypervisor CPUID Leaves

On hypervisors conforming to the Microsoft hypervisor CPUID interface, the 0x40000000 and 0x40000001 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.

Register Information Provided
EAX The maximum input value for hypervisor CPUID information. On Microsoft hypervisors, this will be at least 0x40000005.
EBX 0x7263694D—“Micr”
ECX 0x666F736F—“osof”
EDX 0x76482074—“t Hv”

Hypervisor Vendor-Neutral Interface Identification - 0x40000001

EAX contains the hypervisor interface identification signature. This determines the semantics of the leaves from 0x40000002 through 0x400000FF.

Register Information Provided
EAX 0x31237648—“Hv#1”
EBX Reserved
ECX Reserved
EDX Reserved

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

Hypervisor System Identity - 0x40000002

Register Bits Information Provided
EAX Build Number
EBX 31-16 Major Version
15-0 Minor Version

Hypervisor Feature Identification - 0x40000003

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

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

Implementation Recommendations - 0x40000004

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

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

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.

Register Information Provided
EAX The maximum number of virtual processors supported
EBX The maximum number of logical processors supported
ECX The maximum number of physical interrupt vectors available for interrupt remapping.
EDX Reserved

Implementation Hardware Features - 0x40000006

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

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

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.

Register Bits Information Provided
EAX 1-0 Reserved
2 AccessSynicRegs
3 Reserved
4 AccessIntrCtrlRegs
5 AccessHypercallMsrs
6 AccessVpIndex
11-7 Reserved
12 AccessReenlightenmentControls
31-13 Reserved
EBX Reserved
ECX Reserved
EDX 3-0 Reserved
4 XmmRegistersForFastHypercallAvailable
14-5 Reserved
15 FastHypercallOutputAvailable
16 Reserved
17 SintPollingModeAvailable
31-18 Reserved

Hypervisor Nested Virtualization Features - 0x4000000A

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

Register Bits Information Provided
EAX 7-0 Enlightened VMCS version (low)
15-8 Enlightened VMCS version (high)
16 Reserved
17 Indicates support for direct virtual flush hypercalls.
18 Indicates support for the HvCallFlushGuestPhysicalAddressSpace and HvCallFlushGuestPhysicalAddressList hypercalls (on x64 platforms).
19 Indicates support for using an enlightened MSR bitmap.
20 Indicates support for combining virtualization exceptions in the page fault exception class.
21 Indicates support for non-zero value of the 0x00002802 (GuestIa32DebugCtl) field in the VMCS.
22 Indicates 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-21 Reserved
EBX 0 Indicates support for the GuestPerfGlobalCtrl and HostPerfGlobalCtrl fields in the enlightened VMCS.
31-1 Reserved
ECX Reserved
EDX Reserved

Versioning

The hypervisor version information is encoded in leaf 0x40000002. 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 leaves 0x40000003 through 0x40000005 rather than by comparing against version ranges.

Feature and Interface Discovery (ARM64)

On the ARM64 architecture, the following mechanisms are used for feature and interface discovery:

  • HvRegister queries via HvCallGetVpRegisters – Used for static feature and version information.
  • Memory-mapped registers – Used for status and control values.

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

Hypervisor Discovery

Before using most hypervisor interfaces, software should first determine whether it's running within a virtualized environment.

On ARM64, guest software can discover the hypervisor using the SMCCC (SMC Calling Convention) standard interface. The discovery is performed using either the HVC or SMC instruction with the function ID 0xC600FF0 in X0 (this corresponds to a 64-bit vendor-specific hypervisor call, VENDOR_HYP_FUNCTION_CODE_UID). The call follows the SMCCC conventions, including an imm16 of 0. The Microsoft hypervisor returns the following values representing GUID 4d32ba58-cd24-4764-8eef-6c7516597024:

Register Value
X0 0x4d32ba58
X1 0xcd244764
X2 0x8eef6c75
X3 0x16597024

Once a hypervisor is detected, guest software can query hypervisor capabilities through synthetic registers using the HvCallGetVpRegisters hypercall. Several key registers can be queried before the Guest OS ID register is set, enabling early discovery of hypervisor features during boot.

Hypervisor Feature Registers

ARM64 platforms query hypervisor information through synthetic registers rather than CPUID instructions. These registers provide equivalent information to their x64 CPUID counterparts and are accessed via HvCallGetVpRegisters. All feature registers return 128-bit values.

Hypervisor System Identity - HvRegisterHypervisorVersion

Returns version information encoded in a 128-bit value. The layout is identical to x64 CPUID leaf 0x40000002, with x64 register values packed into the 128-bit result (EAX in bits 31-0, EBX in bits 63-32, ECX in bits 95-64, EDX in bits 127-96).

Hypervisor Feature Identification - HvRegisterPrivilegesAndFeaturesInfo

Equivalent to x64 CPUID leaf 0x40000003. Indicates which features are available to the partition based upon current partition privileges. Returns a 128-bit value with these fields:

Bits Information Provided
31-0 Corresponds to bits 31-0 of HV_PARTITION_PRIVILEGE_MASK
63-32 Corresponds to bits 63-32 of HV_PARTITION_PRIVILEGE_MASK
64 Guest debugging support is available.
65 Performance Monitor support is available.
66 Support for physical CPU dynamic partitioning events is available.
67 Support for a virtual guest idle state is available.
68 Support for hypervisor sleep state is available.
69 Support for querying NUMA distances is available.
70 Support for determining timer frequencies is available.
71 Support for injecting synthetic machine checks is available.
72 Support for guest crash registers is available.
73 Reserved.
74 DisableHypervisorAvailable.
75 Reserved.
76 SintPollingModeAvailable.
77 Use direct synthetic timers.
127-78 Reserved.

Implementation Recommendations - HvRegisterFeaturesInfo

Equivalent to x64 CPUID leaf 0x40000004. Indicates which behaviors the hypervisor recommends the OS implement for optimal performance. Returns a 128-bit value.

Bits Information Provided
0 UseHvRegisterForReset - On ARM64, this is always false (partitions should use PSCI SYSTEM_RESET instead).
1 Recommend using relaxed timing for this partition. If used, the VM should disable any watchdog timeouts that rely on the timely delivery of external interrupts.
2 Recommend using SyntheticClusterIpi hypercall. On ARM64, this is false for the root partition (which should use ICC_SGI1R_EL1 directly) and true for guest partitions.
3 Recommend using the newer ExProcessorMasks interface.
4 Indicates that the hypervisor is nested within a Hyper-V partition.
5 Indicates the partition should consume the QueryPerformanceCounter bias provided by the root partition.
20-6 Reserved
21 UseHypercallForMmioAccess
22 UseGpaPinningHypercall
23 WakeVps
25-24 Reserved
26 MapPartitionEventLogBuffer
31-27 Reserved
63-32 Recommended number of attempts to retry a spinlock failure before notifying the hypervisor about the failures. 0xFFFFFFFF indicates never notify.
127-64 Reserved

Hypervisor Implementation Limits - HvRegisterImplementationLimitsInfo

Describes the scale limits supported in the current hypervisor implementation. If any value is zero, the hypervisor does not expose the corresponding information. Returns a 128-bit value with a layout identical to x64 CPUID leaf 0x40000005, with x64 register values packed into the 128-bit result (EAX in bits 31-0, EBX in bits 63-32, ECX in bits 95-64, EDX in bits 127-96).

Implementation Hardware Features - HvRegisterHardwareFeaturesInfo

Equivalent to x64 CPUID leaf 0x40000006. Indicates which hardware-specific features have been detected and are currently in use by the hypervisor. Returns a 128-bit value.

Bits Information Provided
0 Support for architectural performance counters is detected and in use.
1 Support for second level address translation is detected and in use.
2 Support for DMA remapping is detected and in use.
3 Support for interrupt remapping is detected and in use.
4 Indicates that a memory patrol scrubber is present in the hardware.
5 DMA protection is in use.
6 Synthetic timers are volatile.
127-7 Reserved

Core Performance Monitoring Unit (PMU) Event Types

A baseline set of Arm architecture Core PMU events is available to guest partitions on all ARM64 platforms. Additional Core PMU events are available on Azure Cobalt 100 and Azure Cobalt 200. Event numbers and names follow the Arm architecture PMU event definitions.

Guest software can identify the platform by reading the MIDR_EL1 register and comparing the low 32 bits for exact equality against the values in the following table, without masking the implementer, variant, architecture, part, or revision fields. This is the recommended heuristic for determining whether the additional Core PMU event types are available before accessing them.

Platform MIDR_EL1
Azure Cobalt 100 0x410FD490
Azure Cobalt 200 0x410FD841

In the following table, a checkmark (✓) indicates that the Core PMU event type is supported for guest partitions on the corresponding platform.

Event Number Event Name All ARM64 platforms Azure Cobalt 100 Azure Cobalt 200
0x0000 SW_INCR
0x0001 L1I_CACHE_REFILL
0x0002 L1I_TLB_REFILL
0x0003 L1D_CACHE_REFILL
0x0004 L1D_CACHE
0x0005 L1D_TLB_REFILL
0x0008 INST_RETIRED
0x0010 BR_MIS_PRED
0x0011 CPU_CYCLES
0x0012 BR_PRED
0x0013 MEM_ACCESS
0x0014 L1I_CACHE
0x0016 L2D_CACHE
0x0017 L2D_CACHE_REFILL
0x001A MEMORY_ERROR
0x001B INST_SPEC
0x001C TTBR_WRITE_RETIRED
0x0020 L2D_CACHE_ALLOCATE
0x0021 BR_RETIRED
0x0022 BR_MIS_PRED_RETIRED
0x0023 STALL_FRONTEND
0x0024 STALL_BACKEND
0x0025 L1D_TLB
0x0026 L1I_TLB
0x0029 L3D_CACHE_ALLOCATE
0x002D L2D_TLB_REFILL
0x002F L2D_TLB
0x0031 REMOTE_ACCESS
0x0034 DTLB_WALK
0x0035 ITLB_WALK
0x0036 LL_CACHE_RD
0x0037 LL_CACHE_MISS_RD
0x0039 L1D_CACHE_LMISS_RD
0x003A OP_RETIRED
0x003B OP_SPEC
0x003C STALL
0x003D STALL_SLOT_BACKEND
0x003E STALL_SLOT_FRONTEND
0x003F STALL_SLOT
0x0040 L1D_CACHE_RD
0x0041 L1D_CACHE_WR
0x0042 L1D_CACHE_REFILL_RD
0x0043 L1D_CACHE_REFILL_WR
0x0044 L1D_CACHE_REFILL_INNER
0x0045 L1D_CACHE_REFILL_OUTER
0x0046 L1D_CACHE_WB_VICTIM
0x004C L1D_TLB_REFILL_RD
0x004D L1D_TLB_REFILL_WR
0x004E L1D_TLB_RD
0x004F L1D_TLB_WR
0x0050 L2D_CACHE_RD
0x0051 L2D_CACHE_WR
0x0052 L2D_CACHE_REFILL_RD
0x0053 L2D_CACHE_REFILL_WR
0x0056 L2D_CACHE_WB_VICTIM
0x005C L2D_TLB_REFILL_RD
0x005D L2D_TLB_REFILL_WR
0x005E L2D_TLB_RD
0x005F L2D_TLB_WR
0x0066 MEM_ACCESS_RD
0x0067 MEM_ACCESS_WR
0x0068 UNALIGNED_LD_SPEC
0x0069 UNALIGNED_ST_SPEC
0x0070 LD_SPEC
0x0071 ST_SPEC
0x0073 DP_SPEC
0x0074 ASE_SPEC
0x0075 VFP_SPEC
0x0077 CRYPTO_SPEC
0x0078 BR_IMMED_SPEC
0x007A BR_INDIRECT_SPEC
0x01B8 L2D_CACHE_L1HWPRF
0x01B9 L2D_CACHE_REFILL_L1HWPRF
0x4004 CNT_CYCLES
0x4005 STALL_BACKEND_MEM
0x4006 L1I_CACHE_LMISS
0x4009 L2D_CACHE_LMISS_RD
0x4020 LDST_ALIGN_LAT
0x4021 LD_ALIGN_LAT
0x4022 ST_ALIGN_LAT
0x4024 MEM_ACCESS_CHECKED
0x4025 MEM_ACCESS_CHECKED_RD
0x4026 MEM_ACCESS_CHECKED_WR
0x8006 SVE_INST_SPEC

Versioning

The hypervisor version information is encoded in HvRegisterHypervisorVersion. The format matches the x64 equivalent.