vm-device, pci, devices: Remove InterruptSourceGroup::{un}mask

The calls to these functions are always preceded by a call to
InterruptSourceGroup::update(). By adding a masked boolean to that
function call it possible to remove 50% of the calls to the
KVM_SET_GSI_ROUTING ioctl as the the update will correctly handle the
masked or unmasked case.

This causes the ioctl to disappear from the perf report for a boot of
the VM.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
Rob Bradford
2022-04-11 16:21:20 +01:00
parent 6a099257e8
commit ed87e42e6f
10 changed files with 52 additions and 105 deletions

View File

@@ -178,19 +178,11 @@ pub trait InterruptSourceGroup: Send + Sync {
/// # Arguments
/// * index: sub-index into the group.
/// * config: configuration data for the interrupt source.
fn update(&self, index: InterruptIndex, config: InterruptSourceConfig) -> Result<()>;
/// Mask an interrupt from this interrupt source.
fn mask(&self, _index: InterruptIndex) -> Result<()> {
// Not all interrupt sources can be disabled.
// To accommodate this, we can have a no-op here.
Ok(())
}
/// Unmask an interrupt from this interrupt source.
fn unmask(&self, _index: InterruptIndex) -> Result<()> {
// Not all interrupt sources can be disabled.
// To accommodate this, we can have a no-op here.
Ok(())
}
/// * masked: if the interrupt is masked
fn update(
&self,
index: InterruptIndex,
config: InterruptSourceConfig,
masked: bool,
) -> Result<()>;
}