From 0856ebbd42e982aac04882597f5cbf452a165070 Mon Sep 17 00:00:00 2001 From: Wei Liu Date: Wed, 20 Jul 2022 15:21:43 +0000 Subject: [PATCH] hypervisor: aarch64: drop set_its_device The field can be set directly. This eliminates one place where dyn Device is used outside of KVM aarch64 code. Signed-off-by: Wei Liu --- hypervisor/src/arch/aarch64/gic.rs | 5 +---- hypervisor/src/kvm/aarch64/gic/mod.rs | 6 +----- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/hypervisor/src/arch/aarch64/gic.rs b/hypervisor/src/arch/aarch64/gic.rs index 0e21988ab..d1ce535b1 100644 --- a/hypervisor/src/arch/aarch64/gic.rs +++ b/hypervisor/src/arch/aarch64/gic.rs @@ -1,9 +1,8 @@ // Copyright 2022 Arm Limited (or its affiliates). All rights reserved. -use crate::{CpuState, Device, GicState, HypervisorDeviceError, HypervisorVmError}; +use crate::{CpuState, GicState, HypervisorDeviceError, HypervisorVmError}; use std::any::Any; use std::result; -use std::sync::Arc; /// Errors thrown while setting up the VGIC. #[derive(Debug)] @@ -40,8 +39,6 @@ pub trait Vgic: Send + Sync { /// Returns the MSI reg property of the device fn msi_properties(&self) -> [u64; 2]; - fn set_its_device(&mut self, its_device: Option>); - /// Get the values of GICR_TYPER for each vCPU. fn set_gicr_typers(&mut self, vcpu_states: &[CpuState]); diff --git a/hypervisor/src/kvm/aarch64/gic/mod.rs b/hypervisor/src/kvm/aarch64/gic/mod.rs index 74cbc015b..51857ac75 100644 --- a/hypervisor/src/kvm/aarch64/gic/mod.rs +++ b/hypervisor/src/kvm/aarch64/gic/mod.rs @@ -187,7 +187,7 @@ impl KvmGicV3Its { 0, )?; - self.set_its_device(Some(its_fd)); + self.its_device = Some(its_fd); /* We need to tell the kernel how many irqs to support with this vgic. * See the `layout` module for details. @@ -315,10 +315,6 @@ impl Vgic for KvmGicV3Its { [self.msi_addr, self.msi_size] } - fn set_its_device(&mut self, its_device: Option>) { - self.its_device = its_device; - } - fn set_gicr_typers(&mut self, vcpu_states: &[CpuState]) { let gicr_typers = construct_gicr_typers(vcpu_states); self.gicr_typers = gicr_typers;