acrn-hypervisor/hypervisor/include
Binbin Wu 6be27cdcab hv: vmsi: add vmsix on msi emulation support
Some passthrough devices require multiple MSI vectors, but don't
support MSI-X. In meanwhile, Linux kernel doesn't support continuous
vector allocation.
On native platform, this issue can be mitigated by IOMMU via interrupt
remapping. However, on ACRN, there is no vIOMMU.
vMSI-X on MSI emulation is one solution to mitigate this problem on ACRN.

This patch adds MSI-X emulation on MSI capability.
For the device needs to do MSI-X emulation, HV will hide MSI capability
and present MSI-X capability to guest.

The guest driver may need to modify to reqeust MSI-X vector.
For example:
        ret = pci_alloc_irq_vectors(pdev, 1, STMMAC_MSI_VEC_MAX,
-                                   PCI_IRQ_MSI);
+                                   PCI_IRQ_MSI | PCI_IRQ_MSIX);

To enable MSI-X emulation, the device should:
- 1. The device should be in vmsix_on_msi_devs array.
- 2. Support MSI, but don't support MSI-X.
- 3. MSI capability should support per-vector mask.
- 4. The device should have an unused BAR.
- 5. The device driver should not rely on PBA for functionality.

Tracked-On: #4831
Signed-off-by: Binbin Wu <binbin.wu@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2020-06-16 08:52:56 +08:00
..
arch/x86 hv: vtd: add an API to reserve continuous irtes 2020-06-16 08:52:56 +08:00
common hv: ptirq: associate an irte with ptirq_remapping_info entry 2020-06-16 08:52:56 +08:00
debug HV: correct ept page array usage 2020-03-12 14:56:34 +08:00
dm hv: vmsi: add vmsix on msi emulation support 2020-06-16 08:52:56 +08:00
hw hv: vmsi: add vmsix on msi emulation support 2020-06-16 08:52:56 +08:00
lib HV: enable multiboot module string as kernel bootargs 2020-06-08 13:30:04 +08:00
public hv: dynamically configure CPU affinity through hypercall 2020-04-23 09:38:54 +08:00