From: Olaf Hering <olaf@aepfle.de>
To: kys@microsoft.com, gregkh@linuxfoundation.org, haiyangz@microsoft.com
Cc: linux-kernel@vger.kernel.org, devel@linuxdriverproject.org,
Olaf Hering <olaf@aepfle.de>
Subject: [PATCH 0/4] hv: utils: propagate state to interrupt thread
Date: Mon, 7 Sep 2015 14:26:59 +0000 [thread overview]
Message-ID: <1441636023-3704-1-git-send-email-olaf@aepfle.de> (raw)
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(-)
next reply other threads:[~2015-09-07 14:27 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-07 14:26 Olaf Hering [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1441636023-3704-1-git-send-email-olaf@aepfle.de \
--to=olaf@aepfle.de \
--cc=devel@linuxdriverproject.org \
--cc=gregkh@linuxfoundation.org \
--cc=haiyangz@microsoft.com \
--cc=kys@microsoft.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®