qemu-patch-raspberry4/hw/ppc
Alexey Kardashevskiy 9fc34ada7e spapr_pci_vfio: Add spapr-pci-vfio-host-bridge to support vfio
The patch adds a spapr-pci-vfio-host-bridge device type
which is a PCI Host Bridge with VFIO support. The new device
inherits from the spapr-pci-host-bridge device and adds an "iommu"
property which is an IOMMU id. This ID represents a minimal entity
for which IOMMU isolation can be guaranteed. In SPAPR architecture IOMMU
group is called a Partitionable Endpoint (PE).

Current implementation supports one IOMMU id per QEMU VFIO PHB. Since
SPAPR allows multiple PHB for no extra cost, this does not seem to
be a problem. This limitation may change in the future though.

Example of use:
Configure and Add 3 functions of a multifunctional device to QEMU:
(the NEC PCI USB card is used as an example here):
-device spapr-pci-vfio-host-bridge,id=USB,iommu=4,index=7 \
-device vfio-pci,host=4:0:1.0,addr=1.0,bus=USB,multifunction=true
-device vfio-pci,host=4:0:1.1,addr=1.1,bus=USB
-device vfio-pci,host=4:0:1.2,addr=1.2,bus=USB

where:
* index=7 is a QEMU PHB index (used as source for MMIO/MSI/IO windows
offset);
* iommu=4 is an IOMMU id which can be found in sysfs:
[aik@vpl2 ~]$ cd /sys/bus/pci/devices/0004:00:00.0/
[aik@vpl2 0004:00:00.0]$ ls -l iommu_group
lrwxrwxrwx 1 root root 0 Jun  5 12:49 iommu_group -> ../../../kernel/iommu_groups/4

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Alexander Graf <agraf@suse.de>
2014-06-27 13:48:23 +02:00
..
e500-ccsr.h ppc: do not use ../ in include files 2013-03-01 13:57:33 +01:00
e500.c PPC: e500: Move to u-boot as firmware 2014-06-16 13:24:35 +02:00
e500.h machine: Conversion of QEMUMachineInitArgs to MachineState 2014-05-28 17:35:01 +02:00
e500plat.c machine: Conversion of QEMUMachineInitArgs to MachineState 2014-05-28 17:35:01 +02:00
mac.h hw/ppc/mac.h: remove unused BIOS_FILENAME definition 2013-12-02 21:18:18 +04:00
mac_newworld.c mac99: Added FW_CFG_PPC_BUSFREQ to match CLOCKFREQ and TBFREQ already there 2014-06-16 13:24:28 +02:00
mac_oldworld.c mac99: Added FW_CFG_PPC_BUSFREQ to match CLOCKFREQ and TBFREQ already there 2014-06-16 13:24:28 +02:00
Makefile.objs spapr_pci_vfio: Add spapr-pci-vfio-host-bridge to support vfio 2014-06-27 13:48:23 +02:00
mpc8544_guts.c cpu: Replace cpu_single_env with CPUState current_cpu 2013-07-09 21:20:28 +02:00
mpc8544ds.c machine: Conversion of QEMUMachineInitArgs to MachineState 2014-05-28 17:35:01 +02:00
ppc.c spapr: Add support for time base offset migration 2014-06-16 13:24:35 +02:00
ppc4xx_devs.c hw/ppc: Avoid shifting left into sign bit 2014-03-27 19:22:49 +04:00
ppc4xx_pci.c savevm: Remove all the unneeded version_minimum_id_old (ppc) 2014-06-16 04:55:26 +02:00
ppc405.h hw: move private headers to hw/ subdirectories. 2013-04-08 18:13:16 +02:00
ppc405_boards.c machine: Conversion of QEMUMachineInitArgs to MachineState 2014-05-28 17:35:01 +02:00
ppc405_uc.c target-ppc: Clean up ENV_GET_CPU() usage 2014-03-13 19:01:48 +01:00
ppc440_bamboo.c machine: Conversion of QEMUMachineInitArgs to MachineState 2014-05-28 17:35:01 +02:00
ppc_booke.c hw/ppc: Avoid shifting left into sign bit 2014-03-27 19:22:49 +04:00
ppce500_spin.c ppce500_spin: Initialize struct properly 2014-04-08 11:20:05 +02:00
prep.c machine: Conversion of QEMUMachineInitArgs to MachineState 2014-05-28 17:35:01 +02:00
spapr.c spapr: Add "qemu, boot-menu" property to /chosen 2014-06-27 13:48:22 +02:00
spapr_events.c spapr: Fix RTAS token numbers 2014-06-27 13:48:22 +02:00
spapr_hcall.c spapr_hcall: Add address-translation-mode-on-interrupt resource in H_SET_MODE 2014-06-16 13:24:45 +02:00
spapr_iommu.c spapr_iommu: Make in-kernel TCE table optional 2014-06-27 13:48:23 +02:00
spapr_pci.c spapr_iommu: Make in-kernel TCE table optional 2014-06-27 13:48:23 +02:00
spapr_pci_vfio.c spapr_pci_vfio: Add spapr-pci-vfio-host-bridge to support vfio 2014-06-27 13:48:23 +02:00
spapr_rtas.c spapr: Fix RTAS token numbers 2014-06-27 13:48:22 +02:00
spapr_vio.c spapr_iommu: Make in-kernel TCE table optional 2014-06-27 13:48:23 +02:00
virtex_ml507.c machine: Conversion of QEMUMachineInitArgs to MachineState 2014-05-28 17:35:01 +02:00