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

Function vmcs_snapshot_reg

freebsd/amd64/vmm/intel/vmcs.c:468–494  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

466}
467
468int
469vmcs_snapshot_reg(struct vmcs *vmcs, int running, int ident,
470 struct vm_snapshot_meta *meta)
471{
472 int ret;
473 uint64_t val;
474
475 if (meta->op == VM_SNAPSHOT_SAVE) {
476 ret = vmcs_getreg(vmcs, running, ident, &val);
477 if (ret != 0)
478 goto done;
479
480 SNAPSHOT_VAR_OR_LEAVE(val, meta, ret, done);
481 } else if (meta->op == VM_SNAPSHOT_RESTORE) {
482 SNAPSHOT_VAR_OR_LEAVE(val, meta, ret, done);
483
484 ret = vmcs_setreg(vmcs, running, ident, val);
485 if (ret != 0)
486 goto done;
487 } else {
488 ret = EINVAL;
489 goto done;
490 }
491
492done:
493 return (ret);
494}
495
496int
497vmcs_snapshot_desc(struct vmcs *vmcs, int running, int seg,

Callers 1

vmx_vmcx_snapshotFunction · 0.85

Calls 2

vmcs_getregFunction · 0.85
vmcs_setregFunction · 0.85

Tested by

no test coverage detected