linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "K. Y. Srinivasan" <kys@microsoft.com>
To: gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org,
	devel@linuxdriverproject.org, olaf@aepfle.de, apw@canonical.com,
	vkuznets@redhat.com, jasowang@redhat.com
Cc: "K. Y. Srinivasan" <kys@microsoft.com>
Subject: [PATCH 0/5] Drivers: hv: Miscellaneous fixes
Date: Tue, 15 Sep 2015 17:37:03 -0700	[thread overview]
Message-ID: <1442363823-22428-1-git-send-email-kys@microsoft.com> (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.


Dexuan Cui (1):
  Drivers: hv: vmbus: fix init_vp_index() for reloading hv_netvsc

Olaf Hering (4):
  hv: add helpers to handle hv_util device state
  hv: fcopy: use wrappers to propagate state
  hv: kvp: use wrappers to propaigate state
  hv: vss: use wrappers to propagate state

 drivers/hv/channel_mgmt.c |   17 +++++++++++++++++
 drivers/hv/hv_fcopy.c     |   36 ++++++++++++++++++++----------------
 drivers/hv/hv_kvp.c       |   39 +++++++++++++++++++++------------------
 drivers/hv/hv_snapshot.c  |   37 ++++++++++++++++++++-----------------
 drivers/hv/hyperv_vmbus.h |   14 ++++++++++++++
 5 files changed, 92 insertions(+), 51 deletions(-)

-- 
1.7.4.1


             reply	other threads:[~2015-09-15 23:09 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-16  0:37 K. Y. Srinivasan [this message]
2015-09-16  0:37 ` [PATCH 1/5] Drivers: hv: vmbus: fix init_vp_index() for reloading hv_netvsc K. Y. Srinivasan
2015-09-16  0:37   ` [PATCH 2/5] hv: add helpers to handle hv_util device state K. Y. Srinivasan
2015-09-21  5:25     ` Greg KH
2015-09-21 10:26       ` Olaf Hering
2015-09-21 11:25         ` Vitaly Kuznetsov
2015-09-21 12:17           ` Olaf Hering
2015-09-21 13:37             ` Vitaly Kuznetsov
2015-09-21 16:45             ` KY Srinivasan
2015-09-21 16:34         ` KY Srinivasan
2015-09-21 16:43           ` Greg KH
2015-09-21 17:00             ` KY Srinivasan
2015-09-16  0:37   ` [PATCH 3/5] hv: fcopy: use wrappers to propagate state K. Y. Srinivasan
2015-09-16  0:37   ` [PATCH 4/5] hv: kvp: use wrappers to propaigate state K. Y. Srinivasan
2015-09-21  5:26     ` Greg KH
2015-09-21 10:18       ` Olaf Hering
2015-09-21 16:31         ` KY Srinivasan
2015-09-21 16:16       ` KY Srinivasan
2015-09-16  0:37   ` [PATCH 5/5] hv: vss: use wrappers to propagate state K. Y. Srinivasan
2017-08-06 20:12 [PATCH 0/5] Drivers: hv: Miscellaneous fixes kys
2017-09-10  5:53 kys
2018-10-17  3:12 kys

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=1442363823-22428-1-git-send-email-kys@microsoft.com \
    --to=kys@microsoft.com \
    --cc=apw@canonical.com \
    --cc=devel@linuxdriverproject.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jasowang@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=olaf@aepfle.de \
    --cc=vkuznets@redhat.com \
    /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;
as well as URLs for NNTP newsgroup(s).