()
| 3462 | |
| 3463 | #[test] |
| 3464 | fn test_read_mpidr() { |
| 3465 | let hv = hypervisor::new().unwrap(); |
| 3466 | let vm = hv.create_vm(HypervisorVmConfig::default()).unwrap(); |
| 3467 | let vcpu = vm.create_vcpu(0, None).unwrap(); |
| 3468 | let mut kvi = vcpu.create_vcpu_init(); |
| 3469 | vm.get_preferred_target(&mut kvi).unwrap(); |
| 3470 | |
| 3471 | // Must fail when vcpu is not initialized yet. |
| 3472 | vcpu.get_sys_reg(MPIDR_EL1).unwrap_err(); |
| 3473 | |
| 3474 | vcpu.vcpu_init(&kvi).unwrap(); |
| 3475 | assert_eq!(vcpu.get_sys_reg(MPIDR_EL1).unwrap(), 0x80000000); |
| 3476 | } |
| 3477 | |
| 3478 | #[cfg(feature = "kvm")] |
| 3479 | #[test] |
nothing calls this directly
no test coverage detected