| 3805 | } |
| 3806 | |
| 3807 | static void |
| 3808 | vmx_set_tmr(struct vlapic *vlapic, int vector, bool level) |
| 3809 | { |
| 3810 | struct vlapic_vtx *vlapic_vtx; |
| 3811 | struct vmx *vmx; |
| 3812 | struct vmcs *vmcs; |
| 3813 | uint64_t mask, val; |
| 3814 | |
| 3815 | KASSERT(vector >= 0 && vector <= 255, ("invalid vector %d", vector)); |
| 3816 | KASSERT(!vcpu_is_running(vlapic->vm, vlapic->vcpuid, NULL), |
| 3817 | ("vmx_set_tmr: vcpu cannot be running")); |
| 3818 | |
| 3819 | vlapic_vtx = (struct vlapic_vtx *)vlapic; |
| 3820 | vmx = vlapic_vtx->vmx; |
| 3821 | vmcs = &vmx->vmcs[vlapic->vcpuid]; |
| 3822 | mask = 1UL << (vector % 64); |
| 3823 | |
| 3824 | VMPTRLD(vmcs); |
| 3825 | val = vmcs_read(VMCS_EOI_EXIT(vector)); |
| 3826 | if (level) |
| 3827 | val |= mask; |
| 3828 | else |
| 3829 | val &= ~mask; |
| 3830 | vmcs_write(VMCS_EOI_EXIT(vector), val); |
| 3831 | VMCLEAR(vmcs); |
| 3832 | } |
| 3833 | |
| 3834 | static void |
| 3835 | vmx_enable_x2apic_mode_ts(struct vlapic *vlapic) |
nothing calls this directly
no test coverage detected