[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 9/9] vfio: Remove superfluous error report in vfio_listener_re
From: |
Cédric Le Goater |
Subject: |
[PATCH v2 9/9] vfio: Remove superfluous error report in vfio_listener_region_add() |
Date: |
Thu, 30 Jan 2025 14:43:46 +0100 |
For pseries machines, commit 567b5b309abe ("vfio/pci: Relax DMA map
errors for MMIO regions") introduced 2 error reports to notify the
user of MMIO mapping errors. Consolidate both code paths under one.
Cc: Harsh Prateek Bora <harshpb@linux.ibm.com>
Cc: Shivaprasad G Bhat <sbhat@linux.ibm.com>
Signed-off-by: Cédric Le Goater <clg@redhat.com>
---
hw/vfio/common.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/hw/vfio/common.c b/hw/vfio/common.c
index
e5ef93c589b2bed68f790608868ec3c7779d4cb8..f87214d6439ace74e3a8b2e81207d5a266d5238f
100644
--- a/hw/vfio/common.c
+++ b/hw/vfio/common.c
@@ -596,8 +596,9 @@ static void vfio_listener_region_add(MemoryListener
*listener,
return;
}
+ /* PPC64/pseries machine only */
if (!vfio_container_add_section_window(bcontainer, section, &err)) {
- goto fail;
+ goto mmio_dma_error;
}
memory_region_ref(section->mr);
@@ -682,6 +683,7 @@ static void vfio_listener_region_add(MemoryListener
*listener,
"0x%"HWADDR_PRIx", %p) = %d (%s)",
bcontainer, iova, int128_get64(llsize), vaddr, ret,
strerror(-ret));
+ mmio_dma_error:
if (memory_region_is_ram_device(section->mr)) {
/* Allow unexpected mappings not to be fatal for RAM devices */
VFIODevice *vbasedev =
@@ -696,11 +698,6 @@ static void vfio_listener_region_add(MemoryListener
*listener,
return;
fail:
- if (memory_region_is_ram_device(section->mr)) {
- error_reportf_err(err, "PCI p2p may not work: ");
- return;
- }
-
if (!bcontainer->initialized) {
/*
* At machine init time or when the device is attached to the
@@ -808,6 +805,7 @@ static void vfio_listener_region_del(MemoryListener
*listener,
memory_region_unref(section->mr);
+ /* PPC64/pseries machine only */
vfio_container_del_section_window(bcontainer, section);
}
--
2.48.1
- [PATCH v2 0/9]vfio: Improve error reporting when MMIO region mapping fails, Cédric Le Goater, 2025/01/30
- [PATCH v2 1/9] util/error: Introduce warn_report_once_err(), Cédric Le Goater, 2025/01/30
- [PATCH v2 2/9] vfio/pci: Replace "iommu_device" by "vIOMMU", Cédric Le Goater, 2025/01/30
- [PATCH v2 3/9] vfio: Rephrase comment in vfio_listener_region_add() error path, Cédric Le Goater, 2025/01/30
- [PATCH v2 5/9] vfio: Improve error reporting when MMIO region mapping fails, Cédric Le Goater, 2025/01/30
- [PATCH v2 6/9] vfio: Remove reports of DMA mapping errors in backends, Cédric Le Goater, 2025/01/30
- [PATCH v2 4/9] vfio: Introduce vfio_get_vfio_device(), Cédric Le Goater, 2025/01/30
- [PATCH v2 8/9] vfio: Check compatibility of CPU and IOMMU address space width, Cédric Le Goater, 2025/01/30
- [PATCH v2 7/9] cpu: Introduce cpu_get_phys_bits(), Cédric Le Goater, 2025/01/30
- [PATCH v2 9/9] vfio: Remove superfluous error report in vfio_listener_region_add(),
Cédric Le Goater <=