pub struct NvmeFaultController { /* private fields */ }Expand description
An NVMe controller.
Implementations§
Source§impl NvmeFaultController
impl NvmeFaultController
Sourcepub fn new(
driver_source: &VmTaskDriverSource,
guest_memory: GuestMemory,
msi_target: &MsiTarget,
register_mmio: &mut dyn RegisterMmioIntercept,
caps: NvmeFaultControllerCaps,
fault_configuration: FaultConfiguration,
tdisp_interface: Option<Box<dyn TdispHostDeviceTarget>>,
) -> Self
pub fn new( driver_source: &VmTaskDriverSource, guest_memory: GuestMemory, msi_target: &MsiTarget, register_mmio: &mut dyn RegisterMmioIntercept, caps: NvmeFaultControllerCaps, fault_configuration: FaultConfiguration, tdisp_interface: Option<Box<dyn TdispHostDeviceTarget>>, ) -> Self
Creates a new NVMe controller.
Sourcepub fn client(&self) -> NvmeFaultControllerClient
pub fn client(&self) -> NvmeFaultControllerClient
Returns a client for manipulating the NVMe controller at runtime.
Sourcepub fn read_bar0(&mut self, addr: u16, data: &mut [u8]) -> IoResult
pub fn read_bar0(&mut self, addr: u16, data: &mut [u8]) -> IoResult
Reads from the virtual BAR 0.
Sourcepub fn write_bar0(&mut self, addr: u16, data: &[u8]) -> IoResult
pub fn write_bar0(&mut self, addr: u16, data: &[u8]) -> IoResult
Writes to the virtual BAR 0.
Sourcepub fn fatal_error(&mut self)
pub fn fatal_error(&mut self)
Sets the CFS bit in the controller status register (CSTS), indicating that the controller has experienced “undefined” behavior.
Trait Implementations§
Source§impl ChangeDeviceState for NvmeFaultController
impl ChangeDeviceState for NvmeFaultController
Source§impl ChipsetDevice for NvmeFaultController
impl ChipsetDevice for NvmeFaultController
Source§fn supports_tdisp(&mut self) -> Option<&mut dyn TdispHostDeviceTarget>
fn supports_tdisp(&mut self) -> Option<&mut dyn TdispHostDeviceTarget>
The NVMe fault controller is repurposed for use in TDISP tests.
Source§fn supports_mmio(&mut self) -> Option<&mut dyn MmioIntercept>
fn supports_mmio(&mut self) -> Option<&mut dyn MmioIntercept>
Optionally returns a trait object to send MMIO port intercepts to.
Source§fn supports_pci(&mut self) -> Option<&mut dyn PciConfigSpace>
fn supports_pci(&mut self) -> Option<&mut dyn PciConfigSpace>
Optionally returns a trait object to send PCI config space accesses to.
§fn supports_pio(&mut self) -> Option<&mut (dyn PortIoIntercept + 'static)>
fn supports_pio(&mut self) -> Option<&mut (dyn PortIoIntercept + 'static)>
Optionally returns a trait object to send IO port intercepts to.
§fn supports_poll_device(&mut self) -> Option<&mut dyn PollDevice>
fn supports_poll_device(&mut self) -> Option<&mut dyn PollDevice>
Optionally returns a trait object to send poll requests to.
§fn supports_line_interrupt_target(
&mut self,
) -> Option<&mut dyn LineInterruptTarget>
fn supports_line_interrupt_target( &mut self, ) -> Option<&mut dyn LineInterruptTarget>
Optionally returns a trait object to send interrupt line changes to.
§fn supports_handle_eoi(&mut self) -> Option<&mut dyn HandleEoi>
fn supports_handle_eoi(&mut self) -> Option<&mut dyn HandleEoi>
Optionally returns a trait object to send EOI requests to.
§fn supports_acknowledge_pic_interrupt(
&mut self,
) -> Option<&mut dyn AcknowledgePicInterrupt>
fn supports_acknowledge_pic_interrupt( &mut self, ) -> Option<&mut dyn AcknowledgePicInterrupt>
Optionally returns a trait object with which to acknowledge PIC
interrupts.
Source§impl InspectMut for NvmeFaultController
impl InspectMut for NvmeFaultController
Source§fn inspect_mut(&mut self, req: Request<'_>)
fn inspect_mut(&mut self, req: Request<'_>)
Inspects the object.
Source§impl MmioIntercept for NvmeFaultController
impl MmioIntercept for NvmeFaultController
Source§fn mmio_read(&mut self, addr: u64, data: &mut [u8]) -> IoResult
fn mmio_read(&mut self, addr: u64, data: &mut [u8]) -> IoResult
Dispatch an MMIO read to the device with the given address.
Source§fn mmio_write(&mut self, addr: u64, data: &[u8]) -> IoResult
fn mmio_write(&mut self, addr: u64, data: &[u8]) -> IoResult
Dispatch an MMIO write to the device with the given address.
§fn get_static_regions(&mut self) -> &[(&str, RangeInclusive<u64>)]
fn get_static_regions(&mut self) -> &[(&str, RangeInclusive<u64>)]
Report a set of static static mmio regions (region_name, gpa_range) that
cannot be remapped at runtime and are always registered. Read more
Source§impl PciConfigSpace for NvmeFaultController
impl PciConfigSpace for NvmeFaultController
Source§fn pci_cfg_read(&mut self, offset: u16, value: &mut u32) -> IoResult
fn pci_cfg_read(&mut self, offset: u16, value: &mut u32) -> IoResult
Dispatch a PCI config space read to the device with the given address.
Source§fn pci_cfg_write(&mut self, offset: u16, value: u32) -> IoResult
fn pci_cfg_write(&mut self, offset: u16, value: u32) -> IoResult
Dispatch a PCI config space write to the device with the given address.
§fn pci_cfg_read_forward(
&mut self,
_bus: u8,
_device_function: u8,
_offset: u16,
_value: &mut u32,
) -> Option<IoResult>
fn pci_cfg_read_forward( &mut self, _bus: u8, _device_function: u8, _offset: u16, _value: &mut u32, ) -> Option<IoResult>
Forward a PCI configuration space read to a downstream device. Read more
Source§impl SaveRestore for NvmeFaultController
impl SaveRestore for NvmeFaultController
Auto Trait Implementations§
impl Freeze for NvmeFaultController
impl !RefUnwindSafe for NvmeFaultController
impl Send for NvmeFaultController
impl Sync for NvmeFaultController
impl Unpin for NvmeFaultController
impl !UnwindSafe for NvmeFaultController
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> PciChipsetDeviceExt for Twhere
T: ChipsetDevice + PciConfigSpace + ?Sized,
impl<T> PciChipsetDeviceExt for Twhere
T: ChipsetDevice + PciConfigSpace + ?Sized,
§fn probe_bar_masks(&mut self) -> [u32; 6]
fn probe_bar_masks(&mut self) -> [u32; 6]
Probe the PCI device’s BAR registers to retrieve the BAR masks.
§fn probe_hardware_ids(&mut self) -> HardwareIds
fn probe_hardware_ids(&mut self) -> HardwareIds
Probe the PCI device’s configuration space registers to obtain the
device’s hardware ID values.