[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] vhost: skip RAM device memory sections
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH] vhost: skip RAM device memory sections |
Date: |
Sat, 8 Apr 2017 01:10:54 +0800 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 |
On 08/04/2017 09:16, Wang guang wrote:
> From: ZhiPeng Lu <address@hidden>
>
> 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 <address@hidden>
> ---
> 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