| 4165 | } |
| 4166 | |
| 4167 | static int |
| 4168 | vmx_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 | |
| 4194 | const struct vmm_ops vmm_ops_intel = { |
nothing calls this directly
no test coverage detected