Contents

hv_vcpu_run(_:)

Starts the execution of a vCPU.

Declaration

func hv_vcpu_run(_ vcpu: hv_vcpu_t) -> hv_return_t

Parameters

  • vcpu:

    The instance 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 exit of the vCPU. The owning thread must call this function.

On an Apple Silicon, if the exit is of type HV_EXIT_REASON_VTIMER_ACTIVATED, the VTimer is automatically masked. As a result, no timer fires until the timer is unmasked with hv_vcpu_set_vtimer_mask(_:_:).

On an Intel-based Mac, hv_vcpu_run(_:) exits from causes external to the guest. To avoid the overhead of spurious exits use hv_vcpu_run_until(_:_:) with the deadline HV_DEADLINE_FOREVER.

See Also

Runtime