MCPcopy Create free account
hub / github.com/F-Stack/f-stack / vmx_set_tmr

Function vmx_set_tmr

freebsd/amd64/vmm/intel/vmx.c:3807–3832  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3805}
3806
3807static void
3808vmx_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
3834static void
3835vmx_enable_x2apic_mode_ts(struct vlapic *vlapic)

Callers

nothing calls this directly

Calls 5

vcpu_is_runningFunction · 0.85
VMPTRLDFunction · 0.85
vmcs_readFunction · 0.85
vmcs_writeFunction · 0.85
VMCLEARFunction · 0.85

Tested by

no test coverage detected