• Home
  • Raw
  • Download

Lines Matching refs:state

964 	struct kvm_x86_state *state;  in vcpu_save_state()  local
970 TEST_ASSERT(nested_size <= sizeof(state->nested_), in vcpu_save_state()
972 nested_size, sizeof(state->nested_)); in vcpu_save_state()
990 state = malloc(sizeof(*state) + nmsrs * sizeof(state->msrs.entries[0])); in vcpu_save_state()
991 r = ioctl(vcpu->fd, KVM_GET_VCPU_EVENTS, &state->events); in vcpu_save_state()
995 r = ioctl(vcpu->fd, KVM_GET_MP_STATE, &state->mp_state); in vcpu_save_state()
999 r = ioctl(vcpu->fd, KVM_GET_REGS, &state->regs); in vcpu_save_state()
1003 r = ioctl(vcpu->fd, KVM_GET_XSAVE, &state->xsave); in vcpu_save_state()
1008 r = ioctl(vcpu->fd, KVM_GET_XCRS, &state->xcrs); in vcpu_save_state()
1013 r = ioctl(vcpu->fd, KVM_GET_SREGS, &state->sregs); in vcpu_save_state()
1018 state->nested.size = sizeof(state->nested_); in vcpu_save_state()
1019 r = ioctl(vcpu->fd, KVM_GET_NESTED_STATE, &state->nested); in vcpu_save_state()
1022 TEST_ASSERT(state->nested.size <= nested_size, in vcpu_save_state()
1024 state->nested.size, nested_size); in vcpu_save_state()
1026 state->nested.size = 0; in vcpu_save_state()
1028 state->msrs.nmsrs = nmsrs; in vcpu_save_state()
1030 state->msrs.entries[i].index = list->indices[i]; in vcpu_save_state()
1031 r = ioctl(vcpu->fd, KVM_GET_MSRS, &state->msrs); in vcpu_save_state()
1035 r = ioctl(vcpu->fd, KVM_GET_DEBUGREGS, &state->debugregs); in vcpu_save_state()
1040 return state; in vcpu_save_state()
1043 void vcpu_load_state(struct kvm_vm *vm, uint32_t vcpuid, struct kvm_x86_state *state) in vcpu_load_state() argument
1048 r = ioctl(vcpu->fd, KVM_SET_XSAVE, &state->xsave); in vcpu_load_state()
1053 r = ioctl(vcpu->fd, KVM_SET_XCRS, &state->xcrs); in vcpu_load_state()
1058 r = ioctl(vcpu->fd, KVM_SET_SREGS, &state->sregs); in vcpu_load_state()
1062 r = ioctl(vcpu->fd, KVM_SET_MSRS, &state->msrs); in vcpu_load_state()
1063 … TEST_ASSERT(r == state->msrs.nmsrs, "Unexpected result from KVM_SET_MSRS, r: %i (failed at %x)", in vcpu_load_state()
1064 r, r == state->msrs.nmsrs ? -1 : state->msrs.entries[r].index); in vcpu_load_state()
1066 r = ioctl(vcpu->fd, KVM_SET_VCPU_EVENTS, &state->events); in vcpu_load_state()
1070 r = ioctl(vcpu->fd, KVM_SET_MP_STATE, &state->mp_state); in vcpu_load_state()
1074 r = ioctl(vcpu->fd, KVM_SET_DEBUGREGS, &state->debugregs); in vcpu_load_state()
1078 r = ioctl(vcpu->fd, KVM_SET_REGS, &state->regs); in vcpu_load_state()
1082 if (state->nested.size) { in vcpu_load_state()
1083 r = ioctl(vcpu->fd, KVM_SET_NESTED_STATE, &state->nested); in vcpu_load_state()