Skip to main content

VgicCore

Struct VgicCore 

Source
pub struct VgicCore { /* private fields */ }
Expand description

The single canonical virtual interrupt-controller state owner for one VM.

Implementations§

Source§

impl VgicCore

Source

pub fn new( config: ArmVgicConfig, backend: Arc<dyn GicV3Backend>, ) -> VgicResult<Self>

Creates a VGIC without a guest-memory ITS capability.

Source

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.

Source

pub const fn config(&self) -> &ArmVgicConfig

Returns the immutable configuration used for construction and firmware.

Source

pub const fn id(&self) -> InterruptControllerId

Returns the VM-local controller identifier.

Source

pub const fn controller(&self) -> &VgicController

Returns the underlying canonical controller for architecture frontends.

Source

pub fn read_v2_distributor( &self, vcpu: GicVcpuId, offset: u64, width: AccessWidth, ) -> VgicResult<u64>

Reads the configured GICv2 Distributor frontend.

Source

pub fn write_v2_distributor( &self, vcpu: GicVcpuId, offset: u64, width: AccessWidth, value: u64, ) -> VgicResult

Writes the configured GICv2 Distributor frontend.

Source

pub fn read_v2_cpu_interface( &self, vcpu: GicVcpuId, offset: u64, width: AccessWidth, ) -> VgicResult<u64>

Reads the configured GICv2 CPU-interface frontend.

Source

pub fn write_v2_cpu_interface( &self, vcpu: GicVcpuId, offset: u64, width: AccessWidth, value: u64, ) -> VgicResult

Writes the configured GICv2 CPU-interface frontend.

Source

pub fn attach_vcpu( &self, vcpu: usize, wake: Arc<dyn GicV3VcpuWake>, ) -> VgicResult<GicV3VcpuBinding>

Attaches one configured vCPU.

Source

pub fn bind_assigned_spis(&self) -> VgicResult

Installs every physical SPI fixed by the immutable configuration.

Source

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.

Source

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.

Source

pub fn forward_physical_spi(&self, host_irq: HostIrqId) -> VgicResult

Forwards one acknowledged identity-backed host SPI.

Source

pub fn inject( &self, vcpu: usize, intid: u32, trigger: InterruptTrigger, ) -> VgicResult

Injects one private or shared interrupt through canonical state.

Trait Implementations§

Source§

impl Debug for VgicCore

Source§

fn fmt(&self, formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl MessageInterruptController for VgicCore

Source§

fn id(&self) -> InterruptControllerId

Returns the controller identifier used by the VM device registry.
Source§

fn msi_endpoint( &self, its: ItsId, device: MsiDeviceId, event: MsiEventId, lpi: EndpointLpiId, ) -> IrqResult<MsiEndpoint>

Opens one planned message endpoint.
Source§

impl VirtualInterruptController for VgicCore

Source§

fn id(&self) -> InterruptControllerId

Returns the controller identifier used by the VM device registry.
Source§

fn wired_input( &self, input: ControllerInputId, trigger: InterruptTrigger, ) -> IrqResult<WiredIrqInput>

Opens one controller input using the planned trigger semantics. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.