qemu/hw/arm
Peter Xu 958ec334bc vhost: Unbreak SMMU and virtio-iommu on dev-iotlb support
Previous work on dev-iotlb message broke vhost on either SMMU or virtio-iommu
since dev-iotlb (or PCIe ATS) is not yet supported for those archs.

An initial idea is that we can let IOMMU to export this information to vhost so
that vhost would know whether the vIOMMU would support dev-iotlb, then vhost
can conditionally register to dev-iotlb or the old iotlb way.  We can work
based on some previous patch to introduce PCIIOMMUOps as Yi Liu proposed [1].

However it's not as easy as I thought since vhost_iommu_region_add() does not
have a PCIDevice context at all since it's completely a backend.  It seems
non-trivial to pass over a PCI device to the backend during init.  E.g. when
the IOMMU notifier registered hdev->vdev is still NULL.

To make the fix smaller and easier, this patch goes the other way to leverage
the flag_changed() hook of vIOMMUs so that SMMU and virtio-iommu can trap the
dev-iotlb registration and fail it.  Then vhost could try the fallback solution
as using UNMAP invalidation for it's translations.

[1] https://lore.kernel.org/qemu-devel/1599735398-6829-4-git-send-email-yi.l.liu@intel.com/

Reported-by: Eric Auger <eric.auger@redhat.com>
Fixes: b68ba1ca57
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Tested-by: Eric Auger <eric.auger@redhat.com>
Signed-off-by: Peter Xu <peterx@redhat.com>
Message-Id: <20210204191228.187550-1-peterx@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2021-02-05 08:52:58 -05:00
..
allwinner-a10.c
allwinner-h3.c
armsse.c arm: Remove frq properties on CMSDK timer, dualtimer, watchdog, ARMSSE 2021-01-29 15:54:44 +00:00
armv7m.c hw/arm/armv7m: Correct typo in QOM object name 2020-12-10 11:44:56 +00:00
aspeed_ast2600.c ast2600: SRAM is 89KB 2020-12-10 12:11:03 +01:00
aspeed_soc.c hw/arm/aspeed: Map the UART5 device unconditionally 2020-09-18 09:04:36 +02:00
aspeed.c arm: do not use ram_size global 2020-12-10 12:15:07 -05:00
bcm2835_peripherals.c hw/arm/bcm2835_peripherals: connect the UART clock 2020-10-27 11:10:44 +00:00
bcm2836.c hw/arm/bcm2836: Introduce the BCM2835 SoC 2020-10-27 11:10:44 +00:00
boot.c vl: make qemu_get_machine_opts static 2020-12-15 12:51:55 -05:00
collie.c Use OBJECT_DECLARE_SIMPLE_TYPE when possible 2020-09-18 14:12:32 -04:00
cubieboard.c arm: remove bios_name 2020-12-10 12:15:04 -05:00
digic_boards.c hw/arm: Display CPU type in machine description 2021-02-03 10:15:51 +00:00
digic.c
exynos4_boards.c
exynos4210.c qom: simplify object_find_property / object_class_find_property 2020-09-22 16:45:16 -04:00
fsl-imx6.c
fsl-imx6ul.c
fsl-imx7.c
fsl-imx25.c
fsl-imx31.c
gumstix.c
highbank.c hw/arm/highbank: Drop dead KVM support code 2021-01-08 15:13:38 +00:00
imx25_pdk.c
integratorcp.c qom: simplify object_find_property / object_class_find_property 2020-09-22 16:45:16 -04:00
Kconfig hw/arm/xlnx-versal: Versal SoC requires ZynqMP peripherals 2021-02-03 10:15:50 +00:00
kzm.c
mainstone.c
mcimx6ul-evk.c
mcimx7d-sabre.c
meson.build
microbit.c hw/arm: Display CPU type in machine description 2021-02-03 10:15:51 +00:00
mps2-tz.c arm: Don't set freq properties on CMSDK timer, dualtimer, watchdog, ARMSSE 2021-01-29 15:54:44 +00:00
mps2.c arm: Don't set freq properties on CMSDK timer, dualtimer, watchdog, ARMSSE 2021-01-29 15:54:44 +00:00
msf2-soc.c
msf2-som.c
musca.c arm: Don't set freq properties on CMSDK timer, dualtimer, watchdog, ARMSSE 2021-01-29 15:54:44 +00:00
musicpal.c musicpal: Use ptimer_free() in the finalize function to avoid memleaks 2021-01-08 15:13:38 +00:00
netduino2.c hw/arm: Display CPU type in machine description 2021-02-03 10:15:51 +00:00
netduinoplus2.c hw/arm: Display CPU type in machine description 2021-02-03 10:15:51 +00:00
npcm7xx_boards.c hw/*: Use type casting for SysBusDevice in NPCM7XX 2021-01-12 21:19:02 +00:00
npcm7xx.c hw/misc: Add a PWM module for NPCM7XX 2021-01-12 21:19:02 +00:00
nrf51_soc.c
nseries.c hw/arm/nseries: Check return value from load_image_targphys() 2020-11-10 11:03:48 +00:00
omap1.c
omap2.c
omap_sx1.c
orangepi.c hw/arm: Display CPU type in machine description 2021-02-03 10:15:51 +00:00
palm.c Use OBJECT_DECLARE_SIMPLE_TYPE when possible 2020-09-18 14:12:32 -04:00
pxa2xx_gpio.c Use OBJECT_DECLARE_SIMPLE_TYPE when possible 2020-09-18 14:12:32 -04:00
pxa2xx_pic.c Use OBJECT_DECLARE_SIMPLE_TYPE when possible 2020-09-18 14:12:32 -04:00
pxa2xx.c qdev: Move softmmu properties to qdev-properties-system.h 2020-12-18 15:20:17 -05:00
raspi.c hw/arm/raspi: Add the Raspberry Pi 3 model A+ 2020-10-27 11:10:44 +00:00
realview.c qom: simplify object_find_property / object_class_find_property 2020-09-22 16:45:16 -04:00
sabrelite.c hw/arm: sabrelite: Connect the Ethernet PHY at address 6 2021-01-08 15:13:39 +00:00
sbsa-ref.c vl: extract softmmu/datadir.c 2020-12-10 12:15:18 -05:00
smmu-common.c memory: Add IOMMUTLBEvent 2020-12-08 13:48:57 -05:00
smmu-internal.h
smmuv3-internal.h hw/arm/smmuv3: Fix up L1STD_SPAN decoding 2020-12-10 11:30:44 +00:00
smmuv3.c vhost: Unbreak SMMU and virtio-iommu on dev-iotlb support 2021-02-05 08:52:58 -05:00
spitz.c hw/ssi: Rename SSI 'slave' as 'peripheral' 2020-12-10 12:15:03 -05:00
stellaris.c hw/arm: Display CPU type in machine description 2021-02-03 10:15:51 +00:00
stm32f205_soc.c hw/misc/stm32f2xx_syscfg: Remove extraneous IRQ 2020-11-10 11:03:48 +00:00
stm32f405_soc.c
strongarm.c qdev: Move softmmu properties to qdev-properties-system.h 2020-12-18 15:20:17 -05:00
strongarm.h
sysbus-fdt.c
tosa.c hw/ssi: Rename SSI 'slave' as 'peripheral' 2020-12-10 12:15:03 -05:00
trace-events arm/trace: Fix hex printing 2020-10-27 11:10:44 +00:00
trace.h
versatilepb.c qom: simplify object_find_property / object_class_find_property 2020-09-22 16:45:16 -04:00
vexpress.c vexpress-a15: Register "virtualization" as class property 2020-12-14 14:25:44 -05:00
virt-acpi-build.c hw/arm/virt: Remove virt machine state 'smp_cpus' 2021-01-08 15:13:38 +00:00
virt.c arm-virt: add secure pl061 for reset/power down 2021-01-29 10:47:28 +00:00
xilinx_zynq.c qom: simplify object_find_property / object_class_find_property 2020-09-22 16:45:16 -04:00
xlnx-versal-virt.c arm: xlnx-versal: Connect usb to virt-versal 2020-12-15 12:04:30 +00:00
xlnx-versal.c arm: xlnx-versal: Connect usb to virt-versal 2020-12-15 12:04:30 +00:00
xlnx-zcu102.c arm: rename xlnx-zcu102.canbusN properties 2021-01-29 10:47:28 +00:00
xlnx-zynqmp.c xlnx-zynqmp: Connect Xilinx ZynqMP CAN controllers 2020-12-10 11:30:44 +00:00
z2.c hw/ssi: Rename SSI 'slave' as 'peripheral' 2020-12-10 12:15:03 -05:00