qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [RFC 0/2] memory/vfio: notify region_del() when unregister listeners
@ 2018-01-19  8:42 Peter Xu
  2018-01-19  8:42 ` [Qemu-devel] [RFC 1/2] memory: do explicit cleanup when remove listeners Peter Xu
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Peter Xu @ 2018-01-19  8:42 UTC (permalink / raw)
  To: qemu-devel
  Cc: David Gibson, Paolo Bonzini, Alexey Kardashevskiy, peterx,
	Alex Williamson

I encountered an event loss problem during unplugging vfio devices:

  https://bugzilla.redhat.com/show_bug.cgi?id=1531393

I thought it should be a simple VT-d issue but I was wrong.  The whole
debugging leads me to these patches.

Basically I think what we missed is that when unregistering memory
listeners, we don't really call region_del() at all.  Instead we just
remove ourselves from the listener list.  IMHO that's not enough.  A
clean unregister should undo all possible changes that have done
during region_add().  That's patch 1.

Patch 2 fixes a vfio issue when patch 1 is applied.

I'm marking this change as RFC since it touches the core of memory
somehow, on which I am not 100% sure about.  E.g., I haven't tested
all the listener users, so I'm not sure whether it may broke any use
case.

But what I'm sure is that it passes the docker tests on
compiling/qtests, and it fixes the event loss that reported.

Let's see whether I can get some feedback first.  Please review.

Thanks.

Peter Xu (2):
  memory: do explicit cleanup when remove listeners
  vfio: listener unregister before unset container

 hw/vfio/common.c | 16 ++++++++++++----
 memory.c         | 24 ++++++++++++++++++++++++
 2 files changed, 36 insertions(+), 4 deletions(-)

-- 
2.14.3

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

end of thread, other threads:[~2018-01-22  5:41 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-19  8:42 [Qemu-devel] [RFC 0/2] memory/vfio: notify region_del() when unregister listeners Peter Xu
2018-01-19  8:42 ` [Qemu-devel] [RFC 1/2] memory: do explicit cleanup when remove listeners Peter Xu
2018-01-19 10:21   ` Paolo Bonzini
2018-01-19  8:42 ` [Qemu-devel] [RFC 2/2] vfio: listener unregister before unset container Peter Xu
2018-01-19 11:41 ` [Qemu-devel] [RFC 0/2] memory/vfio: notify region_del() when unregister listeners Paolo Bonzini
2018-01-22  5:41   ` Peter Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).