From 2caf5e3b2b6da98461d325b2918f2ad95ad68f82 Mon Sep 17 00:00:00 2001 From: Rob Bradford Date: Wed, 11 May 2022 14:31:50 +0100 Subject: [PATCH] arch: Use more descriptive name for hypervisor::Vcpu than fd This variable name is residual from when these functions acted directly on the vCPU fd rather than the hypervisor wrapper. Signed-off-by: Rob Bradford --- arch/src/aarch64/mod.rs | 6 +++--- arch/src/x86_64/mod.rs | 16 ++++++++-------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/arch/src/aarch64/mod.rs b/arch/src/aarch64/mod.rs index fa8b2af38..5ca825f30 100644 --- a/arch/src/aarch64/mod.rs +++ b/arch/src/aarch64/mod.rs @@ -64,16 +64,16 @@ pub struct EntryPoint { /// Configure the specified VCPU, and return its MPIDR. pub fn configure_vcpu( - fd: &Arc, + vcpu: &Arc, id: u8, kernel_entry_point: Option, ) -> super::Result { if let Some(kernel_entry_point) = kernel_entry_point { - regs::setup_regs(fd, id, kernel_entry_point.entry_addr.raw_value()) + regs::setup_regs(vcpu, id, kernel_entry_point.entry_addr.raw_value()) .map_err(Error::RegsConfiguration)?; } - let mpidr = fd.read_mpidr().map_err(Error::VcpuRegMpidr)?; + let mpidr = vcpu.read_mpidr().map_err(Error::VcpuRegMpidr)?; Ok(mpidr) } diff --git a/arch/src/x86_64/mod.rs b/arch/src/x86_64/mod.rs index aab62a8ef..27910f5aa 100644 --- a/arch/src/x86_64/mod.rs +++ b/arch/src/x86_64/mod.rs @@ -744,7 +744,7 @@ pub fn generate_common_cpuid( } pub fn configure_vcpu( - fd: &Arc, + vcpu: &Arc, id: u8, kernel_entry_point: Option, vm_memory: &GuestMemoryAtomic, @@ -756,23 +756,23 @@ pub fn configure_vcpu( CpuidPatch::set_cpuid_reg(&mut cpuid, 0xb, None, CpuidReg::EDX, u32::from(id)); CpuidPatch::set_cpuid_reg(&mut cpuid, 0x1f, None, CpuidReg::EDX, u32::from(id)); - fd.set_cpuid2(&cpuid) + vcpu.set_cpuid2(&cpuid) .map_err(|e| Error::SetSupportedCpusFailed(e.into()))?; if kvm_hyperv { - fd.enable_hyperv_synic().unwrap(); + vcpu.enable_hyperv_synic().unwrap(); } - regs::setup_msrs(fd).map_err(Error::MsrsConfiguration)?; + regs::setup_msrs(vcpu).map_err(Error::MsrsConfiguration)?; if let Some(kernel_entry_point) = kernel_entry_point { if let Some(entry_addr) = kernel_entry_point.entry_addr { // Safe to unwrap because this method is called after the VM is configured - regs::setup_regs(fd, entry_addr.raw_value()).map_err(Error::RegsConfiguration)?; - regs::setup_fpu(fd).map_err(Error::FpuConfiguration)?; - regs::setup_sregs(&vm_memory.memory(), fd).map_err(Error::SregsConfiguration)?; + regs::setup_regs(vcpu, entry_addr.raw_value()).map_err(Error::RegsConfiguration)?; + regs::setup_fpu(vcpu).map_err(Error::FpuConfiguration)?; + regs::setup_sregs(&vm_memory.memory(), vcpu).map_err(Error::SregsConfiguration)?; } } - interrupts::set_lint(fd).map_err(|e| Error::LocalIntConfiguration(e.into()))?; + interrupts::set_lint(vcpu).map_err(|e| Error::LocalIntConfiguration(e.into()))?; Ok(()) }