pub struct VgicCore { /* private fields */ }Expand description
The single canonical virtual interrupt-controller state owner for one VM.
Implementations§
Source§impl VgicCore
impl VgicCore
Sourcepub fn new(
config: ArmVgicConfig,
backend: Arc<dyn GicV3Backend>,
) -> VgicResult<Self>
pub fn new( config: ArmVgicConfig, backend: Arc<dyn GicV3Backend>, ) -> VgicResult<Self>
Creates a VGIC without a guest-memory ITS capability.
Sourcepub fn new_with_guest_memory(
config: ArmVgicConfig,
backend: Arc<dyn GicV3Backend>,
guest_memory: Option<Arc<dyn GuestMemory>>,
) -> VgicResult<Self>
pub fn new_with_guest_memory( config: ArmVgicConfig, backend: Arc<dyn GicV3Backend>, guest_memory: Option<Arc<dyn GuestMemory>>, ) -> VgicResult<Self>
Creates a VGIC with checked guest-memory access for an optional ITS.
Sourcepub const fn config(&self) -> &ArmVgicConfig
pub const fn config(&self) -> &ArmVgicConfig
Returns the immutable configuration used for construction and firmware.
Sourcepub const fn id(&self) -> InterruptControllerId
pub const fn id(&self) -> InterruptControllerId
Returns the VM-local controller identifier.
Sourcepub const fn controller(&self) -> &VgicController
pub const fn controller(&self) -> &VgicController
Returns the underlying canonical controller for architecture frontends.
Sourcepub fn read_v2_distributor(
&self,
vcpu: GicVcpuId,
offset: u64,
width: AccessWidth,
) -> VgicResult<u64>
pub fn read_v2_distributor( &self, vcpu: GicVcpuId, offset: u64, width: AccessWidth, ) -> VgicResult<u64>
Reads the configured GICv2 Distributor frontend.
Sourcepub fn write_v2_distributor(
&self,
vcpu: GicVcpuId,
offset: u64,
width: AccessWidth,
value: u64,
) -> VgicResult
pub fn write_v2_distributor( &self, vcpu: GicVcpuId, offset: u64, width: AccessWidth, value: u64, ) -> VgicResult
Writes the configured GICv2 Distributor frontend.
Sourcepub fn read_v2_cpu_interface(
&self,
vcpu: GicVcpuId,
offset: u64,
width: AccessWidth,
) -> VgicResult<u64>
pub fn read_v2_cpu_interface( &self, vcpu: GicVcpuId, offset: u64, width: AccessWidth, ) -> VgicResult<u64>
Reads the configured GICv2 CPU-interface frontend.
Sourcepub fn write_v2_cpu_interface(
&self,
vcpu: GicVcpuId,
offset: u64,
width: AccessWidth,
value: u64,
) -> VgicResult
pub fn write_v2_cpu_interface( &self, vcpu: GicVcpuId, offset: u64, width: AccessWidth, value: u64, ) -> VgicResult
Writes the configured GICv2 CPU-interface frontend.
Sourcepub fn attach_vcpu(
&self,
vcpu: usize,
wake: Arc<dyn GicV3VcpuWake>,
) -> VgicResult<GicV3VcpuBinding>
pub fn attach_vcpu( &self, vcpu: usize, wake: Arc<dyn GicV3VcpuWake>, ) -> VgicResult<GicV3VcpuBinding>
Attaches one configured vCPU.
Sourcepub fn bind_assigned_spis(&self) -> VgicResult
pub fn bind_assigned_spis(&self) -> VgicResult
Installs every physical SPI fixed by the immutable configuration.
Sourcepub fn unbind_assigned_spis(&self) -> VgicResult
pub fn unbind_assigned_spis(&self) -> VgicResult
Releases every quiescent physical SPI fixed by the configuration.
The method attempts every binding so one backend failure does not leak unrelated host resources. The first failure is returned after the remaining releases have been attempted.
Sourcepub fn teardown_assigned_spis(&self) -> VgicResult
pub fn teardown_assigned_spis(&self) -> VgicResult
Retires and releases every assigned SPI while tearing down a stopped VM.
All bindings are attempted so one backend failure does not retain unrelated host resources. Failed bindings keep their controller claim and may be retried without deactivating an already retired delivery.
Sourcepub fn forward_physical_spi(&self, host_irq: HostIrqId) -> VgicResult
pub fn forward_physical_spi(&self, host_irq: HostIrqId) -> VgicResult
Forwards one acknowledged identity-backed host SPI.
Sourcepub fn inject(
&self,
vcpu: usize,
intid: u32,
trigger: InterruptTrigger,
) -> VgicResult
pub fn inject( &self, vcpu: usize, intid: u32, trigger: InterruptTrigger, ) -> VgicResult
Injects one private or shared interrupt through canonical state.