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

Function vmx_restore_tsc

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

Source from the content-addressed store, hash-verified

4165}
4166
4167static int
4168vmx_restore_tsc(void *arg, int vcpu, uint64_t offset)
4169{
4170 struct vmcs *vmcs;
4171 struct vmx *vmx = (struct vmx *)arg;
4172 int error, running, hostcpu;
4173
4174 KASSERT(arg != NULL, ("%s: arg was NULL", __func__));
4175 vmcs = &vmx->vmcs[vcpu];
4176
4177 running = vcpu_is_running(vmx->vm, vcpu, &hostcpu);
4178 if (running && hostcpu != curcpu) {
4179 printf("%s: %s%d is running", __func__, vm_name(vmx->vm), vcpu);
4180 return (EINVAL);
4181 }
4182
4183 if (!running)
4184 VMPTRLD(vmcs);
4185
4186 error = vmx_set_tsc_offset(vmx, vcpu, offset);
4187
4188 if (!running)
4189 VMCLEAR(vmcs);
4190 return (error);
4191}
4192#endif
4193
4194const struct vmm_ops vmm_ops_intel = {

Callers

nothing calls this directly

Calls 6

vcpu_is_runningFunction · 0.85
vm_nameFunction · 0.85
VMPTRLDFunction · 0.85
vmx_set_tsc_offsetFunction · 0.85
VMCLEARFunction · 0.85
printfFunction · 0.50

Tested by

no test coverage detected