* [PATCH v2] scsi: storvsc: Add the support of hibernation
From: Dexuan Cui @ 2019-09-25 20:11 UTC (permalink / raw)
To: KY Srinivasan, Haiyang Zhang, Stephen Hemminger,
sashal@kernel.org, jejb@linux.ibm.com, martin.petersen@oracle.com,
linux-hyperv@vger.kernel.org, linux-scsi@vger.kernel.org,
linux-kernel@vger.kernel.org, Michael Kelley
Cc: Dexuan Cui
When we're in storvsc_suspend(), we're sure the SCSI layer has quiesced the
scsi device by scsi_bus_suspend() -> ... -> scsi_device_quiesce(), so the
low level SCSI adapter driver only needs to suspend/resume its own state.
Signed-off-by: Dexuan Cui <decui@microsoft.com>
Acked-by: Martin K. Petersen <martin.petersen@oracle.com>
---
This patch is basically a pure Hyper-V specific change and it has a
build dependency on the commit 271b2224d42f ("Drivers: hv: vmbus: Implement
suspend/resume for VSC drivers for hibernation"), which is on Sasha Levin's
Hyper-V tree's hyperv-next branch:
https://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux.git/log/?h=hyperv-next
I request this patch should go through Sasha's tree rather than the
SCSI tree.
In v2:
Added Acked-by from Martin.
@Sasha: I think the patch can go through the hyper-v tree, since
we have the Ack from Martin. :-)
No other change.
drivers/scsi/storvsc_drv.c | 41 +++++++++++++++++++++++++++++++++++++++++
1 file changed, 41 insertions(+)
diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c
index ed8b9ac..9fbf604 100644
--- a/drivers/scsi/storvsc_drv.c
+++ b/drivers/scsi/storvsc_drv.c
@@ -1727,6 +1727,13 @@ enum {
MODULE_DEVICE_TABLE(vmbus, id_table);
+static const struct { guid_t guid; } fc_guid = { HV_SYNTHFC_GUID };
+
+static bool hv_dev_is_fc(struct hv_device *hv_dev)
+{
+ return guid_equal(&fc_guid.guid, &hv_dev->dev_type);
+}
+
static int storvsc_probe(struct hv_device *device,
const struct hv_vmbus_device_id *dev_id)
{
@@ -1935,11 +1942,45 @@ static int storvsc_remove(struct hv_device *dev)
return 0;
}
+static int storvsc_suspend(struct hv_device *hv_dev)
+{
+ struct storvsc_device *stor_device = hv_get_drvdata(hv_dev);
+ struct Scsi_Host *host = stor_device->host;
+ struct hv_host_device *host_dev = shost_priv(host);
+
+ storvsc_wait_to_drain(stor_device);
+
+ drain_workqueue(host_dev->handle_error_wq);
+
+ vmbus_close(hv_dev->channel);
+
+ memset(stor_device->stor_chns, 0,
+ num_possible_cpus() * sizeof(void *));
+
+ kfree(stor_device->stor_chns);
+ stor_device->stor_chns = NULL;
+
+ cpumask_clear(&stor_device->alloced_cpus);
+
+ return 0;
+}
+
+static int storvsc_resume(struct hv_device *hv_dev)
+{
+ int ret;
+
+ ret = storvsc_connect_to_vsp(hv_dev, storvsc_ringbuffer_size,
+ hv_dev_is_fc(hv_dev));
+ return ret;
+}
+
static struct hv_driver storvsc_drv = {
.name = KBUILD_MODNAME,
.id_table = id_table,
.probe = storvsc_probe,
.remove = storvsc_remove,
+ .suspend = storvsc_suspend,
+ .resume = storvsc_resume,
.driver = {
.probe_type = PROBE_PREFER_ASYNCHRONOUS,
},
--
1.8.3.1
^ permalink raw reply related
* [PATCH v2] hv_sock: Add the support of hibernation
From: Dexuan Cui @ 2019-09-25 21:34 UTC (permalink / raw)
To: KY Srinivasan, Haiyang Zhang, Stephen Hemminger,
sashal@kernel.org, davem@davemloft.net,
linux-hyperv@vger.kernel.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, Michael Kelley
Cc: Dexuan Cui
Add the necessary dummy callbacks for hibernation.
Signed-off-by: Dexuan Cui <decui@microsoft.com>
Acked-by: David S. Miller <davem@davemloft.net>
---
In v2:
Added David's Acked-by.
Removed [net-next] from the Subject.
@Sasha, can you please pick this up into the hyper-v tree?
net/vmw_vsock/hyperv_transport.c | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/net/vmw_vsock/hyperv_transport.c b/net/vmw_vsock/hyperv_transport.c
index f2084e3f7aa4..4c02e38aa728 100644
--- a/net/vmw_vsock/hyperv_transport.c
+++ b/net/vmw_vsock/hyperv_transport.c
@@ -930,6 +930,24 @@ static int hvs_remove(struct hv_device *hdev)
return 0;
}
+/* hv_sock connections can not persist across hibernation, and all the hv_sock
+ * channels are forced to be rescinded before hibernation: see
+ * vmbus_bus_suspend(). Here the dummy hvs_suspend() and hvs_resume()
+ * are only needed because hibernation requires that every vmbus device's
+ * driver should have a .suspend and .resume callback: see vmbus_suspend().
+ */
+static int hvs_suspend(struct hv_device *hv_dev)
+{
+ /* Dummy */
+ return 0;
+}
+
+static int hvs_resume(struct hv_device *dev)
+{
+ /* Dummy */
+ return 0;
+}
+
/* This isn't really used. See vmbus_match() and vmbus_probe() */
static const struct hv_vmbus_device_id id_table[] = {
{},
@@ -941,6 +959,8 @@ static struct hv_driver hvs_drv = {
.id_table = id_table,
.probe = hvs_probe,
.remove = hvs_remove,
+ .suspend = hvs_suspend,
+ .resume = hvs_resume,
};
static int __init hvs_init(void)
--
2.19.1
^ permalink raw reply related
* Re: [PATCH v2] scsi: storvsc: Add the support of hibernation
From: kbuild test robot @ 2019-09-25 21:55 UTC (permalink / raw)
To: Dexuan Cui
Cc: kbuild-all, KY Srinivasan, Haiyang Zhang, Stephen Hemminger,
sashal@kernel.org, jejb@linux.ibm.com, martin.petersen@oracle.com,
linux-hyperv@vger.kernel.org, linux-scsi@vger.kernel.org,
linux-kernel@vger.kernel.org, Michael Kelley, Dexuan Cui
In-Reply-To: <1569442244-16726-1-git-send-email-decui@microsoft.com>
[-- Attachment #1: Type: text/plain, Size: 2342 bytes --]
Hi Dexuan,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on mkp-scsi/for-next]
[cannot apply to v5.3 next-20190924]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]
url: https://github.com/0day-ci/linux/commits/Dexuan-Cui/scsi-storvsc-Add-the-support-of-hibernation/20190926-041702
base: https://kernel.googlesource.com/pub/scm/linux/kernel/git/mkp/scsi.git for-next
config: x86_64-rhel (attached as .config)
compiler: gcc-7 (Debian 7.4.0-13) 7.4.0
reproduce:
# save the attached .config to linux build tree
make ARCH=x86_64
If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>
All errors (new ones prefixed by >>):
>> drivers//scsi/storvsc_drv.c:1981:3: error: 'struct hv_driver' has no member named 'suspend'
.suspend = storvsc_suspend,
^~~~~~~
>> drivers//scsi/storvsc_drv.c:1981:13: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types]
.suspend = storvsc_suspend,
^~~~~~~~~~~~~~~
drivers//scsi/storvsc_drv.c:1981:13: note: (near initialization for 'storvsc_drv.shutdown')
>> drivers//scsi/storvsc_drv.c:1982:3: error: 'struct hv_driver' has no member named 'resume'; did you mean 'remove'?
.resume = storvsc_resume,
^~~~~~
remove
drivers//scsi/storvsc_drv.c:1982:12: warning: excess elements in struct initializer
.resume = storvsc_resume,
^~~~~~~~~~~~~~
drivers//scsi/storvsc_drv.c:1982:12: note: (near initialization for 'storvsc_drv')
cc1: some warnings being treated as errors
vim +1981 drivers//scsi/storvsc_drv.c
1975
1976 static struct hv_driver storvsc_drv = {
1977 .name = KBUILD_MODNAME,
1978 .id_table = id_table,
1979 .probe = storvsc_probe,
1980 .remove = storvsc_remove,
> 1981 .suspend = storvsc_suspend,
> 1982 .resume = storvsc_resume,
1983 .driver = {
1984 .probe_type = PROBE_PREFER_ASYNCHRONOUS,
1985 },
1986 };
1987
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 43550 bytes --]
^ permalink raw reply
* [PATCH v2][PATCH net] hv_netvsc: Add the support of hibernation
From: Dexuan Cui @ 2019-09-25 22:04 UTC (permalink / raw)
To: KY Srinivasan, Haiyang Zhang, Stephen Hemminger,
sashal@kernel.org, davem@davemloft.net,
linux-hyperv@vger.kernel.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, Michael Kelley
Cc: Dexuan Cui
The existing netvsc_detach() and netvsc_attach() APIs make it easy to
implement the suspend/resume callbacks.
Signed-off-by: Dexuan Cui <decui@microsoft.com>
---
This patch is basically a pure Hyper-V specific change. I request this
patch should go through Sasha's Hyper-V tree rather than the net tree.
Sasha's Hyper-V tree is here:
https://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux.git
Previously there was a dependency on the commit 271b2224d42f ("Drivers:
hv: vmbus: Implement suspend/resume for VSC drivers for hibernation"),
which was only on Sasha Levin's Hyper-V tree's hyperv-next branch:
https://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux.git/log/?h=hyperv-next
. Now the patch has been merged into Linus's master tree, but as of now,
the patch (271b2224d42f) has not appeared in the net.git tree, so IMO
it's better for this patch to go through the Hyper-V tree. The added
code in this patch is unlikely to cause a conflict.
In v2:
Removed the superfluous "cancel_work_sync(&nvdev->subchan_work)".
Changed the [PATCH net-next] to [PATCH net] in the Subject, because
IMO this is more of a bug fix rather than a new feaure.
No other change.
drivers/net/hyperv/hyperv_net.h | 3 ++
drivers/net/hyperv/netvsc_drv.c | 57 +++++++++++++++++++++++++++++++++
2 files changed, 60 insertions(+)
diff --git a/drivers/net/hyperv/hyperv_net.h b/drivers/net/hyperv/hyperv_net.h
index ecc9af050387..b8763ee4c0d0 100644
--- a/drivers/net/hyperv/hyperv_net.h
+++ b/drivers/net/hyperv/hyperv_net.h
@@ -952,6 +952,9 @@ struct net_device_context {
u32 vf_alloc;
/* Serial number of the VF to team with */
u32 vf_serial;
+
+ /* Used to temporarily save the config info across hibernation */
+ struct netvsc_device_info *saved_netvsc_dev_info;
};
/* Per channel data */
diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
index afdcc5664ea6..53a9451a58a7 100644
--- a/drivers/net/hyperv/netvsc_drv.c
+++ b/drivers/net/hyperv/netvsc_drv.c
@@ -2392,6 +2392,61 @@ static int netvsc_remove(struct hv_device *dev)
return 0;
}
+static int netvsc_suspend(struct hv_device *dev)
+{
+ struct net_device_context *ndev_ctx;
+ struct net_device *vf_netdev, *net;
+ struct netvsc_device *nvdev;
+ int ret;
+
+ net = hv_get_drvdata(dev);
+
+ ndev_ctx = netdev_priv(net);
+ cancel_delayed_work_sync(&ndev_ctx->dwork);
+
+ rtnl_lock();
+
+ nvdev = rtnl_dereference(ndev_ctx->nvdev);
+ if (nvdev == NULL) {
+ ret = -ENODEV;
+ goto out;
+ }
+
+ vf_netdev = rtnl_dereference(ndev_ctx->vf_netdev);
+ if (vf_netdev)
+ netvsc_unregister_vf(vf_netdev);
+
+ /* Save the current config info */
+ ndev_ctx->saved_netvsc_dev_info = netvsc_devinfo_get(nvdev);
+
+ ret = netvsc_detach(net, nvdev);
+out:
+ rtnl_unlock();
+
+ return ret;
+}
+
+static int netvsc_resume(struct hv_device *dev)
+{
+ struct net_device *net = hv_get_drvdata(dev);
+ struct net_device_context *net_device_ctx;
+ struct netvsc_device_info *device_info;
+ int ret;
+
+ rtnl_lock();
+
+ net_device_ctx = netdev_priv(net);
+ device_info = net_device_ctx->saved_netvsc_dev_info;
+
+ ret = netvsc_attach(net, device_info);
+
+ rtnl_unlock();
+
+ kfree(device_info);
+ net_device_ctx->saved_netvsc_dev_info = NULL;
+
+ return ret;
+}
static const struct hv_vmbus_device_id id_table[] = {
/* Network guid */
{ HV_NIC_GUID, },
@@ -2406,6 +2461,8 @@ static struct hv_driver netvsc_drv = {
.id_table = id_table,
.probe = netvsc_probe,
.remove = netvsc_remove,
+ .suspend = netvsc_suspend,
+ .resume = netvsc_resume,
.driver = {
.probe_type = PROBE_FORCE_SYNCHRONOUS,
},
--
2.19.1
^ permalink raw reply related
* RE: [PATCH v2] scsi: storvsc: Add the support of hibernation
From: Dexuan Cui @ 2019-09-25 22:15 UTC (permalink / raw)
To: kbuild test robot
Cc: kbuild-all@01.org, KY Srinivasan, Haiyang Zhang,
Stephen Hemminger, sashal@kernel.org, jejb@linux.ibm.com,
martin.petersen@oracle.com, linux-hyperv@vger.kernel.org,
linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
Michael Kelley
In-Reply-To: <201909260511.qkZEo9lk%lkp@intel.com>
> From: kbuild test robot <lkp@intel.com>
> Sent: Wednesday, September 25, 2019 2:55 PM
> To: Dexuan Cui <decui@microsoft.com>
> Cc: kbuild-all@01.org; KY Srinivasan <kys@microsoft.com>; Haiyang Zhang
> <haiyangz@microsoft.com>; Stephen Hemminger
> <sthemmin@microsoft.com>; sashal@kernel.org; jejb@linux.ibm.com;
> martin.petersen@oracle.com; linux-hyperv@vger.kernel.org;
> linux-scsi@vger.kernel.org; linux-kernel@vger.kernel.org; Michael Kelley
> <mikelley@microsoft.com>; Dexuan Cui <decui@microsoft.com>
> Subject: Re: [PATCH v2] scsi: storvsc: Add the support of hibernation
>
> Hi Dexuan,
>
> Thank you for the patch! Yet something to improve:
>
> [auto build test ERROR on mkp-scsi/for-next]
> [cannot apply to v5.3 next-20190924]
> [if your patch is applied to the wrong git tree, please drop us a note to help
> improve the system. BTW, we also suggest to use '--base' option to specify the
> base tree in git format-patch, please see
> [...snipped...]
> config: x86_64-rhel (attached as .config)
> compiler: gcc-7 (Debian 7.4.0-13) 7.4.0
> reproduce:
> # save the attached .config to linux build tree
> make ARCH=x86_64
>
> If you fix the issue, kindly add following tag
> Reported-by: kbuild test robot <lkp@intel.com>
>
> All errors (new ones prefixed by >>):
>
> >> drivers//scsi/storvsc_drv.c:1981:3: error: 'struct hv_driver' has no member
> named 'suspend'
> .suspend = storvsc_suspend,
> ^~~~~~~
This patch depends on the below patch in Linus's tree (today):
271b2224d42f ("Drivers: hv: vmbus: Implement suspend/resume for VSC drivers for hibernation")
So, we don't really have an issue here.
The mkp-scsi/for-next branch needs to do a merge with Linus's master branch.
Thanks,
-- Dexuan
^ permalink raw reply
* RE: [PATCH v2][PATCH net] hv_netvsc: Add the support of hibernation
From: Haiyang Zhang @ 2019-09-25 22:23 UTC (permalink / raw)
To: Dexuan Cui, KY Srinivasan, Stephen Hemminger, sashal@kernel.org,
davem@davemloft.net, linux-hyperv@vger.kernel.org,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
Michael Kelley
In-Reply-To: <1569449034-29924-1-git-send-email-decui@microsoft.com>
> -----Original Message-----
> From: Dexuan Cui <decui@microsoft.com>
> Sent: Wednesday, September 25, 2019 6:04 PM
> To: KY Srinivasan <kys@microsoft.com>; Haiyang Zhang
> <haiyangz@microsoft.com>; Stephen Hemminger
> <sthemmin@microsoft.com>; sashal@kernel.org; davem@davemloft.net;
> linux-hyperv@vger.kernel.org; netdev@vger.kernel.org; linux-
> kernel@vger.kernel.org; Michael Kelley <mikelley@microsoft.com>
> Cc: Dexuan Cui <decui@microsoft.com>
> Subject: [PATCH v2][PATCH net] hv_netvsc: Add the support of hibernation
>
> The existing netvsc_detach() and netvsc_attach() APIs make it easy to
> implement the suspend/resume callbacks.
>
> Signed-off-by: Dexuan Cui <decui@microsoft.com>
Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com>
^ permalink raw reply
* RE: [PATCH v2] PCI: PM: Move to D0 before calling pci_legacy_resume_early()
From: Dexuan Cui @ 2019-09-25 22:25 UTC (permalink / raw)
To: Dexuan Cui, lorenzo.pieralisi@arm.com, bhelgaas@google.com,
linux-pci@vger.kernel.org
Cc: linux-hyperv@vger.kernel.org, Stephen Hemminger,
jackm@mellanox.com, Haiyang Zhang,
driverdev-devel@linuxdriverproject.org,
linux-kernel@vger.kernel.org, Michael Kelley, Sasha Levin,
marcelo.cerri@canonical.com, olaf@aepfle.de, apw@canonical.com,
vkuznets, jasowang@redhat.com
In-Reply-To: <KU1P153MB0166994305CF5B9CFA612AA7BFB90@KU1P153MB0166.APCP153.PROD.OUTLOOK.COM>
> From: devel <driverdev-devel-bounces@linuxdriverproject.org> On Behalf Of
> Dexuan Cui
> Sent: Monday, September 2, 2019 5:35 PM
> To: lorenzo.pieralisi@arm.com; bhelgaas@google.com;
> linux-pci@vger.kernel.org
> [..snipped...]
> > ---
> >
> > changes in v2:
> > Updated the changelog with more details.
> >
> > drivers/pci/pci-driver.c | 7 ++++---
> > 1 file changed, 4 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c
> > index 36dbe960306b..27dfc68db9e7 100644
> > --- a/drivers/pci/pci-driver.c
> > +++ b/drivers/pci/pci-driver.c
> > @@ -1074,15 +1074,16 @@ static int pci_pm_thaw_noirq(struct device
> *dev)
> > return error;
> > }
> >
> > - if (pci_has_legacy_pm_support(pci_dev))
> > - return pci_legacy_resume_early(dev);
> > -
> > /*
> > * pci_restore_state() requires the device to be in D0 (because of MSI
> > * restoration among other things), so force it into D0 in case the
> > * driver's "freeze" callbacks put it into a low-power state directly.
> > */
> > pci_set_power_state(pci_dev, PCI_D0);
> > +
> > + if (pci_has_legacy_pm_support(pci_dev))
> > + return pci_legacy_resume_early(dev);
> > +
> > pci_restore_state(pci_dev);
> >
> > if (drv && drv->pm && drv->pm->thaw_noirq)
> > --
>
> Hi, Lorenzo, Bjorn,
>
> Can you please take a look at the v2 ?
>
> -- Dexuan
Hi Lorenzo, Bjorn, and all,
It looks this patch has not been acked by anyone.
Should I resend it? There is no change since v2.
Thanks,
-- Dexuan
^ permalink raw reply
* RE: [PATCH v5 0/3] Enhance Hyper-V for hibernation
From: Dexuan Cui @ 2019-09-25 22:49 UTC (permalink / raw)
To: Dexuan Cui, arnd@arndb.de, bp@alien8.de,
daniel.lezcano@linaro.org, Haiyang Zhang, hpa@zytor.com,
KY Srinivasan, linux-hyperv@vger.kernel.org,
linux-kernel@vger.kernel.org, mingo@redhat.com, sashal@kernel.org,
Stephen Hemminger, Thomas Gleixner, x86@kernel.org,
Michael Kelley, Sasha Levin
Cc: linux-arch@vger.kernel.org
In-Reply-To: <1567723581-29088-1-git-send-email-decui@microsoft.com>
> From: Dexuan Cui <decui@microsoft.com>
> Sent: Thursday, September 5, 2019 3:47 PM
>
> This patchset (consisting of 3 patches) was part of the v4 patchset (consisting
> of 12 patches): https://lkml.org/lkml/2019/9/2/894
>
> I realized these 3 patches must go through the tip.git tree, because I have
> to rebase 2 of the 3 patches due to recent changes from others in the tip
> tree.
>
> All the 3 patches are now rebased to the tip tree's timers/core branch:
> https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git/log/?h=timers/core
> , and all the 3 patches have Michael Kelley's Signed-off-by's.
>
> Please review.
>
> Thanks!
> Dexuan
>
> Dexuan Cui (3):
> x86/hyper-v: Suspend/resume the hypercall page for hibernation
> x86/hyper-v: Implement hv_is_hibernation_supported()
> clocksource/drivers: Suspend/resume Hyper-V clocksource for
> hibernation
>
> arch/x86/hyperv/hv_init.c | 40
> ++++++++++++++++++++++++++++++++++++++
> drivers/clocksource/hyperv_timer.c | 25 ++++++++++++++++++++++++
> include/asm-generic/mshyperv.h | 2 ++
> 3 files changed, 67 insertions(+)
Hi tglx and all,
Can you please take a look at this patchset (3 patches in total)?
IMO it's better for the 3 patches to go through the tip.git tree, but if you
(the x86 maintainers) have no objection, the patches can also go through
Saha Levin's Hyper-V tree, because the dependent patches have landed
in Linus's tree now.
Thanks,
-- Dexuan
^ permalink raw reply
* [PATCH][RESEND] clocksource/drivers: hyperv_timer: Fix CPU offlining by unbinding the timer
From: Dexuan Cui @ 2019-09-25 23:18 UTC (permalink / raw)
To: KY Srinivasan, Haiyang Zhang, Stephen Hemminger,
sashal@kernel.org, daniel.lezcano@linaro.org, tglx@linutronix.de,
linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org,
Michael Kelley
Cc: Dexuan Cui
The commit fd1fea6834d0 says "No behavior is changed", but actually it
removes the clockevents_unbind_device() call from hv_synic_cleanup().
In the discussion earlier this month, I thought the unbind call is
unnecessary (see https://www.spinics.net/lists/arm-kernel/msg739888.html),
however, after more investigation, when a VM runs on Hyper-V, it turns out
the unbind call must be kept, otherwise CPU offling may not work, because
a per-cpu timer device is still needed, after hv_synic_cleanup() disables
the per-cpu Hyper-V timer device.
The issue is found in the hibernation test. These are the details:
1. CPU0 hangs in wait_for_ap_thread(), when trying to offline CPU1:
hibernation_snapshot
create_image
suspend_disable_secondary_cpus
freeze_secondary_cpus
_cpu_down(1, 1, CPUHP_OFFLINE)
cpuhp_kick_ap_work
cpuhp_kick_ap
__cpuhp_kick_ap
wait_for_ap_thread()
2. CPU0 hangs because CPU1 hangs this way: after CPU1 disables the per-cpu
Hyper-V timer device in hv_synic_cleanup(), CPU1 sets a timer... Please
read on to see how this can happen.
2.1 By "_cpu_down(1, 1, CPUHP_OFFLINE):", CPU0 first tries to move CPU1 to
the CPUHP_TEARDOWN_CPU state and this wakes up the cpuhp/1 thread on CPU1;
the thread is basically a loop of executing various callbacks defined in
the global array cpuhp_hp_states[]: see smpboot_thread_fn().
2.2 This is how a callback is called on CPU1:
smpboot_thread_fn
ht->thread_fn(td->cpu), i.e. cpuhp_thread_fun
cpuhp_invoke_callback
state = st->state
st->state--
cpuhp_get_step(state)->teardown.single()
2.3 At first, the state of CPU1 is CPUHP_ONLINE, which defines a
.teardown.single of NULL, so the execution of the code returns to the loop
in smpboot_thread_fn(), and then reruns cpuhp_invoke_callback() with a
smaller st->state.
2.4 The .teardown.single of every state between CPUHP_ONLINE and
CPUHP_TEARDOWN_CPU runs one by one.
2.5 When it comes to the CPUHP_AP_ONLINE_DYN range, hv_synic_cleanup()
runs: see vmbus_bus_init(). It calls hv_stimer_cleanup() ->
hv_ce_shutdown() to disable the per-cpu timer device, so timer interrupt
will no longer happen on CPU1.
2.6 Later, the .teardown.single of CPUHP_AP_SMPBOOT_THREADS, i.e.
smpboot_park_threads(), starts to run, trying to park all the other
hotplug_threads, e.g. ksoftirqd/1 and rcuc/1; here a timer can be set up
this way and the timer will never be fired since CPU1 doesn't have
an active timer device now, so CPU1 hangs and can not be offlined:
smpboot_park_threads
smpboot_park_thread
kthread_park
wait_task_inactive
schedule_hrtimeout(&to, HRTIMER_MODE_REL)
With this patch, when the per-cpu Hyper-V timer device is disabled, the
system switches to the Local APIC timer, and the hang issue can not
happen.
Fixes: fd1fea6834d0 ("clocksource/drivers: Make Hyper-V clocksource ISA agnostic")
Signed-off-by: Dexuan Cui <decui@microsoft.com>
---
The patch was firstly posted on Jul 27: https://lkml.org/lkml/2019/7/27/5
There is no change since then.
drivers/clocksource/hyperv_timer.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/clocksource/hyperv_timer.c b/drivers/clocksource/hyperv_timer.c
index ba2c79e6a0ee..17b96f9ed0c9 100644
--- a/drivers/clocksource/hyperv_timer.c
+++ b/drivers/clocksource/hyperv_timer.c
@@ -139,6 +139,7 @@ void hv_stimer_cleanup(unsigned int cpu)
/* Turn off clockevent device */
if (ms_hyperv.features & HV_MSR_SYNTIMER_AVAILABLE) {
ce = per_cpu_ptr(hv_clock_event, cpu);
+ clockevents_unbind_device(ce, cpu);
hv_ce_shutdown(ce);
}
}
--
2.19.1
^ permalink raw reply related
* Re: [PATCH v5 3/3] clocksource/drivers: Suspend/resume Hyper-V clocksource for hibernation
From: Daniel Lezcano @ 2019-09-25 23:21 UTC (permalink / raw)
To: Dexuan Cui, arnd@arndb.de, bp@alien8.de, Haiyang Zhang,
hpa@zytor.com, KY Srinivasan, linux-hyperv@vger.kernel.org,
linux-kernel@vger.kernel.org, mingo@redhat.com, sashal@kernel.org,
Stephen Hemminger, tglx@linutronix.de, x86@kernel.org,
Michael Kelley, Sasha Levin
Cc: linux-arch@vger.kernel.org
In-Reply-To: <1567723581-29088-4-git-send-email-decui@microsoft.com>
On 06/09/2019 00:47, Dexuan Cui wrote:
> This is needed for hibernation, e.g. when we resume the old kernel, we need
> to disable the "current" kernel's TSC page and then resume the old kernel's.
>
> Signed-off-by: Dexuan Cui <decui@microsoft.com>
> Reviewed-by: Michael Kelley <mikelley@microsoft.com>
I can take this patch if needed.
> ---
> drivers/clocksource/hyperv_timer.c | 25 +++++++++++++++++++++++++
> 1 file changed, 25 insertions(+)
>
> diff --git a/drivers/clocksource/hyperv_timer.c b/drivers/clocksource/hyperv_timer.c
> index 726a65e..07f4747 100644
> --- a/drivers/clocksource/hyperv_timer.c
> +++ b/drivers/clocksource/hyperv_timer.c
> @@ -237,12 +237,37 @@ static u64 read_hv_sched_clock_tsc(void)
> return read_hv_clock_tsc(NULL) - hv_sched_clock_offset;
> }
>
> +static void suspend_hv_clock_tsc(struct clocksource *arg)
> +{
> + u64 tsc_msr;
> +
> + /* Disable the TSC page */
> + hv_get_reference_tsc(tsc_msr);
> + tsc_msr &= ~BIT_ULL(0);
> + hv_set_reference_tsc(tsc_msr);
> +}
> +
> +
> +static void resume_hv_clock_tsc(struct clocksource *arg)
> +{
> + phys_addr_t phys_addr = virt_to_phys(&tsc_pg);
> + u64 tsc_msr;
> +
> + /* Re-enable the TSC page */
> + hv_get_reference_tsc(tsc_msr);
> + tsc_msr &= GENMASK_ULL(11, 0);
> + tsc_msr |= BIT_ULL(0) | (u64)phys_addr;
> + hv_set_reference_tsc(tsc_msr);
> +}
> +
> static struct clocksource hyperv_cs_tsc = {
> .name = "hyperv_clocksource_tsc_page",
> .rating = 400,
> .read = read_hv_clock_tsc,
> .mask = CLOCKSOURCE_MASK(64),
> .flags = CLOCK_SOURCE_IS_CONTINUOUS,
> + .suspend= suspend_hv_clock_tsc,
> + .resume = resume_hv_clock_ts,> };
>
> static u64 notrace read_hv_clock_msr(struct clocksource *arg)
>
--
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs
Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog
^ permalink raw reply
* RE: [PATCH v5 3/3] clocksource/drivers: Suspend/resume Hyper-V clocksource for hibernation
From: Dexuan Cui @ 2019-09-25 23:35 UTC (permalink / raw)
To: Daniel Lezcano, tglx@linutronix.de, arnd@arndb.de, bp@alien8.de,
Haiyang Zhang, hpa@zytor.com, KY Srinivasan,
linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org,
mingo@redhat.com, sashal@kernel.org, Stephen Hemminger,
x86@kernel.org, Michael Kelley, Sasha Levin
Cc: linux-arch@vger.kernel.org
In-Reply-To: <8ba5e2fd-6a9f-b61b-685e-23a69cabe3a2@linaro.org>
> From: Daniel Lezcano <daniel.lezcano@linaro.org>
> Sent: Wednesday, September 25, 2019 4:21 PM
> To: Dexuan Cui <decui@microsoft.com>; arnd@arndb.de; bp@alien8.de;
> Haiyang Zhang <haiyangz@microsoft.com>; hpa@zytor.com; KY Srinivasan
> <kys@microsoft.com>; linux-hyperv@vger.kernel.org;
> linux-kernel@vger.kernel.org; mingo@redhat.com; sashal@kernel.org; Stephen
> Hemminger <sthemmin@microsoft.com>; tglx@linutronix.de; x86@kernel.org;
> Michael Kelley <mikelley@microsoft.com>; Sasha Levin
> <Alexander.Levin@microsoft.com>
> Cc: linux-arch@vger.kernel.org
> Subject: Re: [PATCH v5 3/3] clocksource/drivers: Suspend/resume Hyper-V
> clocksource for hibernation
>
> On 06/09/2019 00:47, Dexuan Cui wrote:
> > This is needed for hibernation, e.g. when we resume the old kernel, we need
> > to disable the "current" kernel's TSC page and then resume the old kernel's.
> >
> > Signed-off-by: Dexuan Cui <decui@microsoft.com>
> > Reviewed-by: Michael Kelley <mikelley@microsoft.com>
>
> I can take this patch if needed.
Thanks, Daniel! Usually tglx takes care of the patches, but it looks recently he
may be too busy to handle the 3 patches.
I guess you can take the patch, if tglx has no objection. :-)
If you take the patch, please take all the 3 patches.
Thanks,
-- Dexuan
^ permalink raw reply
* RE: [PATCH] vsock: Fix a lockdep warning in __vsock_release()
From: Dexuan Cui @ 2019-09-26 1:10 UTC (permalink / raw)
To: Stefano Garzarella
Cc: jhansen@vmware.com, davem@davemloft.net, stefanha@redhat.com,
netdev@vger.kernel.org, Stephen Hemminger, Sasha Levin,
sashal@kernel.org, Haiyang Zhang, KY Srinivasan, Michael Kelley,
linux-hyperv@vger.kernel.org, gregkh@linuxfoundation.org,
linux-kernel@vger.kernel.org
In-Reply-To: <20190822102529.q5ozdvh6kbymi6ni@steredhat>
> From: Stefano Garzarella <sgarzare@redhat.com>
> Sent: Thursday, August 22, 2019 3:25 AM
> > [...snipped...]
> > --- a/net/vmw_vsock/hyperv_transport.c
> > +++ b/net/vmw_vsock/hyperv_transport.c
> > @@ -559,7 +559,7 @@ static void hvs_release(struct vsock_sock *vsk)
> > struct sock *sk = sk_vsock(vsk);
> > bool remove_sock;
> >
> > - lock_sock(sk);
> > + lock_sock_nested(sk, SINGLE_DEPTH_NESTING);
>
> Should we update also other transports?
>
> Stefano
Hi Stefano,
Sorry for the late reply! I'll post a v2 shortly.
As I checked, hyperv socket and virtio socket need to be fixed.
The vmci socket code doesn't acquire the sock lock in the release
callback, so it doesn't need any fix.
Thanks,
-- Dexuan
^ permalink raw reply
* [PATCH net v2] vsock: Fix a lockdep warning in __vsock_release()
From: Dexuan Cui @ 2019-09-26 1:11 UTC (permalink / raw)
To: davem@davemloft.net, KY Srinivasan, Haiyang Zhang,
Stephen Hemminger, sashal@kernel.org, stefanha@redhat.com,
gregkh@linuxfoundation.org, arnd@arndb.de, deepa.kernel@gmail.com,
Dexuan Cui, ytht.net@gmail.com, tglx@linutronix.de,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-hyperv@vger.kernel.org, kvm@vger.kernel.org,
virtualization@lists.linux-foundation.org, Michael Kelley,
sgarzare@redhat.com, jhansen@vmware.com
Lockdep is unhappy if two locks from the same class are held.
Fix the below warning for hyperv and virtio sockets (vmci socket code
doesn't have the issue) by using lock_sock_nested() when __vsock_release()
is called recursively:
============================================
WARNING: possible recursive locking detected
5.3.0+ #1 Not tainted
--------------------------------------------
server/1795 is trying to acquire lock:
ffff8880c5158990 (sk_lock-AF_VSOCK){+.+.}, at: hvs_release+0x10/0x120 [hv_sock]
but task is already holding lock:
ffff8880c5158150 (sk_lock-AF_VSOCK){+.+.}, at: __vsock_release+0x2e/0xf0 [vsock]
other info that might help us debug this:
Possible unsafe locking scenario:
CPU0
----
lock(sk_lock-AF_VSOCK);
lock(sk_lock-AF_VSOCK);
*** DEADLOCK ***
May be due to missing lock nesting notation
2 locks held by server/1795:
#0: ffff8880c5d05ff8 (&sb->s_type->i_mutex_key#10){+.+.}, at: __sock_release+0x2d/0xa0
#1: ffff8880c5158150 (sk_lock-AF_VSOCK){+.+.}, at: __vsock_release+0x2e/0xf0 [vsock]
stack backtrace:
CPU: 5 PID: 1795 Comm: server Not tainted 5.3.0+ #1
Call Trace:
dump_stack+0x67/0x90
__lock_acquire.cold.67+0xd2/0x20b
lock_acquire+0xb5/0x1c0
lock_sock_nested+0x6d/0x90
hvs_release+0x10/0x120 [hv_sock]
__vsock_release+0x24/0xf0 [vsock]
__vsock_release+0xa0/0xf0 [vsock]
vsock_release+0x12/0x30 [vsock]
__sock_release+0x37/0xa0
sock_close+0x14/0x20
__fput+0xc1/0x250
task_work_run+0x98/0xc0
do_exit+0x344/0xc60
do_group_exit+0x47/0xb0
get_signal+0x15c/0xc50
do_signal+0x30/0x720
exit_to_usermode_loop+0x50/0xa0
do_syscall_64+0x24e/0x270
entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x7f4184e85f31
Signed-off-by: Dexuan Cui <decui@microsoft.com>
---
NOTE: I only tested the code on Hyper-V. I can not test the code for
virtio socket, as I don't have a KVM host. :-( Sorry.
@Stefan, @Stefano: please review & test the patch for virtio socket,
and let me know if the patch breaks anything. Thanks!
Changes in v2:
Avoid the duplication of code in v1: https://lkml.org/lkml/2019/8/19/1361
Also fix virtio socket code.
net/vmw_vsock/af_vsock.c | 19 +++++++++++++++----
net/vmw_vsock/hyperv_transport.c | 2 +-
net/vmw_vsock/virtio_transport_common.c | 2 +-
3 files changed, 17 insertions(+), 6 deletions(-)
diff --git a/net/vmw_vsock/af_vsock.c b/net/vmw_vsock/af_vsock.c
index ab47bf3ab66e..dbae4373cbab 100644
--- a/net/vmw_vsock/af_vsock.c
+++ b/net/vmw_vsock/af_vsock.c
@@ -638,8 +638,10 @@ struct sock *__vsock_create(struct net *net,
}
EXPORT_SYMBOL_GPL(__vsock_create);
-static void __vsock_release(struct sock *sk)
+static void __vsock_release(struct sock *sk, int level)
{
+ WARN_ON(level != 1 && level != 2);
+
if (sk) {
struct sk_buff *skb;
struct sock *pending;
@@ -648,9 +650,18 @@ static void __vsock_release(struct sock *sk)
vsk = vsock_sk(sk);
pending = NULL; /* Compiler warning. */
+ /* The release call is supposed to use lock_sock_nested()
+ * rather than lock_sock(), if a sock lock should be acquired.
+ */
transport->release(vsk);
- lock_sock(sk);
+ /* When "level" is 2, use the nested version to avoid the
+ * warning "possible recursive locking detected".
+ */
+ if (level == 1)
+ lock_sock(sk);
+ else
+ lock_sock_nested(sk, SINGLE_DEPTH_NESTING);
sock_orphan(sk);
sk->sk_shutdown = SHUTDOWN_MASK;
@@ -659,7 +670,7 @@ static void __vsock_release(struct sock *sk)
/* Clean up any sockets that never were accepted. */
while ((pending = vsock_dequeue_accept(sk)) != NULL) {
- __vsock_release(pending);
+ __vsock_release(pending, 2);
sock_put(pending);
}
@@ -708,7 +719,7 @@ EXPORT_SYMBOL_GPL(vsock_stream_has_space);
static int vsock_release(struct socket *sock)
{
- __vsock_release(sock->sk);
+ __vsock_release(sock->sk, 1);
sock->sk = NULL;
sock->state = SS_FREE;
diff --git a/net/vmw_vsock/hyperv_transport.c b/net/vmw_vsock/hyperv_transport.c
index 261521d286d6..c443db7af8d4 100644
--- a/net/vmw_vsock/hyperv_transport.c
+++ b/net/vmw_vsock/hyperv_transport.c
@@ -559,7 +559,7 @@ static void hvs_release(struct vsock_sock *vsk)
struct sock *sk = sk_vsock(vsk);
bool remove_sock;
- lock_sock(sk);
+ lock_sock_nested(sk, SINGLE_DEPTH_NESTING);
remove_sock = hvs_close_lock_held(vsk);
release_sock(sk);
if (remove_sock)
diff --git a/net/vmw_vsock/virtio_transport_common.c b/net/vmw_vsock/virtio_transport_common.c
index 5bb70c692b1e..a666ef8fc54e 100644
--- a/net/vmw_vsock/virtio_transport_common.c
+++ b/net/vmw_vsock/virtio_transport_common.c
@@ -820,7 +820,7 @@ void virtio_transport_release(struct vsock_sock *vsk)
struct sock *sk = &vsk->sk;
bool remove_sock = true;
- lock_sock(sk);
+ lock_sock_nested(sk, SINGLE_DEPTH_NESTING);
if (sk->sk_type == SOCK_STREAM)
remove_sock = virtio_transport_close(vsk);
--
2.19.1
^ permalink raw reply related
* Re: [PATCH] hv_balloon: Add the support of hibernation
From: David Hildenbrand @ 2019-09-26 7:19 UTC (permalink / raw)
To: Dexuan Cui, KY Srinivasan, Haiyang Zhang, Stephen Hemminger,
sashal@kernel.org, linux-hyperv@vger.kernel.org,
linux-kernel@vger.kernel.org, Michael Kelley
In-Reply-To: <PU1P153MB0169B05143A68A56740669AFBF870@PU1P153MB0169.APCP153.PROD.OUTLOOK.COM>
On 25.09.19 22:03, Dexuan Cui wrote:
>> From: linux-hyperv-owner@vger.kernel.org
>> [... snipped ...]
>>> Anyhow, just some comments from my side :) I can see how Windows Server
>>> worked around that issue right now by just XOR'ing both features.
>>>
>>> David / dhildenb
>>
>> Thanks for sharing your thoughts!
>>
>> -- Dexuan
>
> Hi David,
> If my explanation sounds good to you, can I have an Acked-by from you?
>
I do ACK the approach but not the patch in it's current state. I don't
like the ifdefs - once you can get rid of the ifdefery - e.g., after the
prerequisite is upstream - you can add my
Acked-by: David Hildenbrand <david@redhat.com>
--
Thanks,
David / dhildenb
^ permalink raw reply
* Re: [PATCH net v2] vsock: Fix a lockdep warning in __vsock_release()
From: Stefano Garzarella @ 2019-09-26 7:47 UTC (permalink / raw)
To: Dexuan Cui
Cc: davem@davemloft.net, KY Srinivasan, Haiyang Zhang,
Stephen Hemminger, sashal@kernel.org, stefanha@redhat.com,
gregkh@linuxfoundation.org, arnd@arndb.de, deepa.kernel@gmail.com,
ytht.net@gmail.com, tglx@linutronix.de, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-hyperv@vger.kernel.org,
kvm@vger.kernel.org, virtualization@lists.linux-foundation.org,
Michael Kelley, jhansen@vmware.com
In-Reply-To: <1569460241-57800-1-git-send-email-decui@microsoft.com>
Hi Dexuan,
On Thu, Sep 26, 2019 at 01:11:27AM +0000, Dexuan Cui wrote:
> Lockdep is unhappy if two locks from the same class are held.
>
> Fix the below warning for hyperv and virtio sockets (vmci socket code
> doesn't have the issue) by using lock_sock_nested() when __vsock_release()
> is called recursively:
>
> ============================================
> WARNING: possible recursive locking detected
> 5.3.0+ #1 Not tainted
> --------------------------------------------
> server/1795 is trying to acquire lock:
> ffff8880c5158990 (sk_lock-AF_VSOCK){+.+.}, at: hvs_release+0x10/0x120 [hv_sock]
>
> but task is already holding lock:
> ffff8880c5158150 (sk_lock-AF_VSOCK){+.+.}, at: __vsock_release+0x2e/0xf0 [vsock]
>
> other info that might help us debug this:
> Possible unsafe locking scenario:
>
> CPU0
> ----
> lock(sk_lock-AF_VSOCK);
> lock(sk_lock-AF_VSOCK);
>
> *** DEADLOCK ***
>
> May be due to missing lock nesting notation
>
> 2 locks held by server/1795:
> #0: ffff8880c5d05ff8 (&sb->s_type->i_mutex_key#10){+.+.}, at: __sock_release+0x2d/0xa0
> #1: ffff8880c5158150 (sk_lock-AF_VSOCK){+.+.}, at: __vsock_release+0x2e/0xf0 [vsock]
>
> stack backtrace:
> CPU: 5 PID: 1795 Comm: server Not tainted 5.3.0+ #1
> Call Trace:
> dump_stack+0x67/0x90
> __lock_acquire.cold.67+0xd2/0x20b
> lock_acquire+0xb5/0x1c0
> lock_sock_nested+0x6d/0x90
> hvs_release+0x10/0x120 [hv_sock]
> __vsock_release+0x24/0xf0 [vsock]
> __vsock_release+0xa0/0xf0 [vsock]
> vsock_release+0x12/0x30 [vsock]
> __sock_release+0x37/0xa0
> sock_close+0x14/0x20
> __fput+0xc1/0x250
> task_work_run+0x98/0xc0
> do_exit+0x344/0xc60
> do_group_exit+0x47/0xb0
> get_signal+0x15c/0xc50
> do_signal+0x30/0x720
> exit_to_usermode_loop+0x50/0xa0
> do_syscall_64+0x24e/0x270
> entry_SYSCALL_64_after_hwframe+0x49/0xbe
> RIP: 0033:0x7f4184e85f31
>
> Signed-off-by: Dexuan Cui <decui@microsoft.com>
> ---
>
> NOTE: I only tested the code on Hyper-V. I can not test the code for
> virtio socket, as I don't have a KVM host. :-( Sorry.
>
> @Stefan, @Stefano: please review & test the patch for virtio socket,
> and let me know if the patch breaks anything. Thanks!
Comment below, I'll test it ASAP!
>
> Changes in v2:
> Avoid the duplication of code in v1: https://lkml.org/lkml/2019/8/19/1361
> Also fix virtio socket code.
>
> net/vmw_vsock/af_vsock.c | 19 +++++++++++++++----
> net/vmw_vsock/hyperv_transport.c | 2 +-
> net/vmw_vsock/virtio_transport_common.c | 2 +-
> 3 files changed, 17 insertions(+), 6 deletions(-)
>
> diff --git a/net/vmw_vsock/af_vsock.c b/net/vmw_vsock/af_vsock.c
> index ab47bf3ab66e..dbae4373cbab 100644
> --- a/net/vmw_vsock/af_vsock.c
> +++ b/net/vmw_vsock/af_vsock.c
> @@ -638,8 +638,10 @@ struct sock *__vsock_create(struct net *net,
> }
> EXPORT_SYMBOL_GPL(__vsock_create);
>
> -static void __vsock_release(struct sock *sk)
> +static void __vsock_release(struct sock *sk, int level)
> {
> + WARN_ON(level != 1 && level != 2);
> +
> if (sk) {
> struct sk_buff *skb;
> struct sock *pending;
> @@ -648,9 +650,18 @@ static void __vsock_release(struct sock *sk)
> vsk = vsock_sk(sk);
> pending = NULL; /* Compiler warning. */
>
> + /* The release call is supposed to use lock_sock_nested()
> + * rather than lock_sock(), if a sock lock should be acquired.
> + */
> transport->release(vsk);
>
> - lock_sock(sk);
> + /* When "level" is 2, use the nested version to avoid the
> + * warning "possible recursive locking detected".
> + */
> + if (level == 1)
> + lock_sock(sk);
Since lock_sock() calls lock_sock_nested(sk, 0), could we use directly
lock_sock_nested(sk, level) with level = 0 in vsock_release() and
level = SINGLE_DEPTH_NESTING here in the while loop?
> + else
> + lock_sock_nested(sk, SINGLE_DEPTH_NESTING);
> sock_orphan(sk);
> sk->sk_shutdown = SHUTDOWN_MASK;
>
> @@ -659,7 +670,7 @@ static void __vsock_release(struct sock *sk)
>
> /* Clean up any sockets that never were accepted. */
> while ((pending = vsock_dequeue_accept(sk)) != NULL) {
> - __vsock_release(pending);
> + __vsock_release(pending, 2);
> sock_put(pending);
> }
>
> @@ -708,7 +719,7 @@ EXPORT_SYMBOL_GPL(vsock_stream_has_space);
>
> static int vsock_release(struct socket *sock)
> {
> - __vsock_release(sock->sk);
> + __vsock_release(sock->sk, 1);
> sock->sk = NULL;
> sock->state = SS_FREE;
>
> diff --git a/net/vmw_vsock/hyperv_transport.c b/net/vmw_vsock/hyperv_transport.c
> index 261521d286d6..c443db7af8d4 100644
> --- a/net/vmw_vsock/hyperv_transport.c
> +++ b/net/vmw_vsock/hyperv_transport.c
> @@ -559,7 +559,7 @@ static void hvs_release(struct vsock_sock *vsk)
> struct sock *sk = sk_vsock(vsk);
> bool remove_sock;
>
> - lock_sock(sk);
> + lock_sock_nested(sk, SINGLE_DEPTH_NESTING);
> remove_sock = hvs_close_lock_held(vsk);
> release_sock(sk);
> if (remove_sock)
> diff --git a/net/vmw_vsock/virtio_transport_common.c b/net/vmw_vsock/virtio_transport_common.c
> index 5bb70c692b1e..a666ef8fc54e 100644
> --- a/net/vmw_vsock/virtio_transport_common.c
> +++ b/net/vmw_vsock/virtio_transport_common.c
> @@ -820,7 +820,7 @@ void virtio_transport_release(struct vsock_sock *vsk)
> struct sock *sk = &vsk->sk;
> bool remove_sock = true;
>
> - lock_sock(sk);
> + lock_sock_nested(sk, SINGLE_DEPTH_NESTING);
> if (sk->sk_type == SOCK_STREAM)
> remove_sock = virtio_transport_close(vsk);
>
Thanks,
Stefano
^ permalink raw reply
* Re: [PATCH v5 1/3] x86/hyper-v: Suspend/resume the hypercall page for hibernation
From: Vitaly Kuznetsov @ 2019-09-26 10:44 UTC (permalink / raw)
To: Dexuan Cui
Cc: linux-arch@vger.kernel.org, arnd@arndb.de, bp@alien8.de,
daniel.lezcano@linaro.org, Haiyang Zhang, hpa@zytor.com,
KY Srinivasan, linux-hyperv@vger.kernel.org,
linux-kernel@vger.kernel.org, mingo@redhat.com, sashal@kernel.org,
Stephen Hemminger, tglx@linutronix.de, x86@kernel.org,
Michael Kelley, Sasha Levin
In-Reply-To: <1567723581-29088-2-git-send-email-decui@microsoft.com>
Dexuan Cui <decui@microsoft.com> writes:
> This is needed for hibernation, e.g. when we resume the old kernel, we need
> to disable the "current" kernel's hypercall page and then resume the old
> kernel's.
>
> Signed-off-by: Dexuan Cui <decui@microsoft.com>
> Reviewed-by: Michael Kelley <mikelley@microsoft.com>
> ---
> arch/x86/hyperv/hv_init.c | 33 +++++++++++++++++++++++++++++++++
> 1 file changed, 33 insertions(+)
>
> diff --git a/arch/x86/hyperv/hv_init.c b/arch/x86/hyperv/hv_init.c
> index 866dfb3..037b0f3 100644
> --- a/arch/x86/hyperv/hv_init.c
> +++ b/arch/x86/hyperv/hv_init.c
> @@ -20,6 +20,7 @@
> #include <linux/hyperv.h>
> #include <linux/slab.h>
> #include <linux/cpuhotplug.h>
> +#include <linux/syscore_ops.h>
> #include <clocksource/hyperv_timer.h>
>
> void *hv_hypercall_pg;
> @@ -223,6 +224,34 @@ static int __init hv_pci_init(void)
> return 1;
> }
>
> +static int hv_suspend(void)
> +{
> + union hv_x64_msr_hypercall_contents hypercall_msr;
> +
> + /* Reset the hypercall page */
> + rdmsrl(HV_X64_MSR_HYPERCALL, hypercall_msr.as_uint64);
> + hypercall_msr.enable = 0;
> + wrmsrl(HV_X64_MSR_HYPERCALL, hypercall_msr.as_uint64);
> +
(trying to think out loud, not sure there's a real issue):
When PV IPIs (or PV TLB flush) are enabled we do the following checks:
if (!hv_hypercall_pg)
return false;
or
if (!hv_hypercall_pg)
goto do_native;
which will pass as we're not invalidating the pointer. Can we actually
be sure that the kernel will never try to send an IPI/do TLB flush
before we resume?
--
Vitaly
^ permalink raw reply
* Re: [PATCH v5 3/3] clocksource/drivers: Suspend/resume Hyper-V clocksource for hibernation
From: Daniel Lezcano @ 2019-09-26 13:16 UTC (permalink / raw)
To: Dexuan Cui, tglx@linutronix.de, arnd@arndb.de, bp@alien8.de,
Haiyang Zhang, hpa@zytor.com, KY Srinivasan,
linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org,
mingo@redhat.com, sashal@kernel.org, Stephen Hemminger,
x86@kernel.org, Michael Kelley, Sasha Levin
Cc: linux-arch@vger.kernel.org
In-Reply-To: <PU1P153MB0169A28B05A7CDE04A57AA58BF870@PU1P153MB0169.APCP153.PROD.OUTLOOK.COM>
On 26/09/2019 01:35, Dexuan Cui wrote:
>> From: Daniel Lezcano <daniel.lezcano@linaro.org>
>> Sent: Wednesday, September 25, 2019 4:21 PM
>> To: Dexuan Cui <decui@microsoft.com>; arnd@arndb.de; bp@alien8.de;
>> Haiyang Zhang <haiyangz@microsoft.com>; hpa@zytor.com; KY Srinivasan
>> <kys@microsoft.com>; linux-hyperv@vger.kernel.org;
>> linux-kernel@vger.kernel.org; mingo@redhat.com; sashal@kernel.org; Stephen
>> Hemminger <sthemmin@microsoft.com>; tglx@linutronix.de; x86@kernel.org;
>> Michael Kelley <mikelley@microsoft.com>; Sasha Levin
>> <Alexander.Levin@microsoft.com>
>> Cc: linux-arch@vger.kernel.org
>> Subject: Re: [PATCH v5 3/3] clocksource/drivers: Suspend/resume Hyper-V
>> clocksource for hibernation
>>
>> On 06/09/2019 00:47, Dexuan Cui wrote:
>>> This is needed for hibernation, e.g. when we resume the old kernel, we need
>>> to disable the "current" kernel's TSC page and then resume the old kernel's.
>>>
>>> Signed-off-by: Dexuan Cui <decui@microsoft.com>
>>> Reviewed-by: Michael Kelley <mikelley@microsoft.com>
>>
>> I can take this patch if needed.
>
> Thanks, Daniel! Usually tglx takes care of the patches, but it looks recently he
> may be too busy to handle the 3 patches.
>
> I guess you can take the patch, if tglx has no objection. :-)
> If you take the patch, please take all the 3 patches.
I maintain drivers/clocksource for the tip/timers/core branch. I don't
want to proxy another tip branch as it is out of my jurisdiction.
So I can take patch 3/3 but will let the other 2 patches to be picked by
the right person. It is your call.
--
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs
Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog
^ permalink raw reply
* RE: [PATCH] HID: hyperv: Add the support of hibernation
From: Jiri Kosina @ 2019-09-26 13:22 UTC (permalink / raw)
To: Dexuan Cui
Cc: KY Srinivasan, Haiyang Zhang, Stephen Hemminger,
sashal@kernel.org, benjamin.tissoires@redhat.com,
linux-hyperv@vger.kernel.org, linux-input@vger.kernel.org,
linux-kernel@vger.kernel.org, Michael Kelley
In-Reply-To: <PU1P153MB01695CEE01D65E8CD5CFA4E9BF870@PU1P153MB0169.APCP153.PROD.OUTLOOK.COM>
On Wed, 25 Sep 2019, Dexuan Cui wrote:
> > We need mousevsc_pm_notify() to make sure the pm_wakeup_hard_event()
> > call does not prevent the system from entering hibernation: the
> > hibernation is a relatively long process, which can be aborted by the
> > call pm_wakeup_hard_event(), which is invoked upon mouse events.
> >
> > Signed-off-by: Dexuan Cui <decui@microsoft.com>
> > ---
> >
> > This patch is basically a pure Hyper-V specific change and it has a
> > build dependency on the commit 271b2224d42f ("Drivers: hv: vmbus:
> > Implement
> > suspend/resume for VSC drivers for hibernation"), which is on Sasha Levin's
> > Hyper-V tree's hyperv-next branch [ ... snipped ...]
> >
> > I request this patch should go through Sasha's tree rather than the
> > input subsystem's tree.
> >
> > Hi Jiri, Benjamin, can you please Ack?
>
> Hi Jiri, Benjamin,
> Can you please take a look at the patch?
Hi Dexuan,
I am planning to process it once 5.4 merge window is over and thus hid.git
is open again for 5.5 material.
Thanks,
--
Jiri Kosina
SUSE Labs
^ permalink raw reply
* RE: [PATCH] HID: hyperv: Add the support of hibernation
From: Jiri Kosina @ 2019-09-26 13:23 UTC (permalink / raw)
To: Dexuan Cui
Cc: KY Srinivasan, Haiyang Zhang, Stephen Hemminger,
sashal@kernel.org, benjamin.tissoires@redhat.com,
linux-hyperv@vger.kernel.org, linux-input@vger.kernel.org,
linux-kernel@vger.kernel.org, Michael Kelley
In-Reply-To: <nycvar.YFH.7.76.1909261521410.24354@cbobk.fhfr.pm>
On Thu, 26 Sep 2019, Jiri Kosina wrote:
> > > We need mousevsc_pm_notify() to make sure the pm_wakeup_hard_event()
> > > call does not prevent the system from entering hibernation: the
> > > hibernation is a relatively long process, which can be aborted by the
> > > call pm_wakeup_hard_event(), which is invoked upon mouse events.
> > >
> > > Signed-off-by: Dexuan Cui <decui@microsoft.com>
> > > ---
> > >
> > > This patch is basically a pure Hyper-V specific change and it has a
> > > build dependency on the commit 271b2224d42f ("Drivers: hv: vmbus:
> > > Implement
> > > suspend/resume for VSC drivers for hibernation"), which is on Sasha Levin's
> > > Hyper-V tree's hyperv-next branch [ ... snipped ...]
> > >
> > > I request this patch should go through Sasha's tree rather than the
> > > input subsystem's tree.
> > >
> > > Hi Jiri, Benjamin, can you please Ack?
> >
> > Hi Jiri, Benjamin,
> > Can you please take a look at the patch?
>
> Hi Dexuan,
>
> I am planning to process it once 5.4 merge window is over and thus hid.git
> is open again for 5.5 material.
Ah, now I see you asked for this go through hyperv tree. For that, feel
free to add
Acked-by: Jiri Kosina <jkosina@suse.cz>
Thanks,
--
Jiri Kosina
SUSE Labs
^ permalink raw reply
* Re: [PATCH 4/4] PCI: hv: Change pci_protocol_version to per-hbus
From: Lorenzo Pieralisi @ 2019-09-26 16:28 UTC (permalink / raw)
To: Dexuan Cui
Cc: KY Srinivasan, Haiyang Zhang, Stephen Hemminger,
sashal@kernel.org, bhelgaas@google.com,
linux-hyperv@vger.kernel.org, linux-pci@vger.kernel.org,
linux-kernel@vger.kernel.org, Michael Kelley
In-Reply-To: <1568245086-70601-5-git-send-email-decui@microsoft.com>
On Wed, Sep 11, 2019 at 11:38:23PM +0000, Dexuan Cui wrote:
> A VM can have multiple hbus. It looks incorrect for the second hbus's
> hv_pci_protocol_negotiation() to set the global variable
> 'pci_protocol_version' (which was set by the first hbus), even if the
> same value is written.
>
> Signed-off-by: Dexuan Cui <decui@microsoft.com>
> ---
> drivers/pci/controller/pci-hyperv.c | 22 ++++++++++------------
> 1 file changed, 10 insertions(+), 12 deletions(-)
This is a fix that seems unrelated to the rest of the series.
AFAICS the version also affects code paths in the driver, which
means that in case you have busses with different versions the
current code is wrong in this respect.
You have to capture this concept in the commit log, it reads as
an optional change but it looks like a potential bug.
Lorenzo
> diff --git a/drivers/pci/controller/pci-hyperv.c b/drivers/pci/controller/pci-hyperv.c
> index 2655df2..55730c5 100644
> --- a/drivers/pci/controller/pci-hyperv.c
> +++ b/drivers/pci/controller/pci-hyperv.c
> @@ -76,11 +76,6 @@ enum pci_protocol_version_t {
> PCI_PROTOCOL_VERSION_1_1,
> };
>
> -/*
> - * Protocol version negotiated by hv_pci_protocol_negotiation().
> - */
> -static enum pci_protocol_version_t pci_protocol_version;
> -
> #define PCI_CONFIG_MMIO_LENGTH 0x2000
> #define CFG_PAGE_OFFSET 0x1000
> #define CFG_PAGE_SIZE (PCI_CONFIG_MMIO_LENGTH - CFG_PAGE_OFFSET)
> @@ -429,6 +424,8 @@ enum hv_pcibus_state {
>
> struct hv_pcibus_device {
> struct pci_sysdata sysdata;
> + /* Protocol version negotiated with the host */
> + enum pci_protocol_version_t protocol_version;
> enum hv_pcibus_state state;
> refcount_t remove_lock;
> struct hv_device *hdev;
> @@ -942,7 +939,7 @@ static void hv_irq_unmask(struct irq_data *data)
> * negative effect (yet?).
> */
>
> - if (pci_protocol_version >= PCI_PROTOCOL_VERSION_1_2) {
> + if (hbus->protocol_version >= PCI_PROTOCOL_VERSION_1_2) {
> /*
> * PCI_PROTOCOL_VERSION_1_2 supports the VP_SET version of the
> * HVCALL_RETARGET_INTERRUPT hypercall, which also coincides
> @@ -1112,7 +1109,7 @@ static void hv_compose_msi_msg(struct irq_data *data, struct msi_msg *msg)
> ctxt.pci_pkt.completion_func = hv_pci_compose_compl;
> ctxt.pci_pkt.compl_ctxt = ∁
>
> - switch (pci_protocol_version) {
> + switch (hbus->protocol_version) {
> case PCI_PROTOCOL_VERSION_1_1:
> size = hv_compose_msi_req_v1(&ctxt.int_pkts.v1,
> dest,
> @@ -2116,6 +2113,7 @@ static int hv_pci_protocol_negotiation(struct hv_device *hdev,
> enum pci_protocol_version_t version[],
> int num_version)
> {
> + struct hv_pcibus_device *hbus = hv_get_drvdata(hdev);
> struct pci_version_request *version_req;
> struct hv_pci_compl comp_pkt;
> struct pci_packet *pkt;
> @@ -2155,10 +2153,10 @@ static int hv_pci_protocol_negotiation(struct hv_device *hdev,
> }
>
> if (comp_pkt.completion_status >= 0) {
> - pci_protocol_version = version[i];
> + hbus->protocol_version = version[i];
> dev_info(&hdev->device,
> "PCI VMBus probing: Using version %#x\n",
> - pci_protocol_version);
> + hbus->protocol_version);
> goto exit;
> }
>
> @@ -2442,7 +2440,7 @@ static int hv_send_resources_allocated(struct hv_device *hdev)
> u32 wslot;
> int ret;
>
> - size_res = (pci_protocol_version < PCI_PROTOCOL_VERSION_1_2)
> + size_res = (hbus->protocol_version < PCI_PROTOCOL_VERSION_1_2)
> ? sizeof(*res_assigned) : sizeof(*res_assigned2);
>
> pkt = kmalloc(sizeof(*pkt) + size_res, GFP_KERNEL);
> @@ -2461,7 +2459,7 @@ static int hv_send_resources_allocated(struct hv_device *hdev)
> pkt->completion_func = hv_pci_generic_compl;
> pkt->compl_ctxt = &comp_pkt;
>
> - if (pci_protocol_version < PCI_PROTOCOL_VERSION_1_2) {
> + if (hbus->protocol_version < PCI_PROTOCOL_VERSION_1_2) {
> res_assigned =
> (struct pci_resources_assigned *)&pkt->message;
> res_assigned->message_type.type =
> @@ -2812,7 +2810,7 @@ static int hv_pci_resume(struct hv_device *hdev)
> return ret;
>
> /* Only use the version that was in use before hibernation. */
> - version[0] = pci_protocol_version;
> + version[0] = hbus->protocol_version;
> ret = hv_pci_protocol_negotiation(hdev, version, 1);
> if (ret)
> goto out;
> --
> 1.8.3.1
>
^ permalink raw reply
* Re: [PATCH 2/4] PCI: hv: Add the support of hibernation
From: Lorenzo Pieralisi @ 2019-09-26 16:30 UTC (permalink / raw)
To: Dexuan Cui
Cc: KY Srinivasan, Haiyang Zhang, Stephen Hemminger,
sashal@kernel.org, bhelgaas@google.com,
linux-hyperv@vger.kernel.org, linux-pci@vger.kernel.org,
linux-kernel@vger.kernel.org, Michael Kelley
In-Reply-To: <1568245086-70601-3-git-send-email-decui@microsoft.com>
On Wed, Sep 11, 2019 at 11:38:20PM +0000, Dexuan Cui wrote:
> Implement the suspend/resume callbacks for hibernation.
>
> hv_pci_suspend() needs to prevent any new work from being queued: a later
> patch will address this issue.
I don't see why you have two separate patches, the second one fixing the
previous (this one). Squash them together and merge them as such, or
there is something I am missing here.
Lorenzo
> Signed-off-by: Dexuan Cui <decui@microsoft.com>
> ---
> drivers/pci/controller/pci-hyperv.c | 76 +++++++++++++++++++++++++++++++++++++
> 1 file changed, 76 insertions(+)
>
> diff --git a/drivers/pci/controller/pci-hyperv.c b/drivers/pci/controller/pci-hyperv.c
> index 03fa039..3b77a3a 100644
> --- a/drivers/pci/controller/pci-hyperv.c
> +++ b/drivers/pci/controller/pci-hyperv.c
> @@ -1398,6 +1398,23 @@ static void prepopulate_bars(struct hv_pcibus_device *hbus)
>
> spin_lock_irqsave(&hbus->device_list_lock, flags);
>
> + /*
> + * Clear the memory enable bit, in case it's already set. This occurs
> + * in the suspend path of hibernation, where the device is suspended,
> + * resumed and suspended again: see hibernation_snapshot() and
> + * hibernation_platform_enter().
> + *
> + * If the memory enable bit is already set, Hyper-V sliently ignores
> + * the below BAR updates, and the related PCI device driver can not
> + * work, because reading from the device register(s) always returns
> + * 0xFFFFFFFF.
> + */
> + list_for_each_entry(hpdev, &hbus->children, list_entry) {
> + _hv_pcifront_read_config(hpdev, PCI_COMMAND, 2, &command);
> + command &= ~PCI_COMMAND_MEMORY;
> + _hv_pcifront_write_config(hpdev, PCI_COMMAND, 2, command);
> + }
> +
> /* Pick addresses for the BARs. */
> do {
> list_for_each_entry(hpdev, &hbus->children, list_entry) {
> @@ -2737,6 +2754,63 @@ static int hv_pci_remove(struct hv_device *hdev)
> return ret;
> }
>
> +static int hv_pci_suspend(struct hv_device *hdev)
> +{
> + struct hv_pcibus_device *hbus = hv_get_drvdata(hdev);
> + int ret;
> +
> + /* XXX: Need to prevent any new work from being queued. */
> + flush_workqueue(hbus->wq);
> +
> + ret = hv_pci_bus_exit(hdev, true);
> + if (ret)
> + return ret;
> +
> + vmbus_close(hdev->channel);
> +
> + return 0;
> +}
> +
> +static int hv_pci_resume(struct hv_device *hdev)
> +{
> + struct hv_pcibus_device *hbus = hv_get_drvdata(hdev);
> + enum pci_protocol_version_t version[1];
> + int ret;
> +
> + hbus->state = hv_pcibus_init;
> +
> + ret = vmbus_open(hdev->channel, pci_ring_size, pci_ring_size, NULL, 0,
> + hv_pci_onchannelcallback, hbus);
> + if (ret)
> + return ret;
> +
> + /* Only use the version that was in use before hibernation. */
> + version[0] = pci_protocol_version;
> + ret = hv_pci_protocol_negotiation(hdev, version, 1);
> + if (ret)
> + goto out;
> +
> + ret = hv_pci_query_relations(hdev);
> + if (ret)
> + goto out;
> +
> + ret = hv_pci_enter_d0(hdev);
> + if (ret)
> + goto out;
> +
> + ret = hv_send_resources_allocated(hdev);
> + if (ret)
> + goto out;
> +
> + prepopulate_bars(hbus);
> +
> + hbus->state = hv_pcibus_installed;
> + return 0;
> +out:
> + vmbus_close(hdev->channel);
> + return ret;
> +}
> +
> static const struct hv_vmbus_device_id hv_pci_id_table[] = {
> /* PCI Pass-through Class ID */
> /* 44C4F61D-4444-4400-9D52-802E27EDE19F */
> @@ -2751,6 +2825,8 @@ static int hv_pci_remove(struct hv_device *hdev)
> .id_table = hv_pci_id_table,
> .probe = hv_pci_probe,
> .remove = hv_pci_remove,
> + .suspend = hv_pci_suspend,
> + .resume = hv_pci_resume,
> };
>
> static void __exit exit_hv_pci_drv(void)
> --
> 1.8.3.1
>
^ permalink raw reply
* RE: [PATCH] hv_balloon: Add the support of hibernation
From: Dexuan Cui @ 2019-09-26 17:42 UTC (permalink / raw)
To: David Hildenbrand, KY Srinivasan, Haiyang Zhang,
Stephen Hemminger, sashal@kernel.org,
linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org,
Michael Kelley
In-Reply-To: <2134429f-dc6d-06e0-9e4b-9028f62f6666@redhat.com>
> From: David Hildenbrand <david@redhat.com>
> Sent: Thursday, September 26, 2019 12:20 AM
> To: Dexuan Cui <decui@microsoft.com>; KY Srinivasan <kys@microsoft.com>;
> Haiyang Zhang <haiyangz@microsoft.com>; Stephen Hemminger
> <sthemmin@microsoft.com>; sashal@kernel.org;
> linux-hyperv@vger.kernel.org; linux-kernel@vger.kernel.org; Michael Kelley
> <mikelley@microsoft.com>
> Subject: Re: [PATCH] hv_balloon: Add the support of hibernation
>
> On 25.09.19 22:03, Dexuan Cui wrote:
> >> From: linux-hyperv-owner@vger.kernel.org
> >> [... snipped ...]
> >>> Anyhow, just some comments from my side :) I can see how Windows
> Server
> >>> worked around that issue right now by just XOR'ing both features.
> >>>
> >>> David / dhildenb
> >>
> >> Thanks for sharing your thoughts!
> >>
> >> -- Dexuan
> >
> > Hi David,
> > If my explanation sounds good to you, can I have an Acked-by from you?
> >
>
> I do ACK the approach but not the patch in it's current state. I don't
> like the ifdefs - once you can get rid of the ifdefery - e.g., after the
> prerequisite is upstream - you can add my
>
> Acked-by: David Hildenbrand <david@redhat.com>
>
> David / dhildenb
Makes sense. I'll wait for the prerequisite patch (i.e. the patch that implements
hv_is_hibernation_supported(), https://lkml.org/lkml/2019/9/5/1160 ) to be
in upstream first, then I'll be able to get rid of the below "if 0" and post a v2
with your Acked-by. Thanks, David!
+#if 0
+ /*
+ * The patch to implement hv_is_hibernation_supported() is going
+ * through the tip tree. For now, let's hardcode allow_hibernation
+ * to false to keep the current behavior of hv_balloon. If people
+ * want to test hibernation, please blacklist hv_balloon fow now
+ * or do not enable Dynamid Memory and Memory Resizing.
+ *
+ * We'll remove the conditional compilation as soon as
+ * hv_is_hibernation_supported() is available in the mainline tree.
+ */
+ allow_hibernation = hv_is_hibernation_supported();
+#else
+ allow_hibernation = false;
Thanks,
-- Dexuan
^ permalink raw reply
* Re: [PATCH v3 02/26] PCI: hv: Use PCI_STD_NUM_BARS
From: Bjorn Helgaas @ 2019-09-26 22:05 UTC (permalink / raw)
To: Denis Efremov
Cc: linux-kernel, linux-pci, Andrew Murray, linux-hyperv,
K. Y. Srinivasan, Haiyang Zhang, Stephen Hemminger, Sasha Levin
In-Reply-To: <20190916204158.6889-3-efremov@linux.com>
On Mon, Sep 16, 2019 at 11:41:34PM +0300, Denis Efremov wrote:
> Replace the magic constant (6) with define PCI_STD_NUM_BARS representing
> the number of PCI BARs.
For some reason patches 0 and 1 didn't make it to the list. Can you
resend them?
^ permalink raw reply
* Re: [PATCH v2][PATCH net] hv_netvsc: Add the support of hibernation
From: kbuild test robot @ 2019-09-27 4:17 UTC (permalink / raw)
To: Dexuan Cui
Cc: kbuild-all, KY Srinivasan, Haiyang Zhang, Stephen Hemminger,
sashal@kernel.org, davem@davemloft.net,
linux-hyperv@vger.kernel.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, Michael Kelley, Dexuan Cui
In-Reply-To: <1569449034-29924-1-git-send-email-decui@microsoft.com>
[-- Attachment #1: Type: text/plain, Size: 2030 bytes --]
Hi Dexuan,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on net/master]
url: https://github.com/0day-ci/linux/commits/Dexuan-Cui/hv_netvsc-Add-the-support-of-hibernation/20190926-061258
config: x86_64-rhel-7.6 (attached as .config)
compiler: gcc-7 (Debian 7.4.0-13) 7.4.0
reproduce:
# save the attached .config to linux build tree
make ARCH=x86_64
If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>
All error/warnings (new ones prefixed by >>):
>> drivers/net/hyperv/netvsc_drv.c:2486:3: error: 'struct hv_driver' has no member named 'suspend'
.suspend = netvsc_suspend,
^~~~~~~
>> drivers/net/hyperv/netvsc_drv.c:2486:13: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types]
.suspend = netvsc_suspend,
^~~~~~~~~~~~~~
drivers/net/hyperv/netvsc_drv.c:2486:13: note: (near initialization for 'netvsc_drv.shutdown')
>> drivers/net/hyperv/netvsc_drv.c:2487:3: error: 'struct hv_driver' has no member named 'resume'; did you mean 'remove'?
.resume = netvsc_resume,
^~~~~~
remove
>> drivers/net/hyperv/netvsc_drv.c:2487:12: warning: excess elements in struct initializer
.resume = netvsc_resume,
^~~~~~~~~~~~~
drivers/net/hyperv/netvsc_drv.c:2487:12: note: (near initialization for 'netvsc_drv')
cc1: some warnings being treated as errors
vim +2486 drivers/net/hyperv/netvsc_drv.c
2479
2480 /* The one and only one */
2481 static struct hv_driver netvsc_drv = {
2482 .name = KBUILD_MODNAME,
2483 .id_table = id_table,
2484 .probe = netvsc_probe,
2485 .remove = netvsc_remove,
> 2486 .suspend = netvsc_suspend,
> 2487 .resume = netvsc_resume,
2488 .driver = {
2489 .probe_type = PROBE_FORCE_SYNCHRONOUS,
2490 },
2491 };
2492
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 48169 bytes --]
^ permalink raw reply
* Re: [PATCH v2] hv_sock: Add the support of hibernation
From: kbuild test robot @ 2019-09-27 4:18 UTC (permalink / raw)
To: Dexuan Cui
Cc: kbuild-all, KY Srinivasan, Haiyang Zhang, Stephen Hemminger,
sashal@kernel.org, davem@davemloft.net,
linux-hyperv@vger.kernel.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, Michael Kelley, Dexuan Cui
In-Reply-To: <1569447243-27433-1-git-send-email-decui@microsoft.com>
[-- Attachment #1: Type: text/plain, Size: 2189 bytes --]
Hi Dexuan,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on net-next/master]
[cannot apply to v5.3 next-20190925]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]
url: https://github.com/0day-ci/linux/commits/Dexuan-Cui/hv_sock-Add-the-support-of-hibernation/20190926-053950
config: x86_64-rhel-7.6 (attached as .config)
compiler: gcc-7 (Debian 7.4.0-13) 7.4.0
reproduce:
# save the attached .config to linux build tree
make ARCH=x86_64
If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>
All error/warnings (new ones prefixed by >>):
>> net//vmw_vsock/hyperv_transport.c:970:3: error: 'struct hv_driver' has no member named 'suspend'
.suspend = hvs_suspend,
^~~~~~~
>> net//vmw_vsock/hyperv_transport.c:970:13: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types]
.suspend = hvs_suspend,
^~~~~~~~~~~
net//vmw_vsock/hyperv_transport.c:970:13: note: (near initialization for 'hvs_drv.shutdown')
>> net//vmw_vsock/hyperv_transport.c:971:3: error: 'struct hv_driver' has no member named 'resume'; did you mean 'remove'?
.resume = hvs_resume,
^~~~~~
remove
>> net//vmw_vsock/hyperv_transport.c:971:13: warning: excess elements in struct initializer
.resume = hvs_resume,
^~~~~~~~~~
net//vmw_vsock/hyperv_transport.c:971:13: note: (near initialization for 'hvs_drv')
cc1: some warnings being treated as errors
vim +970 net//vmw_vsock/hyperv_transport.c
963
964 static struct hv_driver hvs_drv = {
965 .name = "hv_sock",
966 .hvsock = true,
967 .id_table = id_table,
968 .probe = hvs_probe,
969 .remove = hvs_remove,
> 970 .suspend = hvs_suspend,
> 971 .resume = hvs_resume,
972 };
973
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 48067 bytes --]
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox