HvSwitchVirtualAddressSpace function

The HvSwitchVirtualAddressSpace function switches the calling virtual processor's virtual address space.

Syntax


HV_STATUS  HvSwitchVirtualAddressSpace(
  _In_  HV_ADDRESS_SPACE_ID AddressSpace
);

Parameters

AddressSpace [in]

An HV_ADDRESS_SPACE_ID value that identifies the new address space to switch to (that is, a new CR3 value). HV_ADDRESS_SPACE_ID is defined as an unsigned 64-bit (UINT64) value.

Return value

HvSwitchVirtualAddressSpace returns one of the following values. In addition to these values, HvSwitchVirtualAddressSpace can also return one of the values that are specified in Common Hypercall Status Codes.

Return codeDescription
HV_STATUS_SUCCESS

HvSwitchVirtualAddressSpace successfully switched the virtual address space of the calling virtual processor.

HV_STATUS_INVALID_PARAMETER

One of the following invalid parameter conditions exists:

  • The specified address space identifier is not a valid CR3 value.

  • One or more reserved bits in the specified address space identifier (as defined by the x64 architecture) were set.

 

Remarks

For x64 implementations of the hypervisor, the HvSwitchVirtualAddressSpace call also updates the CR3 register. However, unlike a MOV to CR3 instruction, HvSwitchVirtualAddressSpace does not have the side-effect of flushing the virtual processor's TLB.

The HvSwitchVirtualAddressSpace call, unlike most, operates implicitly in the context of the calling partition and virtual processor.

HvSwitchVirtualAddressSpace [fast]

Call Code = 0x0001

Input Parameters

0

AddressSpace (8 bytes)

 

Requirements

Version

HvSwitchVirtualAddressSpace is available in version 1.0 and later versions of the hypervisor.

Header

Hvgdk.h (include Hvgdk.h)

IRQL

Any level

 

 

Send comments about this topic to Microsoft

Build date: 11/16/2013

Show:
© 2014 Microsoft. All rights reserved.