mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
pci: Improve MSI-X code to let VFIO rely on it
This commit enhances the current msi-x code hosted in the pci crate in order to be reused by the vfio crate. Specifically, it creates several useful methods for the MsixCap structure that can simplify the caller's code. Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
@@ -354,6 +354,7 @@ impl VirtioPciDevice {
|
||||
settings_bar,
|
||||
self.msix_num,
|
||||
MSIX_TABLE_BAR_OFFSET as u32,
|
||||
settings_bar,
|
||||
MSIX_PBA_BAR_OFFSET as u32,
|
||||
);
|
||||
self.configuration
|
||||
@@ -401,7 +402,7 @@ impl PciDevice for VirtioPciDevice {
|
||||
// device should not inject the interrupt.
|
||||
// Instead, the Pending Bit Array table is updated to reflect there
|
||||
// is a pending interrupt for this specific vector.
|
||||
if config.is_masked() || entry.is_masked() {
|
||||
if config.masked() || entry.masked() {
|
||||
config.set_pba_bit(queue.vector, false);
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user