All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Wang guang <wang.guang55@zte.com.cn>, mst@redhat.com
Cc: ZhiPeng Lu <lu.zhipeng@zte.com.cn>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] vhost: skip RAM device memory sections
Date: Sat, 8 Apr 2017 01:10:54 +0800	[thread overview]
Message-ID: <62d3af82-73cf-25b0-b476-d2391090629e@redhat.com> (raw)
In-Reply-To: <1491614183-4580-2-git-send-email-wang.guang55@zte.com.cn>



On 08/04/2017 09:16, Wang guang wrote:
> From: ZhiPeng Lu <lu.zhipeng@zte.com.cn>
> 
> A RAM device represents a mapping to a physical device, such as to a PCI
> * MMIO BAR of an vfio-pci assigned device.
> Vhost listens to this region,and increases the region's reference count
> while passthrough?for?network adapters (Physical Function, PF or Virtual Function, VF).
> After detaching   network adapters with  vhost backend dirver or vhost user dirver,
> it unregister vhost listen function  by memory_listener_unregister.
> After detaching the passthrough pf  or vf,
> the RAM device region's reference by  vhost listener increated can not be released,
> due to vhost listen function does not exist.So let's just skip RAM device memory.
> 
> Signed-off-by: ZhiPeng Lu <lu.zhipeng@zte.com.cn>
> ---
>  hw/virtio/vhost.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c
> index 613494d..c1ff98f 100644
> --- a/hw/virtio/vhost.c
> +++ b/hw/virtio/vhost.c
> @@ -611,7 +611,8 @@ static void vhost_set_memory(MemoryListener *listener,
>  static bool vhost_section(MemoryRegionSection *section)
>  {
>      return memory_region_is_ram(section->mr) &&
> -        !memory_region_is_rom(section->mr);
> +        !memory_region_is_rom(section->mr) &&
> +        !memory_region_is_skip_dump(section->mr);
>  }

Why not memory_region_is_ram_device?

Paolo

  reply	other threads:[~2017-04-07 17:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-08  1:16 [Qemu-devel] [PATCH] Set QIO_CHANNEL_FEATURE_SHUTDOWN in colo_process_incoming_thread Wang guang
2017-04-07  9:30 ` Daniel P. Berrange
2017-04-08  1:16 ` [Qemu-devel] [PATCH] vhost: skip RAM device memory sections Wang guang
2017-04-07 17:10   ` Paolo Bonzini [this message]
2017-04-08  1:24 ZhiPeng Lu
2017-04-07 15:48 ` Michael S. Tsirkin

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=62d3af82-73cf-25b0-b476-d2391090629e@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=lu.zhipeng@zte.com.cn \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=wang.guang55@zte.com.cn \
    /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.