[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL v2 45/61] virtio-iommu: Remove probe_done
From: |
Michael S. Tsirkin |
Subject: |
[PULL v2 45/61] virtio-iommu: Remove probe_done |
Date: |
Tue, 23 Jul 2024 06:59:57 -0400 |
From: Eric Auger <eric.auger@redhat.com>
Now we have switched to PCIIOMMUOps to convey host IOMMU information,
the host reserved regions are transmitted when the PCIe topology is
built. This happens way before the virtio-iommu driver calls the probe
request. So let's remove the probe_done flag that allowed to check
the probe was not done before the IOMMU MR got enabled. Besides this
probe_done flag had a flaw wrt migration since it was not saved/restored.
The only case at risk is if 2 devices were plugged to a
PCIe to PCI bridge and thus aliased. First of all we
discovered in the past this case was not properly supported for
neither SMMU nor virtio-iommu on guest kernel side: see
[RFC] virtio-iommu: Take into account possible aliasing in virtio_iommu_mr()
https://lore.kernel.org/all/20230116124709.793084-1-eric.auger@redhat.com/
If this were supported by the guest kernel, it is unclear what the call
sequence would be from a virtio-iommu driver point of view.
Signed-off-by: Eric Auger <eric.auger@redhat.com>
Message-Id: <20240716094619.1713905-3-eric.auger@redhat.com>
Tested-by: Cédric Le Goater <clg@redhat.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
include/hw/virtio/virtio-iommu.h | 1 -
hw/virtio/virtio-iommu.c | 3 ---
2 files changed, 4 deletions(-)
diff --git a/include/hw/virtio/virtio-iommu.h b/include/hw/virtio/virtio-iommu.h
index bdb3da72d0..7db4210b16 100644
--- a/include/hw/virtio/virtio-iommu.h
+++ b/include/hw/virtio/virtio-iommu.h
@@ -43,7 +43,6 @@ typedef struct IOMMUDevice {
MemoryRegion bypass_mr; /* The alias of shared memory MR */
GList *resv_regions;
GList *host_resv_ranges;
- bool probe_done;
} IOMMUDevice;
typedef struct IOMMUPciBus {
diff --git a/hw/virtio/virtio-iommu.c b/hw/virtio/virtio-iommu.c
index 4e34dacd6e..2c54c0d976 100644
--- a/hw/virtio/virtio-iommu.c
+++ b/hw/virtio/virtio-iommu.c
@@ -555,8 +555,6 @@ static int virtio_iommu_set_host_iova_ranges(VirtIOIOMMU
*s, PCIBus *bus,
current_ranges = sdev->host_resv_ranges;
- g_assert(!sdev->probe_done);
-
/* check that each new resv region is included in an existing one */
if (sdev->host_resv_ranges) {
range_inverse_array(iova_ranges,
@@ -956,7 +954,6 @@ static int virtio_iommu_probe(VirtIOIOMMU *s,
}
buf += count;
free -= count;
- sdev->probe_done = true;
return VIRTIO_IOMMU_S_OK;
}
--
MST
- Re: [PULL v2 34/61] virtio-net: Implement SR-IOV VF, (continued)
- [PULL v2 35/61] docs: Document composable SR-IOV device, Michael S. Tsirkin, 2024/07/23
- [PULL v2 36/61] smbios: make memory device size configurable per Machine, Michael S. Tsirkin, 2024/07/23
- [PULL v2 37/61] accel/kvm: Extract common KVM vCPU {creation,parking} code, Michael S. Tsirkin, 2024/07/23
- [PULL v2 38/61] hw/acpi: Move CPU ctrl-dev MMIO region len macro to common header file, Michael S. Tsirkin, 2024/07/23
- [PULL v2 39/61] hw/acpi: Update ACPI GED framework to support vCPU Hotplug, Michael S. Tsirkin, 2024/07/23
- [PULL v2 40/61] hw/acpi: Update GED _EVT method AML with CPU scan, Michael S. Tsirkin, 2024/07/23
- [PULL v2 41/61] hw/acpi: Update CPUs AML with cpu-(ctrl)dev change, Michael S. Tsirkin, 2024/07/23
- [PULL v2 42/61] physmem: Add helper function to destroy CPU AddressSpace, Michael S. Tsirkin, 2024/07/23
- [PULL v2 43/61] gdbstub: Add helper function to unregister GDB register space, Michael S. Tsirkin, 2024/07/23
- [PULL v2 45/61] virtio-iommu: Remove probe_done,
Michael S. Tsirkin <=
- [PULL v2 44/61] Revert "virtio-iommu: Clear IOMMUDevice when VFIO device is unplugged", Michael S. Tsirkin, 2024/07/23
- [PULL v2 46/61] virtio-iommu: Free [host_]resv_ranges on unset_iommu_devices, Michael S. Tsirkin, 2024/07/23
- [PULL v2 50/61] hw/riscv/virt-acpi-build.c: Add namespace devices for PLIC and APLIC, Michael S. Tsirkin, 2024/07/23
- [PULL v2 47/61] virtio-iommu: Remove the end point on detach, Michael S. Tsirkin, 2024/07/23
- [PULL v2 48/61] hw/vfio/common: Add vfio_listener_region_del_iommu trace event, Michael S. Tsirkin, 2024/07/23
- [PULL v2 49/61] virtio-iommu: Add trace point on virtio_iommu_detach_endpoint_from_domain, Michael S. Tsirkin, 2024/07/23
- [PULL v2 51/61] hw/riscv/virt-acpi-build.c: Update the HID of RISC-V UART, Michael S. Tsirkin, 2024/07/23
- [PULL v2 53/61] acpi/gpex: Create PCI link devices outside PCI root bridge, Michael S. Tsirkin, 2024/07/23
- [PULL v2 52/61] tests/acpi: Allow DSDT acpi table changes for aarch64, Michael S. Tsirkin, 2024/07/23
- [PULL v2 54/61] tests/acpi: update expected DSDT blob for aarch64 and microvm, Michael S. Tsirkin, 2024/07/23