vfio: Remove superfluous error report in vfio_listener_region_add()
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> Reviewed-by: Harsh Prateek Bora <harshpb@linux.ibm.com> Reviewed-by: Alex Williamson <alex.williamson@redhat.com> Link: https://lore.kernel.org/qemu-devel/20250206131438.1505542-8-clg@redhat.com Signed-off-by: Cédric Le Goater <clg@redhat.com>
This commit is contained in:
parent
889695f8f3
commit
be7d8579eb
@ -594,8 +594,9 @@ static void vfio_listener_region_add(MemoryListener *listener,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* PPC64/pseries machine only */
|
||||||
if (!vfio_container_add_section_window(bcontainer, section, &err)) {
|
if (!vfio_container_add_section_window(bcontainer, section, &err)) {
|
||||||
goto fail;
|
goto mmio_dma_error;
|
||||||
}
|
}
|
||||||
|
|
||||||
memory_region_ref(section->mr);
|
memory_region_ref(section->mr);
|
||||||
@ -680,6 +681,7 @@ static void vfio_listener_region_add(MemoryListener *listener,
|
|||||||
"0x%"HWADDR_PRIx", %p) = %d (%s)",
|
"0x%"HWADDR_PRIx", %p) = %d (%s)",
|
||||||
bcontainer, iova, int128_get64(llsize), vaddr, ret,
|
bcontainer, iova, int128_get64(llsize), vaddr, ret,
|
||||||
strerror(-ret));
|
strerror(-ret));
|
||||||
|
mmio_dma_error:
|
||||||
if (memory_region_is_ram_device(section->mr)) {
|
if (memory_region_is_ram_device(section->mr)) {
|
||||||
/* Allow unexpected mappings not to be fatal for RAM devices */
|
/* Allow unexpected mappings not to be fatal for RAM devices */
|
||||||
VFIODevice *vbasedev =
|
VFIODevice *vbasedev =
|
||||||
@ -694,11 +696,6 @@ static void vfio_listener_region_add(MemoryListener *listener,
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
fail:
|
fail:
|
||||||
if (memory_region_is_ram_device(section->mr)) {
|
|
||||||
error_reportf_err(err, "PCI p2p may not work: ");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!bcontainer->initialized) {
|
if (!bcontainer->initialized) {
|
||||||
/*
|
/*
|
||||||
* At machine init time or when the device is attached to the
|
* At machine init time or when the device is attached to the
|
||||||
@ -806,6 +803,7 @@ static void vfio_listener_region_del(MemoryListener *listener,
|
|||||||
|
|
||||||
memory_region_unref(section->mr);
|
memory_region_unref(section->mr);
|
||||||
|
|
||||||
|
/* PPC64/pseries machine only */
|
||||||
vfio_container_del_section_window(bcontainer, section);
|
vfio_container_del_section_window(bcontainer, section);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user