()
| 3318 | |
| 3319 | #[test] |
| 3320 | fn test_setup_fpu() { |
| 3321 | let hv = hypervisor::new().unwrap(); |
| 3322 | let vm = hv |
| 3323 | .create_vm(HypervisorVmConfig::default()) |
| 3324 | .expect("new VM fd creation failed"); |
| 3325 | let vcpu = vm.create_vcpu(0, None).unwrap(); |
| 3326 | setup_fpu(vcpu.as_ref()).unwrap(); |
| 3327 | |
| 3328 | let expected_fpu: FpuState = FpuState { |
| 3329 | fcw: 0x37f, |
| 3330 | mxcsr: 0x1f80, |
| 3331 | ..Default::default() |
| 3332 | }; |
| 3333 | let actual_fpu: FpuState = vcpu.get_fpu().unwrap(); |
| 3334 | // TODO: auto-generate kvm related structures with PartialEq on. |
| 3335 | assert_eq!(expected_fpu.fcw, actual_fpu.fcw); |
| 3336 | // Setting the mxcsr register from FpuState inside setup_fpu does not influence anything. |
| 3337 | // See 'kvm_arch_vcpu_ioctl_set_fpu' from arch/x86/kvm/x86.c. |
| 3338 | // The mxcsr will stay 0 and the assert below fails. Decide whether or not we should |
| 3339 | // remove it at all. |
| 3340 | // assert!(expected_fpu.mxcsr == actual_fpu.mxcsr); |
| 3341 | } |
| 3342 | |
| 3343 | #[test] |
| 3344 | fn test_setup_msrs() { |
nothing calls this directly
no test coverage detected