mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/4] hv: utils: propagate state to interrupt thread
@ 2015-09-07 14:26 Olaf Hering
  2015-09-07 14:27 ` [PATCH 1/4] hv: add helpers to handle hv_util device state Olaf Hering
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Olaf Hering @ 2015-09-07 14:26 UTC (permalink / raw)
  To: kys, gregkh, haiyangz; +Cc: linux-kernel, devel, Olaf Hering

The Copy-VMFile cmdlet on the host may fail because the guest fcopy
driver state machine gets out of sync. This happens because the ->state
and ->context variables are accessed by the main thread and from
interrupt context. If an interrupt happens between fcopy_respond_to_host
and hv_poll_channel in fcopy_write, then hv_fcopy_onchannelcallback
called from that interrupt sees still state HVUTIL_USERSPACE_RECV. It
updates the context, but fcopy_write will not notice that update and
hv_poll_channel gets called with an empty context.  As a result
hv_fcopy_daemon gets no more data. After a timeout Copy-VMFile fails
with timeout.

In my initial testing for a fix I put a "mb()" after the last .state
change in fcopy_write. But this series implementes read/write memory
barriers as needed. Let me know if this is overdoing things.

Olaf

Olaf Hering (4):
  hv: add helpers to handle hv_util device state
  hv: fcopy: use wrapper to propate state
  hv: kvp: use wrapper to propate state
  hv: vss: use wrapper to propate state

 drivers/hv/hv_fcopy.c     | 36 ++++++++++++++++++++----------------
 drivers/hv/hv_kvp.c       | 38 +++++++++++++++++++++-----------------
 drivers/hv/hv_snapshot.c  | 37 ++++++++++++++++++++-----------------
 drivers/hv/hyperv_vmbus.h | 12 ++++++++++++
 4 files changed, 73 insertions(+), 50 deletions(-)


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

end of thread, other threads:[~2015-09-07 14:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-07 14:26 [PATCH 0/4] hv: utils: propagate state to interrupt thread Olaf Hering
2015-09-07 14:27 ` [PATCH 1/4] hv: add helpers to handle hv_util device state Olaf Hering
2015-09-07 14:27 ` [PATCH 2/4] hv: fcopy: use wrapper to propate state Olaf Hering
2015-09-07 14:27 ` [PATCH 3/4] hv: kvp: " Olaf Hering
2015-09-07 14:27 ` [PATCH 4/4] hv: vss: " Olaf Hering

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®