Virtual MMU Data Types

The hypervisor defines the following data types to manage virtual memory.

Virtual Address Spaces

The hypervisor introduces the concept of a virtual address space. The guest uses virtual address spaces to define the mapping between guest virtual addresses (GVAs) and guest physical addresses (GPAs). The guest operating system can decide how and where to use virtual address spaces. In most operating systems (including Windows), a different virtual address space is used for each process.

Virtual address spaces are identified by a caller-defined 64-bit identifier value, which is specified with the following data type. On x64 implementations of the hypervisor, this value is the same as the value within the virtual processor's CR3 register, which points to the guest's page table structures.


typedef UINT64 HV_ADDRESS_SPACE_ID;

Virtual Address Flush Flags

The hypervisor provides hypercalls that allow the guest to flush (that is, invalidate) entire virtual address spaces or portions of these address spaces. The guest can modify the behavior of the flush operation by using a set of flags, defined as follows:


typedef UINT32 HV_FLUSH_FLAGS;

#define HV_FLUSH_ALL_PROCESSORS  0x00000001
#define HV_FLUSH_ALL_VIRTUAL_ADDRESS_SPACES  0x00000002
#define HV_FLUSH_NON_GLOBAL_MAPPINGS_ONLY  0x00000004

The preceding flags are described in the HvFlushVirtualAddressList and HvFlushVirtualAddressSpace reference pages.

Cache Types

Several structures include cache-type members. Encodings are defined in the HV_CACHE_TYPE enumeration.

Virtual Address Translation Types

The call to the HvTranslateVirtualAddress hypercall function takes a collection of input control flags and returns a result code and a collection of output flags.

The input control flags are defined as follows and are described in the HvTranslateVirtualAddress reference page:


typedef UINT64 HV_TRANSLATE_GVA_CONTROL_FLAGS;

#define HV_TRANSLATE_GVA_VALIDATE_READ  0x0001
#define HV_TRANSLATE_GVA_VALIDATE_WRITE  0x0002
#define HV_TRANSLATE_GVA_VALIDATE_EXECUTE  0x0004
#define HV_TRANSLATE_GVA_PRIVILEGE_EXEMPT  0x0008
#define HV_TRANSLATE_GVA_SET_PAGE_TABLE_BITS  0x0010
#define HV_TRANSLATE_GVA_TLB_FLUSH_INHIBIT  0x0020

The returned result code is defined by values in the HV_TRANSLATE_GVA_RESULT_CODE enumeration.

HvTranslateVirtualAddress stores the results of the translation including the result code and flags in a HV_TRANSLATE_GVA_RESULT union.

Gpa Access Types

The calls to the HvReadGpa and HvWriteGpa hypercall functions take a collection of input control flags and return a result code. The input control flags are defined with the HV_ACCESS_GPA_CONTROL_FLAGS union.

The return result code is defined with a value from the HV_ACCESS_GPA_RESULT_CODE enumeration.

HvReadGpa and HvWriteGpa store the results of an access operation in a HV_ACCESS_GPA_RESULT union.

 

 

Send comments about this topic to Microsoft

Build date: 11/16/2013

Show:
© 2014 Microsoft. All rights reserved.