<!--
{
  "documentType" : "article",
  "framework" : "Hypervisor",
  "identifier" : "/documentation/Hypervisor/virtual-machine-control-structure-vmcs",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "Virtual Machine Control Structure (VMCS)"
}
-->

# Virtual Machine Control Structure (VMCS)

Read and write to fields of the virtual machine control structure.

## Topics

### Capabilities

[`func hv_vmx_read_capability(hv_vmx_capability_t, UnsafeMutablePointer<UInt64>) -> hv_return_t`](/documentation/Hypervisor/hv_vmx_read_capability(_:_:))

Returns, by reference, the VMX virtualization capabilities of the host processor.

[`func hv_vmx_get_msr_info(hv_vmx_msr_info_t, UnsafeMutablePointer<UInt64>) -> hv_return_t`](/documentation/Hypervisor/hv_vmx_get_msr_info(_:_:))

Returns information about guest MSR configuration.

[`struct hv_vmx_capability_t`](/documentation/Hypervisor/hv_vmx_capability_t)

The type that describes Virtual Machine Extensions (VMX) capability fields.

[VMX Capabilities](/documentation/Hypervisor/1469645-vmx-capabilities)

An enumeration that represents the available VMX capabilities.

[`typealias hv_vmx_msr_info_t`](/documentation/Hypervisor/hv_vmx_msr_info_t)

The type that describes Move to Status Register (MSR) information fields.

[MSR Information Fields](/documentation/Hypervisor/3567084-msr-information-fields)

The type that describes Machine Specific Register (MSR) fields.

### Field management

[Virtual Machine Control Structure (VMCS) Field IDs](/documentation/Hypervisor/virtual-machine-control-structure-vmcs-field-ids)

Fields you can read or change using the Hypervisor framework’s read and write functions.

[`func hv_vmx_vcpu_read_vmcs(hv_vcpuid_t, UInt32, UnsafeMutablePointer<UInt64>) -> hv_return_t`](/documentation/Hypervisor/hv_vmx_vcpu_read_vmcs(_:_:_:))

Returns, by reference, the current value of a virtual machine control structure (VMCS) field of a vCPU.

[`func hv_vmx_vcpu_write_vmcs(hv_vcpuid_t, UInt32, UInt64) -> hv_return_t`](/documentation/Hypervisor/hv_vmx_vcpu_write_vmcs(_:_:_:))

Sets the value of a virtual machine control structure (VMCS) field of a vCPU.

[`func hv_vmx_vcpu_get_cap_write_vmcs(hv_vcpuid_t, UInt32, UnsafeMutablePointer<UInt64>, UnsafeMutablePointer<UInt64>) -> hv_return_t`](/documentation/Hypervisor/hv_vmx_vcpu_get_cap_write_vmcs(_:_:_:_:))

Returns the allowed_0 and allowed_1 masks for a VMCS field of a vCPU.

[`func hv_vmx_vcpu_set_apic_address(hv_vcpuid_t, hv_gpaddr_t) -> hv_return_t`](/documentation/Hypervisor/hv_vmx_vcpu_set_apic_address(_:_:))

Sets the address of the guest Advanced Programmable Interrupt Controller (APIC) for a vCPU in the guest physical address space of the VM.

[Virtual Machine control structure (VMCS) Field IDs](/documentation/Hypervisor/1469436-virtual_machine_control_structur-enum)

Identify the fields of the virtual machine control structure.

### Shadow fields

[`func hv_vmx_vcpu_read_shadow_vmcs(hv_vcpuid_t, UInt32, UnsafeMutablePointer<UInt64>) -> hv_return_t`](/documentation/Hypervisor/hv_vmx_vcpu_read_shadow_vmcs(_:_:_:))

Returns the current value of a shadow VMCS field of a vCPU.

[`func hv_vmx_vcpu_set_shadow_access(hv_vcpuid_t, UInt32, hv_shadow_flags_t) -> hv_return_t`](/documentation/Hypervisor/hv_vmx_vcpu_set_shadow_access(_:_:_:))

Set the access permissions of a shadow VMCS field of a vCPU.

[`func hv_vmx_vcpu_write_shadow_vmcs(hv_vcpuid_t, UInt32, UInt64) -> hv_return_t`](/documentation/Hypervisor/hv_vmx_vcpu_write_shadow_vmcs(_:_:_:))

Set the value of a shadow VMCS field of a vCPU.

[`typealias hv_shadow_flags_t`](/documentation/Hypervisor/hv_shadow_flags_t)

Shadow VMCS permissions for the set shadow access function.

[Shadow Permissions](/documentation/Hypervisor/3567083-shadow_permissions-enum)

Permissions that define access to the shadow VMCS fields.

### Shared types

[VMX Creation Behavior](/documentation/Hypervisor/1469509-vmx_creation_behavior-enum)

An enumeration that describes VMX creation behavior options.

[VMX Exit Reasons](/documentation/Hypervisor/1469470-vmx-exit-reasons)

An enumertion that describes the VMX exit reasons.

[Interrupt request (IRQ) codes](/documentation/Hypervisor/1469442-interrupt_request_irq_codes-enum)

An enumeration that describes available interrupt codes.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)