Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Eliminate free functions in arch::aarch64::vcpu #5117

Merged
merged 4 commits into from
Mar 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/vmm/src/arch/aarch64/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ pub fn configure_system_for_boot(
let vcpu_mpidr = vcpus
.iter_mut()
.map(|cpu| cpu.kvm_vcpu.get_mpidr())
.collect();
.collect::<Result<Vec<_>, _>>()
.map_err(KvmVcpuError::ConfigureRegisters)?;
let cmdline = boot_cmdline
.as_cstring()
.expect("Cannot create cstring from cmdline string");
Expand Down
8 changes: 8 additions & 0 deletions src/vmm/src/arch/aarch64/regs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,14 @@ impl Aarch64RegisterVec {
data: &mut self.data,
}
}

/// Extract the Manufacturer ID from a VCPU state's registers.
/// The ID is found between bits 24-31 of MIDR_EL1 register.
pub fn manifacturer_id(&self) -> Option<u32> {
self.iter()
.find(|reg| reg.id == MIDR_EL1)
.map(|reg| ((reg.value::<u64, 8>() >> 24) & 0xFF) as u32)
}
}

impl Serialize for Aarch64RegisterVec {
Expand Down
Loading