HV_PARTITION_PRIVILEGE_MASK

The HV_PARTITION_PRIVILEGE_MASK collects the flags that a Microsoft-compatible hypervisor’s cpuid leaf 0x40000003 produces in the eax and ebx registers. It is part of the HV_HYPERVISOR_FEATURES or HV_X64_HYPERVISOR_FEATURES that also have the flags from the ecx and edx registers.

Documentation Status

An early form of the HV_PARTITION_PRIVILEGE_MASK is documented in the Windows Driver Kit (WDK) for Windows 7, which was the last to have documentation included. That kit also provides a C-language definition in the HVGDK.H header file. Later kits do not. A search through Google today (12th November 2016) produces just five results for the name, none from Microsoft.

A slightly different HV_PARTITION_PRIVILEGE_MASK is reproduced amidst the text of the Hypervisor Top-Level Functional Specification. That said, the Specification that is offered today (12th November 2016) as the most recent version is a PDF that is three years old. Despite the Microsoft Open Specification Promise, flags that have been added since, notably for Windows 10, seem not yet to be documented anywhere in any sense.

Layout

Formally, the HV_PARTITION_PRIVILEGE_MASK is an 8-byte union to ease the accessing of all flags together:

union {
    UINT64 AsUINT64;
    struct {
        /*  bit fields, see below  */
    };
};

What counts are the bit fields. These change as Microsoft’s hypervisor becomes ever more capable. The masks, names and definitions below are from an assortment of sources: the published C-language definition for Windows 7 and from type information in symbol files for URLMON.DLL in Windows 8 and higher and for the kernel in Windows 8.1 and higher.

Mask Definition Versions
0x00000000`00000001
UINT64 AccessVpRunTimeMsr : 1;
6.1 to 6.3
UINT64 AccessVpRunTimeReg : 1;
10.0 and higher
0x00000000`00000002
UINT64 AccessPartitionReferenceCounter : 1;
6.1 and higher
0x00000000`00000004
UINT64 AccessSynicMsrs : 1;
6.1 to 6.3
UINT64 AccessSynicRegs : 1;
10.0 and higher
0x00000000`00000008
UINT64 AccessSyntheticTimerMsrs : 1;
6.1 to 6.3
UINT64 AccessSyntheticTimerRegs : 1;
10.0 and higher
0x00000000`00000010
UINT64 AccessApicMsrs : 1;
6.1 to 6.3
UINT64 AccessIntrCtrlRegs : 1;
10.0 and higher
0x00000000`00000020
UINT64 AccessHypercallMsrs : 1;
6.1 to 6.3
0x00000000`00000040
UINT64 AccessVpIndex : 1;
6.1 and higher
0x00000000`00000080
UINT64 AccessResetMsr : 1;
6.1 to 6.3
UINT64 AccessResetReg : 1;
10.0 and higher
0x00000000`00000100
UINT64 AccessStatsMsr : 1;
6.1 to 6.3
UINT64 AccessStatsReg : 1;
10.0 and higher
0x00000000`00000200
UINT64 AccessPartitionReferenceTsc : 1;
6.1 and higher
0x00000000`00000400
UINT64 AccessGuestIdleMsr : 1;
6.1 to 6.3
UINT64 AccessGuestIdleReg : 1;
10.0 and higher
0x00000000`00000800
UINT64 AccessFrequencyMsrs : 1;
6.2 to 6.3
UINT64 AccessFrequencyRegs : 1;
10.0 and higher
0x00000000`00001000
UINT64 AccessDebugMsrs : 1;
6.2 to 6.3
UINT64 AccessDebugRegs : 1;
10.0 and higher
 
UINT64 Reserved1 : 21;
6.1 only
UINT64 Reserved1 : 19;
6.3 and higher
0x00000001`00000000
UINT64 CreatePartitions : 1;
6.1 and higher
0x00000002`00000000
UINT64 AccessPartitionId : 1;
6.1 and higher
0x00000004`00000000
UINT64 AccessMemoryPool : 1;
6.1 and higher
0x00000008`00000000
UINT64 AdjustMessageBuffers : 1;
6.1 and higher
0x00000010`00000000
UINT64 PostMessages : 1;
6.1 and higher
0x00000020`00000000
UINT64 SignalEvents : 1;
6.1 and higher
0x00000040`00000000
UINT64 CreatePort : 1;
6.1 and higher
0x00000080`00000000
UINT64 ConnectPort : 1;
6.1 and higher
0x00000100`00000000
UINT64 AccessStats : 1;
6.1 and higher
 
UINT64 Reserved2 : 2;
6.1 and higher
0x00000800`00000000
UINT64 Debugging : 1;
6.1 and higher
0x00001000`00000000
UINT64 CpuManagement : 1;
6.1 and higher
0x00002000`00000000
UINT64 ConfigureProfiler : 1;
6.1 and higher
0x00004000`00000000
UINT64 EnableExpandedStackwalking : 1;
6.3 only
UINT64 AccessVpExitTracing : 1;
10.0 and higher
0x00008000`00000000
UINT64 EnableExtendedGvaRangesForFlushVirtualAddressList : 1;
10.0 and higher
0x00010000`00000000
UINT64 AccessVsm : 1;
10.0 and higher
0x00020000`00000000
UINT64 AccessVpRegisters : 1;
10.0 and higher
 
UINT64 UnusedBit : 1;
10.0 and higher
0x00080000`00000000
UINT64 FastHypercallOutput : 1;
10.0 and higher
0x00100000`00000000
UINT64 EnableExtendedHypercalls : 1;
10.0 and higher
0x00200000`00000000
UINT64 StartVirtualProcessor : 1;
10.0 and higher
 
UINT64 Reserved3 : 18;
6.1 to 6.2
UINT64 Reserved3 : 17;
6.3 only
UINT64 Reserved3 : 10;
10.0 and higher