diff --git a/hypervisor/src/cpu.rs b/hypervisor/src/cpu.rs index e9b659ebe..a7491cdb6 100644 --- a/hypervisor/src/cpu.rs +++ b/hypervisor/src/cpu.rs @@ -407,43 +407,43 @@ pub trait Vcpu: Send + Sync { /// /// Sets the type of CPU to be exposed to the guest and optional features. /// - #[cfg(any(target_arch = "arm", target_arch = "aarch64"))] + #[cfg(target_arch = "aarch64")] fn vcpu_init(&self, kvi: &VcpuInit) -> Result<()>; /// /// Sets the value of one register for this vCPU. /// - #[cfg(any(target_arch = "arm", target_arch = "aarch64"))] + #[cfg(target_arch = "aarch64")] fn set_reg(&self, reg_id: u64, data: u64) -> Result<()>; /// /// Sets the value of one register for this vCPU. /// - #[cfg(any(target_arch = "arm", target_arch = "aarch64"))] + #[cfg(target_arch = "aarch64")] fn get_reg(&self, reg_id: u64) -> Result; /// /// Gets a list of the guest registers that are supported for the /// KVM_GET_ONE_REG/KVM_SET_ONE_REG calls. /// - #[cfg(any(target_arch = "arm", target_arch = "aarch64"))] + #[cfg(target_arch = "aarch64")] fn get_reg_list(&self, reg_list: &mut RegList) -> Result<()>; /// /// Save the state of the system registers. /// - #[cfg(any(target_arch = "arm", target_arch = "aarch64"))] + #[cfg(target_arch = "aarch64")] fn get_sys_regs(&self) -> Result>; /// /// Restore the state of the system registers. /// - #[cfg(any(target_arch = "arm", target_arch = "aarch64"))] + #[cfg(target_arch = "aarch64")] fn set_sys_regs(&self, state: &[Register]) -> Result<()>; /// /// Read the MPIDR - Multiprocessor Affinity Register. /// - #[cfg(any(target_arch = "arm", target_arch = "aarch64"))] + #[cfg(target_arch = "aarch64")] fn read_mpidr(&self) -> Result; /// /// Configure core registers for a given CPU. /// - #[cfg(any(target_arch = "arm", target_arch = "aarch64"))] + #[cfg(target_arch = "aarch64")] fn setup_regs(&self, cpu_id: u8, boot_ip: u64, fdt_start: u64) -> Result<()>; /// /// Retrieve the vCPU state. diff --git a/hypervisor/src/kvm/mod.rs b/hypervisor/src/kvm/mod.rs index 1458651e7..5f518eedb 100644 --- a/hypervisor/src/kvm/mod.rs +++ b/hypervisor/src/kvm/mod.rs @@ -542,7 +542,7 @@ impl vm::Vm for KvmVm { /// /// Returns the preferred CPU target type which can be emulated by KVM on underlying host. /// - #[cfg(any(target_arch = "arm", target_arch = "aarch64"))] + #[cfg(target_arch = "aarch64")] fn get_preferred_target(&self, kvi: &mut VcpuInit) -> vm::Result<()> { self.fd .get_preferred_target(kvi) @@ -866,7 +866,7 @@ impl hypervisor::Hypervisor for KvmHypervisor { })) } - #[cfg(any(target_arch = "arm", target_arch = "aarch64"))] + #[cfg(target_arch = "aarch64")] { Ok(Arc::new(KvmVm { fd: vm_fd, @@ -1535,7 +1535,7 @@ impl cpu::Vcpu for KvmVcpu { .set_guest_debug(&dbg) .map_err(|e| cpu::HypervisorCpuError::SetDebugRegs(e.into())) } - #[cfg(any(target_arch = "arm", target_arch = "aarch64"))] + #[cfg(target_arch = "aarch64")] fn vcpu_init(&self, kvi: &VcpuInit) -> cpu::Result<()> { self.fd .vcpu_init(kvi) @@ -1544,7 +1544,7 @@ impl cpu::Vcpu for KvmVcpu { /// /// Sets the value of one register for this vCPU. /// - #[cfg(any(target_arch = "arm", target_arch = "aarch64"))] + #[cfg(target_arch = "aarch64")] fn set_reg(&self, reg_id: u64, data: u64) -> cpu::Result<()> { self.fd .set_one_reg(reg_id, data) @@ -1553,7 +1553,7 @@ impl cpu::Vcpu for KvmVcpu { /// /// Gets the value of one register for this vCPU. /// - #[cfg(any(target_arch = "arm", target_arch = "aarch64"))] + #[cfg(target_arch = "aarch64")] fn get_reg(&self, reg_id: u64) -> cpu::Result { self.fd .get_one_reg(reg_id) @@ -1563,7 +1563,7 @@ impl cpu::Vcpu for KvmVcpu { /// Gets a list of the guest registers that are supported for the /// KVM_GET_ONE_REG/KVM_SET_ONE_REG calls. /// - #[cfg(any(target_arch = "arm", target_arch = "aarch64"))] + #[cfg(target_arch = "aarch64")] fn get_reg_list(&self, reg_list: &mut RegList) -> cpu::Result<()> { self.fd .get_reg_list(reg_list) @@ -1572,7 +1572,7 @@ impl cpu::Vcpu for KvmVcpu { /// /// Save the state of the system registers. /// - #[cfg(any(target_arch = "arm", target_arch = "aarch64"))] + #[cfg(target_arch = "aarch64")] fn get_sys_regs(&self) -> cpu::Result> { // Call KVM_GET_REG_LIST to get all registers available to the guest. For ArmV8 there are // around 500 registers. @@ -1607,7 +1607,7 @@ impl cpu::Vcpu for KvmVcpu { /// /// Restore the state of the system registers. /// - #[cfg(any(target_arch = "arm", target_arch = "aarch64"))] + #[cfg(target_arch = "aarch64")] fn set_sys_regs(&self, state: &[Register]) -> cpu::Result<()> { for reg in state { self.fd @@ -1619,7 +1619,7 @@ impl cpu::Vcpu for KvmVcpu { /// /// Read the MPIDR - Multiprocessor Affinity Register. /// - #[cfg(any(target_arch = "arm", target_arch = "aarch64"))] + #[cfg(target_arch = "aarch64")] fn read_mpidr(&self) -> cpu::Result { self.fd .get_one_reg(MPIDR_EL1) @@ -1628,7 +1628,7 @@ impl cpu::Vcpu for KvmVcpu { /// /// Configure core registers for a given CPU. /// - #[cfg(any(target_arch = "arm", target_arch = "aarch64"))] + #[cfg(target_arch = "aarch64")] fn setup_regs(&self, cpu_id: u8, boot_ip: u64, fdt_start: u64) -> cpu::Result<()> { #[allow(non_upper_case_globals)] // PSR (Processor State Register) bits. diff --git a/hypervisor/src/vm.rs b/hypervisor/src/vm.rs index bba759136..2c3a33c6b 100644 --- a/hypervisor/src/vm.rs +++ b/hypervisor/src/vm.rs @@ -320,7 +320,7 @@ pub trait Vm: Send + Sync { /// Creates an emulated device in the kernel. fn create_device(&self, device: &mut CreateDevice) -> Result>; /// Returns the preferred CPU target type which can be emulated by KVM on underlying host. - #[cfg(any(target_arch = "arm", target_arch = "aarch64"))] + #[cfg(target_arch = "aarch64")] fn get_preferred_target(&self, kvi: &mut VcpuInit) -> Result<()>; /// Enable split Irq capability #[cfg(target_arch = "x86_64")]