Function

hv_vcpu_run(_:)

Executes a vCPU.

Declaration

func hv_vcpu_run(_ vcpu: hv_vcpuid_t) -> hv_return_t

Parameters

vcpu

The ID of the vCPU.

Return Value

HV_SUCCESS if the operation was successful, otherwise an error code specified in hv_return_t.

Discussion

Call blocks until the next VMEXIT of the vCPU. This function must be called by the owning thread.

See Also

Creating and Managing vCPU Instances

func hv_vcpu_destroy(hv_vcpuid_t) -> hv_return_t

Destroys the vCPU instance associated with the current thread.

func hv_vcpu_interrupt(UnsafeMutablePointer<hv_vcpuid_t>!, UInt32) -> hv_return_t

Forces an immediate VMEXIT of a set of vCPU instances of the VM.

func hv_vcpu_invalidate_tlb(hv_vcpuid_t) -> hv_return_t

Invalidates the translation look-aside buffer (TLB) of a vCPU.

func hv_vcpu_flush(hv_vcpuid_t) -> hv_return_t

Flushes the cached state of a vCPU.

func hv_vcpu_enable_native_msr(hv_vcpuid_t, UInt32, Bool) -> hv_return_t

Enables or disables a machine specific register (MSR) to be used natively by the VM.

func hv_vcpu_get_exec_time(hv_vcpuid_t, UnsafeMutablePointer<UInt64>!) -> hv_return_t

Returns, by reference, the cumulative execution time of a vCPU, in nanoseconds.