From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752271AbbIOXJO (ORCPT ); Tue, 15 Sep 2015 19:09:14 -0400 Received: from p3plsmtps2ded04.prod.phx3.secureserver.net ([208.109.80.198]:50131 "EHLO p3plsmtps2ded04.prod.phx3.secureserver.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751415AbbIOXJN (ORCPT ); Tue, 15 Sep 2015 19:09:13 -0400 x-originating-ip: 72.167.245.219 From: "K. Y. Srinivasan" 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" Subject: [PATCH 0/5] Drivers: hv: Miscellaneous fixes Date: Tue, 15 Sep 2015 17:37:03 -0700 Message-Id: <1442363823-22428-1-git-send-email-kys@microsoft.com> X-Mailer: git-send-email 1.7.4.1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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