* Re: [Qemu-devel] [PATCH] vhost: skip RAM device memory sections
2017-04-08 1:24 [Qemu-devel] [PATCH] vhost: skip RAM device memory sections ZhiPeng Lu
@ 2017-04-07 15:48 ` Michael S. Tsirkin
0 siblings, 0 replies; 4+ messages in thread
From: Michael S. Tsirkin @ 2017-04-07 15:48 UTC (permalink / raw)
To: ZhiPeng Lu; +Cc: wang.guang55, qemu-devel
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 <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);
> }
>
> static void vhost_begin(MemoryListener *listener)
> --
> 1.8.3.1
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Qemu-devel] [PATCH] vhost: skip RAM device memory sections
@ 2017-04-08 1:24 ZhiPeng Lu
2017-04-07 15:48 ` Michael S. Tsirkin
0 siblings, 1 reply; 4+ messages in thread
From: ZhiPeng Lu @ 2017-04-08 1:24 UTC (permalink / raw)
To: mst; +Cc: wang.guang55, qemu-devel, ZhiPeng Lu
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);
}
static void vhost_begin(MemoryListener *listener)
--
1.8.3.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [Qemu-devel] [PATCH] vhost: skip RAM device memory sections
2017-04-08 1:16 [Qemu-devel] [PATCH] Set QIO_CHANNEL_FEATURE_SHUTDOWN in colo_process_incoming_thread Wang guang
@ 2017-04-08 1:16 ` Wang guang
2017-04-07 17:10 ` Paolo Bonzini
0 siblings, 1 reply; 4+ messages in thread
From: Wang guang @ 2017-04-08 1:16 UTC (permalink / raw)
To: mst; +Cc: qemu-devel, ZhiPeng Lu
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);
}
static void vhost_begin(MemoryListener *listener)
--
1.8.3.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] vhost: skip RAM device memory sections
2017-04-08 1:16 ` [Qemu-devel] [PATCH] vhost: skip RAM device memory sections Wang guang
@ 2017-04-07 17:10 ` Paolo Bonzini
0 siblings, 0 replies; 4+ messages in thread
From: Paolo Bonzini @ 2017-04-07 17:10 UTC (permalink / raw)
To: Wang guang, mst; +Cc: ZhiPeng Lu, qemu-devel
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
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-04-07 17:11 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-08 1:24 [Qemu-devel] [PATCH] vhost: skip RAM device memory sections ZhiPeng Lu
2017-04-07 15:48 ` Michael S. Tsirkin
-- strict thread matches above, loose matches on Subject: below --
2017-04-08 1:16 [Qemu-devel] [PATCH] Set QIO_CHANNEL_FEATURE_SHUTDOWN in colo_process_incoming_thread Wang guang
2017-04-08 1:16 ` [Qemu-devel] [PATCH] vhost: skip RAM device memory sections Wang guang
2017-04-07 17:10 ` Paolo Bonzini
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.