Function

hv_vcpu_enable_native_msr

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

Declaration

hv_return_t hv_vcpu_enable_native_msr(hv_vcpuid_t vcpu, uint32_t msr, bool enable);

Parameters

vcpu

The ID of the vCPU.

msr

The ID of the MSR.

enable

If true, the specified MSR is enabled. If false, the specified MSR is disabled.

Return Value

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

Discussion

This function must be called by the owning thread.

See Also

Creating and Managing vCPU Instances

hv_vcpu_create

Creates a vCPU instance for the current thread.

hv_vcpu_destroy

Destroys the vCPU instance associated with the current thread.

hv_vcpu_run

Executes a vCPU.

hv_vcpu_interrupt

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

hv_vcpu_invalidate_tlb

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

hv_vcpu_flush

Flushes the cached state of a vCPU.

hv_vcpu_get_exec_time

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