All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 1/2] Vring: vring's listener's priority should higher than kvm
@ 2013-05-09  0:40 Liu Ping Fan
  2013-05-09  0:40 ` [Qemu-devel] [PATCH 2/2] mem: highlight the listener's priority as enum Liu Ping Fan
                   ` (2 more replies)
  0 siblings, 3 replies; 15+ messages in thread
From: Liu Ping Fan @ 2013-05-09  0:40 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Anthony Liguori, Michael S. Tsirkin, Jan Kiszka,
	Stefan Hajnoczi, Paolo Bonzini

From: Liu Ping Fan <pingfank@linux.vnet.ibm.com>

Hosts threads which handle vring should have high MemoryListener priority
than kvm. For currently code, take the following scenario:
  kvm_region_add() run earlier before vhost_region_add(), then in guest,
vring's desc[i] can refer to addressX in the new region known by guest.
But vhost does not know this new region yet, and the vring handler will
fail.

Signed-off-by: Liu Ping Fan <pingfank@linux.vnet.ibm.com>
---
 hw/virtio/dataplane/hostmem.c |    2 +-
 hw/virtio/vhost.c             |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/hw/virtio/dataplane/hostmem.c b/hw/virtio/dataplane/hostmem.c
index 37292ff..67cbce1 100644
--- a/hw/virtio/dataplane/hostmem.c
+++ b/hw/virtio/dataplane/hostmem.c
@@ -158,7 +158,7 @@ void hostmem_init(HostMem *hostmem)
         .eventfd_del = hostmem_listener_eventfd_dummy,
         .coalesced_mmio_add = hostmem_listener_coalesced_mmio_dummy,
         .coalesced_mmio_del = hostmem_listener_coalesced_mmio_dummy,
-        .priority = 10,
+        .priority = 9,
     };
 
     memory_listener_register(&hostmem->listener, &address_space_memory);
diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c
index fbabf99..91c313b 100644
--- a/hw/virtio/vhost.c
+++ b/hw/virtio/vhost.c
@@ -856,7 +856,7 @@ int vhost_dev_init(struct vhost_dev *hdev, int devfd, const char *devpath,
         .log_global_stop = vhost_log_global_stop,
         .eventfd_add = vhost_eventfd_add,
         .eventfd_del = vhost_eventfd_del,
-        .priority = 10
+        .priority = 9
     };
     hdev->mem = g_malloc0(offsetof(struct vhost_memory, regions));
     hdev->n_mem_sections = 0;
-- 
1.7.4.4

^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2013-05-10  9:05 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-09  0:40 [Qemu-devel] [PATCH 1/2] Vring: vring's listener's priority should higher than kvm Liu Ping Fan
2013-05-09  0:40 ` [Qemu-devel] [PATCH 2/2] mem: highlight the listener's priority as enum Liu Ping Fan
2013-05-09  8:31   ` Stefan Hajnoczi
2013-05-09  9:05     ` liu ping fan
2013-05-09  9:21   ` Peter Maydell
2013-05-09  9:30     ` liu ping fan
2013-05-09  8:30 ` [Qemu-devel] [PATCH 1/2] Vring: vring's listener's priority should higher than kvm Stefan Hajnoczi
2013-05-09  9:00   ` liu ping fan
2013-05-09 15:26     ` Stefan Hajnoczi
2013-05-10  6:03       ` liu ping fan
2013-05-10  7:12         ` Stefan Hajnoczi
2013-05-10  9:04           ` liu ping fan
2013-05-09  8:44 ` Michael S. Tsirkin
2013-05-09  8:54   ` liu ping fan
2013-05-09 14:58     ` 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.