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

Function vm_set_register

freebsd/amd64/vmm/vmm.c:1049–1070  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1047}
1048
1049int
1050vm_set_register(struct vm *vm, int vcpuid, int reg, uint64_t val)
1051{
1052 struct vcpu *vcpu;
1053 int error;
1054
1055 if (vcpuid < 0 || vcpuid >= vm->maxcpus)
1056 return (EINVAL);
1057
1058 if (reg >= VM_REG_LAST)
1059 return (EINVAL);
1060
1061 error = vmmops_setreg(vm->cookie, vcpuid, reg, val);
1062 if (error || reg != VM_REG_GUEST_RIP)
1063 return (error);
1064
1065 /* Set 'nextrip' to match the value of %rip */
1066 VCPU_CTR1(vm, vcpuid, "Setting nextrip to %#lx", val);
1067 vcpu = &vm->vcpu[vcpuid];
1068 vcpu->nextrip = val;
1069 return (0);
1070}
1071
1072static bool
1073is_descriptor_table(int reg)

Callers 7

vie_write_byteregFunction · 0.85
vie_update_registerFunction · 0.85
vm_set_register_setFunction · 0.85
vmmdev_ioctlFunction · 0.85
vm_inject_exceptionFunction · 0.85
vm_inject_pfFunction · 0.85
emulate_inout_portFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected