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

Function is_system_register

hypervisor/src/kvm/aarch64/mod.rs:67–80  ·  view source on GitHub ↗

Specifies whether a particular register is a system register or not. The kernel splits the registers on aarch64 in core registers and system registers. So, below we get the system registers by checking that they are not core registers. # Arguments `regid` - The index of the register we are checking.

(regid: u64)

Source from the content-addressed store, hash-verified

65///
66/// * `regid` - The index of the register we are checking.
67pub fn is_system_register(regid: u64) -> bool {
68 if (regid & KVM_REG_ARM_COPROC_MASK as u64) == KVM_REG_ARM_CORE as u64 {
69 return false;
70 }
71
72 let size = regid & KVM_REG_SIZE_MASK;
73
74 assert!(
75 !(size != KVM_REG_SIZE_U32 && size != KVM_REG_SIZE_U64),
76 "Unexpected register size for system register {size}"
77 );
78
79 true
80}
81
82pub fn check_required_kvm_extensions(kvm: &Kvm) -> KvmResult<()> {
83 macro_rules! check_extension {

Callers 1

stateMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected