mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2025-01-21 20:15:21 +00:00
vm-virtio: Stop delivering interrupt while NO_VECTOR
According to virtio spec, for used buffer notifications, if MSI-X capability is enabled, and queue msix vector is VIRTIO_MSI_NO_VECTOR 0xffff, the device must not deliver an interrupt for that virtqueue. Signed-off-by: Cathy Zhang <cathy.zhang@intel.com>
This commit is contained in:
parent
1324aa451f
commit
3485e89080
@ -128,6 +128,7 @@ impl fmt::Display for VirtioDeviceType {
|
||||
const INTERRUPT_STATUS_USED_RING: u32 = 0x1;
|
||||
#[allow(dead_code)]
|
||||
const INTERRUPT_STATUS_CONFIG_CHANGED: u32 = 0x2;
|
||||
const VIRTIO_MSI_NO_VECTOR: u16 = 0xffff;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub enum ActivateError {
|
||||
|
@ -37,6 +37,7 @@ use crate::{
|
||||
Queue, VirtioDevice, VirtioDeviceType, VirtioInterrupt, VirtioInterruptType,
|
||||
VirtioIommuRemapping, DEVICE_ACKNOWLEDGE, DEVICE_DRIVER, DEVICE_DRIVER_OK, DEVICE_FAILED,
|
||||
DEVICE_FEATURES_OK, DEVICE_INIT, INTERRUPT_STATUS_CONFIG_CHANGED, INTERRUPT_STATUS_USED_RING,
|
||||
VIRTIO_MSI_NO_VECTOR,
|
||||
};
|
||||
|
||||
#[allow(clippy::enum_variant_names)]
|
||||
@ -510,6 +511,10 @@ impl PciDevice for VirtioPciDevice {
|
||||
}
|
||||
};
|
||||
|
||||
if vector == VIRTIO_MSI_NO_VECTOR {
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
let config = &mut msix_config_clone.lock().unwrap();
|
||||
let entry = &config.table_entries[vector as usize];
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user