qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] 答复: 转发: Re: [PATCH] vhost: skip RAM device memory sections


From: lu.zhipeng
Subject: [Qemu-devel] 答复: 转发: Re: [PATCH] vhost: skip RAM device memory sections
Date: Mon, 10 Apr 2017 10:53:22 +0800 (CST)

i have been tested many times,i confirm ram device region  references is not be 
dropped,when detaching vhost net.


So far ,i do not  have  better idea to drop the references.  the ram device 
momery is special .


i think vhost listening the RAM devicemomery is not necessary. skip RAM device 
memory sections



















芦志朋 luzhipeng






IT开发工程师 IT Development
Engineer
操作系统产品部/中心研究院/系统产品 OS Product Dept./Central R&D Institute/System Product









四川省成都市天府大道中段800号
E: address@hidden 
www.zte.com.cn






原始邮件



发件人:王广10165992
收件人:芦志朋10108272
抄送人:杨斌10080747
日 期 :2017年04月10日 09:05
主 题 :转发: Re: [Qemu-devel] [PATCH] vhost: skip RAM device memory sections


























发件人: address@hidden
收件人:芦志朋10108272
抄送人: address@hidden
日 期 :2017年04月07日 23:52
主 题 :Re: [Qemu-devel] [PATCH] vhost: skip RAM device memory sections





On Sat, Apr 08, 2017 at 09:24:10AM +0800, ZhiPeng Lu wrote:
> 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.

Shouldn't that drop all references? That might be a cleaner fix.

> 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)
>  }
>  
>  static void vhost_begin(MemoryListener *listener)
> -- 
> 1.8.3.1
>

JPEG image

JPEG image


reply via email to

[Prev in Thread] Current Thread [Next in Thread]