| 1047 | } |
| 1048 | |
| 1049 | int |
| 1050 | vm_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 | |
| 1072 | static bool |
| 1073 | is_descriptor_table(int reg) |
no outgoing calls
no test coverage detected