All of lore.kernel.org
 help / color / mirror / Atom feed
From: Si-Wei Liu <si-wei.liu@oracle.com>
To: Jason Wang <jasowang@redhat.com>, mst@redhat.com, qemu-devel@nongnu.org
Cc: elic@nvidia.com, lingshan.zhu@intel.com
Subject: Re: [PATCH V2 1/2] vhost-vdpa: skip ram device from the IOTLB mapping
Date: Thu, 10 Jun 2021 13:54:29 -0700	[thread overview]
Message-ID: <2ebd6de6-c08a-44d9-6df4-e84c95e9b6fe@oracle.com> (raw)
In-Reply-To: <20210602084106.43186-2-jasowang@redhat.com>



On 6/2/2021 1:41 AM, Jason Wang wrote:
> vDPA is not tie to any specific hardware, for safety and simplicity,
> vhost-vDPA doesn't allow MMIO area to be mapped via IOTLB. Only the
> doorbell could be mapped via mmap(). So this patch exclude skip the
> ram device from the IOTLB mapping.
>
> Signed-off-by: Jason Wang <jasowang@redhat.com>
Reviewed-by: Si-Wei Liu <si-wei.liu@oracle.com>
> ---
>   hw/virtio/vhost-vdpa.c | 12 ++----------
>   1 file changed, 2 insertions(+), 10 deletions(-)
>
> diff --git a/hw/virtio/vhost-vdpa.c b/hw/virtio/vhost-vdpa.c
> index 01d2101d09..dd4321bac2 100644
> --- a/hw/virtio/vhost-vdpa.c
> +++ b/hw/virtio/vhost-vdpa.c
> @@ -27,6 +27,8 @@ static bool vhost_vdpa_listener_skipped_section(MemoryRegionSection *section)
>   {
>       return (!memory_region_is_ram(section->mr) &&
>               !memory_region_is_iommu(section->mr)) ||
> +           /* vhost-vDPA doesn't allow MMIO to be mapped  */
> +            memory_region_is_ram_device(section->mr) ||
>              /*
>               * Sizing an enabled 64-bit BAR can cause spurious mappings to
>               * addresses in the upper part of the 64-bit address space.  These
> @@ -171,22 +173,12 @@ static void vhost_vdpa_listener_region_add(MemoryListener *listener,
>                                vaddr, section->readonly);
>       if (ret) {
>           error_report("vhost vdpa map fail!");
> -        if (memory_region_is_ram_device(section->mr)) {
> -            /* Allow unexpected mappings not to be fatal for RAM devices */
> -            error_report("map ram fail!");
> -          return ;
> -        }
>           goto fail;
>       }
>   
>       return;
>   
>   fail:
> -    if (memory_region_is_ram_device(section->mr)) {
> -        error_report("failed to vdpa_dma_map. pci p2p may not work");
> -        return;
> -
> -    }
>       /*
>        * On the initfn path, store the first error in the container so we
>        * can gracefully fail.  Runtime, there's not much we can do other



  reply	other threads:[~2021-06-10 20:56 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-02  8:41 [PATCH V2 0/2] vhost-vDPA: vq notification map support Jason Wang
2021-06-02  8:41 ` [PATCH V2 1/2] vhost-vdpa: skip ram device from the IOTLB mapping Jason Wang
2021-06-10 20:54   ` Si-Wei Liu [this message]
2021-06-02  8:41 ` [PATCH V2 2/2] vhost-vdpa: map virtqueue notification area if possible Jason Wang
2021-06-10 20:53   ` Si-Wei Liu
2021-06-10  2:30 ` [PATCH V2 0/2] vhost-vDPA: vq notification map support Jason Wang
2021-06-14 21:57 ` no-reply

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=2ebd6de6-c08a-44d9-6df4-e84c95e9b6fe@oracle.com \
    --to=si-wei.liu@oracle.com \
    --cc=elic@nvidia.com \
    --cc=jasowang@redhat.com \
    --cc=lingshan.zhu@intel.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.