MCPcopy Create free account
hub / github.com/cloud-hypervisor/cloud-hypervisor / test_read_mpidr

Function test_read_mpidr

vmm/src/cpu.rs:3464–3476  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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]

Callers

nothing calls this directly

Calls 7

newFunction · 0.85
create_vmMethod · 0.45
create_vcpuMethod · 0.45
create_vcpu_initMethod · 0.45
get_preferred_targetMethod · 0.45
get_sys_regMethod · 0.45
vcpu_initMethod · 0.45

Tested by

no test coverage detected