[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 07/21] spapr_pci: Allow VFIO devices to work on the n
From: |
David Gibson |
Subject: |
[Qemu-devel] [PULL 07/21] spapr_pci: Allow VFIO devices to work on the normal PCI host bridge |
Date: |
Fri, 23 Oct 2015 20:43:19 +1100 |
The core VFIO infrastructure more or less allows VFIO devices to work
on any normal guest PCI host bridge (PHB) without extra logic.
However, the "spapr-pci-host-bridge" device (as opposed to the special
"spapr-pci-vfio-host-bridge" device) breaks this by using a partially
KVM accelerated implementation of the guest kernel IOMMU which won't
work with VFIO devices, without additional kernel support.
This patch allows VFIO devices to work on the spapr-pci-host-bridge,
by having it switch off KVM TCE acceleration when a VFIO device is
added to the PHB (either on startup, or by hotplug).
Signed-off-by: David Gibson <address@hidden>
Reviewed-by: Thomas Huth <address@hidden>
Reviewed-by: Laurent Vivier <address@hidden>
---
hw/ppc/spapr_pci.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c
index cb7c351..55fa8db 100644
--- a/hw/ppc/spapr_pci.c
+++ b/hw/ppc/spapr_pci.c
@@ -1083,6 +1083,12 @@ static void spapr_phb_add_pci_device(sPAPRDRConnector
*drc,
void *fdt = NULL;
int fdt_start_offset = 0, fdt_size;
+ if (object_dynamic_cast(OBJECT(pdev), "vfio-pci")) {
+ sPAPRTCETable *tcet = spapr_tce_find_by_liobn(phb->dma_liobn);
+
+ spapr_tce_set_need_vfio(tcet, true);
+ }
+
if (dev->hotplugged) {
fdt = create_device_tree(&fdt_size);
fdt_start_offset = spapr_create_pci_child_dt(phb, pdev, fdt, 0);
--
2.4.3
- [Qemu-devel] [PULL 00/21] ppc-next-20151023 queue 20151023, David Gibson, 2015/10/23
- [Qemu-devel] [PULL 00/21] ppc-next-20151023 queue 20151023, David Gibson, 2015/10/23
- [Qemu-devel] [PULL 03/21] spapr: Add "slb-size" property to CPU device tree nodes, David Gibson, 2015/10/23
- [Qemu-devel] [PULL 13/21] escc: add to input category, David Gibson, 2015/10/23
- [Qemu-devel] [PULL 12/21] cmd646: add to storage category, David Gibson, 2015/10/23
- [Qemu-devel] [PULL 11/21] adb: add to input category, David Gibson, 2015/10/23
- [Qemu-devel] [PULL 14/21] grackle: add to bridge category, David Gibson, 2015/10/23
- [Qemu-devel] [PULL 08/21] hw/scsi/spapr_vscsi: Remove superfluous memset, David Gibson, 2015/10/23
- [Qemu-devel] [PULL 04/21] spapr_pci: Allow PCI host bridge DMA window to be configured, David Gibson, 2015/10/23
- [Qemu-devel] [PULL 07/21] spapr_pci: Allow VFIO devices to work on the normal PCI host bridge,
David Gibson <=
- [Qemu-devel] [PULL 01/21] spapr: Allocate HTAB from machine init, David Gibson, 2015/10/23
- [Qemu-devel] [PULL 02/21] spapr: Abort when HTAB of requested size isn't allocated, David Gibson, 2015/10/23
- [Qemu-devel] [PULL 06/21] spapr_iommu: Provide a function to switch a TCE table to allowing VFIO, David Gibson, 2015/10/23
- [Qemu-devel] [PULL 16/21] macio-ide: add to storage category, David Gibson, 2015/10/23
- [Qemu-devel] [PULL 19/21] macio-nvram: add to misc category, David Gibson, 2015/10/23
- [Qemu-devel] [PULL 18/21] macio: add to bridge category, David Gibson, 2015/10/23
- [Qemu-devel] [PULL 15/21] cuda: add to bridge category, David Gibson, 2015/10/23
- [Qemu-devel] [PULL 17/21] uninorth: add to bridge category, David Gibson, 2015/10/23
- [Qemu-devel] [PULL 10/21] ppc/spapr: Add "ibm, pa-features" property to the device-tree, David Gibson, 2015/10/23
- [Qemu-devel] [PULL 20/21] openpic: add to misc category, David Gibson, 2015/10/23