qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Harsh Prateek Bora <harshpb@linux.ibm.com>
To: "Cédric Le Goater" <clg@redhat.com>, qemu-devel@nongnu.org
Cc: Alex Williamson <alex.williamson@redhat.com>,
	Shivaprasad G Bhat <sbhat@linux.ibm.com>
Subject: Re: [PATCH v3 7/7] vfio: Remove superfluous error report in vfio_listener_region_add()
Date: Thu, 6 Feb 2025 20:37:14 +0530	[thread overview]
Message-ID: <861e43f2-aac5-457d-bb11-bb6fe1f44dec@linux.ibm.com> (raw)
In-Reply-To: <20250206131438.1505542-8-clg@redhat.com>



On 2/6/25 18:44, Cédric Le Goater wrote:
> 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 4fca4c6166f761acceb7b57b52e379603ea53876..abbdc56b6dbb5eed22e7a2d2d55ee5695279661e 100644
> --- a/hw/vfio/common.c
> +++ b/hw/vfio/common.c
> @@ -594,8 +594,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);
> @@ -680,6 +681,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 =
> @@ -694,11 +696,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: ");

Not sure if this specific error msg was intended for a specific case, 
but since both ifs check for same condition before returning with error, 
looks logically same.

Shiva, any concerns here from vfio perspective?

Otherwise,
Reviewed-by: Harsh Prateek Bora <harshpb@linux.ibm.com>

> -        return;
> -    }
> -
>       if (!bcontainer->initialized) {
>           /*
>            * 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);
>   
> +    /* PPC64/pseries machine only */
>       vfio_container_del_section_window(bcontainer, section);
>   }
>   


  reply	other threads:[~2025-02-06 15:07 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-06 13:14 [PATCH v3 0/7] vfio: Improve error reporting when MMIO region mapping fails Cédric Le Goater
2025-02-06 13:14 ` [PATCH v3 1/7] util/error: Introduce warn_report_err_once() Cédric Le Goater
2025-02-10 16:26   ` Cédric Le Goater
2025-02-11  6:53     ` Markus Armbruster
2025-02-06 13:14 ` [PATCH v3 2/7] vfio/pci: Replace "iommu_device" by "vIOMMU" Cédric Le Goater
2025-02-06 13:14 ` [PATCH v3 3/7] vfio: Rephrase comment in vfio_listener_region_add() error path Cédric Le Goater
2025-02-06 13:14 ` [PATCH v3 4/7] vfio: Introduce vfio_get_vfio_device() Cédric Le Goater
2025-02-06 13:14 ` [PATCH v3 5/7] vfio: Improve error reporting when MMIO region mapping fails Cédric Le Goater
2025-02-06 13:14 ` [PATCH v3 6/7] vfio: Remove reports of DMA mapping errors in backends Cédric Le Goater
2025-02-06 13:14 ` [PATCH v3 7/7] vfio: Remove superfluous error report in vfio_listener_region_add() Cédric Le Goater
2025-02-06 15:07   ` Harsh Prateek Bora [this message]
2025-02-10 16:01 ` [PATCH v3 0/7] vfio: Improve error reporting when MMIO region mapping fails Alex Williamson
2025-02-11 13:32 ` Cédric Le Goater

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=861e43f2-aac5-457d-bb11-bb6fe1f44dec@linux.ibm.com \
    --to=harshpb@linux.ibm.com \
    --cc=alex.williamson@redhat.com \
    --cc=clg@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=sbhat@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).