[PATCH v3] x86/apic/flat64: Add back the early_param("apic", parse_apic)

2020-05-31 Thread Dexuan Cui
e hv_apic_init(). The patch adds the __init tag for flat_acpi_madt_oem_check() and physflat_acpi_madt_oem_check() to avoid a warning seen with "make W=1": flat_acpi_madt_oem_check() accesses cmdline_apic, which has a __initdata tag. Fixes: 7b38725318f4 ("x86: remove subarchi

RE: [PATCH] x86/apic/flat64: Add back the early_param("apic", parse_apic)

2020-05-30 Thread Dexuan Cui
> From: Randy Dunlap > Sent: Friday, May 29, 2020 6:33 AM > Hi, > Looks like you will also need to update > Documentation/admin-guide/kernel-parameters.txt, where it says: > > For X86-32, this can also be used to specify an APIC > driver name. > -- > ~R

[PATCH v2] x86/apic/flat64: Add back the early_param("apic", parse_apic)

2020-05-30 Thread Dexuan Cui
driver to apic_x2apic_phys, even if an early_param "apic=physical flat" is specified. On Hyper-V, when a Linux VM has <= 8 virtual CPUs, if we use "apic=physical flat", sending IPIs to multiple vCPUs is still fast because Linux VM uses the para-virtualized IPI hypercalls: see

[PATCH] x86/apic/flat64: Add back the early_param("apic", parse_apic)

2020-05-28 Thread Dexuan Cui
, before the fix to Hyper-V becomes widely available. IMHO the patch is safe because the current default algorithm to choose the apic driver is unchanged; the patch makes a difference only when the user specifies the apic= kernel parameter, e.g. "apic=physical flat". Signed-off-by: De

RE: [PATCH] x86/hyperv: Properly suspend/resume reenlightenment notifications

2020-05-12 Thread Dexuan Cui
> From: Vitaly Kuznetsov > Sent: Tuesday, May 12, 2020 9:02 AM > To: linux-hyp...@vger.kernel.org > Cc: Wei Liu ; x...@kernel.org; > linux-kernel@vger.kernel.org; k...@vger.kernel.org; Michael Kelley > ; Dexuan Cui ; Tianyu Lan > > Subject: [PATCH] x86/hyperv:

RE: [PATCH 4.19 11/37] PM: hibernate: Freeze kernel threads in software_resume()

2020-05-05 Thread Dexuan Cui
> From: Pavel Machek > Sent: Tuesday, May 5, 2020 5:10 AM > To: Greg Kroah-Hartman > Cc: linux-kernel@vger.kernel.org; sta...@vger.kernel.org; Dexuan Cui > ; Rafael J. Wysocki > Subject: Re: [PATCH 4.19 11/37] PM: hibernate: Freeze kernel threads in > software_resume() &

RE: [PATCH 1/2] Drivers: hv: vmbus: Introduce table of VMBus protocol versions

2019-10-08 Thread Dexuan Cui
> From: Vitaly Kuznetsov > Sent: Tuesday, October 8, 2019 6:00 AM > ... > > Looking at the uses of VERSION_INVAL, I find one remaining occurrence > > of this macro in vmbus_bus_resume(), which does: > > > > if (vmbus_proto_version == VERSION_INVAL || > > vmbus_proto_version == 0) { >

RE: [PATCH 0/2] Drivers: hv: vmbus: Miscellaneous improvements

2019-10-07 Thread Dexuan Cui
> From: linux-hyperv-ow...@vger.kernel.org > On Behalf Of Andrea Parri > Sent: Monday, October 7, 2019 9:31 AM > > Hi all, > > The patchset: > > - simplifies/refactors the VMBus negotiation code by introducing > the table of VMBus protocol versions (patch 1/2), > > - enables VMBus protocol v

RE: [PATCH 1/2] Drivers: hv: vmbus: Introduce table of VMBus protocol versions

2019-10-07 Thread Dexuan Cui
> From: linux-hyperv-ow...@vger.kernel.org > On Behalf Of Andrea Parri > Sent: Monday, October 7, 2019 9:31 AM > > +/* > + * Table of VMBus versions listed from newest to oldest; the table > + * must terminate with VERSION_INVAL. > + */ > +__u32 vmbus_versions[] = { > + VERSION_WIN10_V5,

RE: [RFC PATCH 00/13] vsock: add multi-transports support

2019-10-03 Thread Dexuan Cui
> From: Stefano Garzarella > Sent: Friday, September 27, 2019 4:27 AM > ... > Patch 9 changes the hvs_remote_addr_init(). setting the > VMADDR_CID_HOST as remote CID instead of VMADDR_CID_ANY to make > the choice of transport to be used work properly. > @Dexuan Could this change break anything?

RE: [RFC PATCH 08/13] vsock: move vsock_insert_unbound() in the vsock_create()

2019-10-03 Thread Dexuan Cui
r to simplify the multi-transports support, this patch > moves vsock_insert_unbound() at the end of vsock_create(). > > Signed-off-by: Stefano Garzarella > --- > net/vmw_vsock/af_vsock.c | 13 + > 1 file changed, 9 insertions(+), 4 deletions(-) > Reviewed-by: Dexuan Cui

RE: [RFC PATCH 07/13] vsock: handle buffer_size sockopts in the core

2019-10-03 Thread Dexuan Cui
-- > net/vmw_vsock/vmci_transport.c | 86 +++-- > net/vmw_vsock/vmci_transport.h | 3 - > 9 files changed, 64 insertions(+), 226 deletions(-) > The hv_sock part (hyperv_transport.c) looks good to me. Acked-by: Dexuan Cui

RE: [RFC PATCH 09/13] hv_sock: set VMADDR_CID_HOST in the hvs_remote_addr_init()

2019-10-03 Thread Dexuan Cui
alizat...@lists.linux-foundation.org; Stephen > Hemminger ; Jason Wang > ; Michael S. Tsirkin ; Haiyang > Zhang ; Dexuan Cui ; > Jorgen Hansen > Subject: [RFC PATCH 09/13] hv_sock: set VMADDR_CID_HOST in the > hvs_remote_addr_init() > > Remote peer is always the host, so we s

RE: [PATCH] Input: hyperv-keyboard: Add the support of hibernation

2019-10-03 Thread Dexuan Cui
> From: dmitry.torok...@gmail.com > Sent: Thursday, October 3, 2019 10:46 AM > > > > I think I understood now: it looks the vmbus driver should implement > > a prepare() or freeze(), which calls the hyperv_keyboard driver's > > prepare() or freeze(), which can set the flag or disable the keyboard

RE: [PATCH] Input: hyperv-keyboard: Add the support of hibernation

2019-10-02 Thread Dexuan Cui
> From: Dexuan Cui > Sent: Wednesday, October 2, 2019 10:35 PM > > ... > > > > ¯\_(ツ)_/¯ If you do not want to implement hibernation properly in vmbus > > code that is totally up to you (have you read in pm.h how freeze() is > > different from suspend()?). >

RE: [PATCH] Input: hyperv-keyboard: Add the support of hibernation

2019-10-02 Thread Dexuan Cui
> From: dmitry.torok...@gmail.com > Sent: Monday, September 30, 2019 4:07 PM > > On Mon, Sep 30, 2019 at 10:09:27PM +0000, Dexuan Cui wrote: > > > From: dmitry.torok...@gmail.com > > > Sent: Friday, September 27, 2019 5:32 PM > > > > ... > > >

RE: [PATCH] Input: hyperv-keyboard: Add the support of hibernation

2019-09-30 Thread Dexuan Cui
> From: dmitry.torok...@gmail.com > Sent: Friday, September 27, 2019 5:32 PM > > ... > > pm_wakeup_pending() is tested in a lot of places in the suspend > > process and eventually an unintentional keystroke (or mouse movement, > > when it comes to the Hyper-V mouse driver drivers/hid/hid-hyperv.c)

RE: [PATCH v5 1/3] x86/hyper-v: Suspend/resume the hypercall page for hibernation

2019-09-30 Thread Dexuan Cui
> From: Vitaly Kuznetsov > Sent: Friday, September 27, 2019 2:05 AM > To: Dexuan Cui > > Dexuan Cui writes: > ... > > So, I'm pretty sure no IPI can happen between hv_suspend() and > hv_resume(). > > self-IPI is not supposed to happen either, since in

[PATCH net v3] vsock: Fix a lockdep warning in __vsock_release()

2019-09-30 Thread Dexuan Cui
xit+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 Tested-by: Stefano Garzarella Signed-off-by: Dexuan Cui --- Changes in v2: Avoid the

RE: [PATCH net v2] vsock: Fix a lockdep warning in __vsock_release()

2019-09-30 Thread Dexuan Cui
> From: Stefano Garzarella > Sent: Monday, September 30, 2019 6:51 AM > ... > Feel free to add: > > Tested-by: Stefano Garzarella Thanks, Stefano! I'll post a v3 with your suggestion "lock_sock_nested(sk, level);". It does look better than v2 to me. :-) Thanks, -- Dexuan

RE: [PATCH] HID: hyperv: Add the support of hibernation

2019-09-29 Thread Dexuan Cui
> From: Sasha Levin > Sent: Friday, September 27, 2019 5:05 AM > To: Dexuan Cui > Cc: Jiri Kosina ; KY Srinivasan ; > Haiyang Zhang ; Stephen Hemminger > ; benjamin.tissoi...@redhat.com; > linux-hyp...@vger.kernel.org; linux-in...@vger.kernel.org; > linux-kernel@vger.ke

RE: [PATCH 4/4] PCI: hv: Change pci_protocol_version to per-hbus

2019-09-27 Thread Dexuan Cui
> From: Lorenzo Pieralisi > Sent: Thursday, September 26, 2019 9:29 AM > > 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 varia

RE: [PATCH 2/4] PCI: hv: Add the support of hibernation

2019-09-27 Thread Dexuan Cui
> From: Lorenzo Pieralisi > Sent: Thursday, September 26, 2019 9:31 AM > > 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

RE: [PATCH v5 1/3] x86/hyper-v: Suspend/resume the hypercall page for hibernation

2019-09-26 Thread Dexuan Cui
> From: Vitaly Kuznetsov > Sent: Thursday, September 26, 2019 3:44 AM > > [...] > > +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); > > + hyp

RE: [PATCH v5 3/3] clocksource/drivers: Suspend/resume Hyper-V clocksource for hibernation

2019-09-26 Thread Dexuan Cui
> From: Daniel Lezcano > Sent: Thursday, September 26, 2019 6:17 AM > >> > >> 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

RE: [PATCH] HID: hyperv: Add the support of hibernation

2019-09-26 Thread Dexuan Cui
> From: Jiri Kosina > Sent: Thursday, September 26, 2019 6:23 AM > To: Dexuan Cui > > On Thu, 26 Sep 2019, Jiri Kosina wrote: > > > > > This patch is basically a pure Hyper-V specific change and it has a > > > > build dependency on th

RE: [PATCH net v2] vsock: Fix a lockdep warning in __vsock_release()

2019-09-26 Thread Dexuan Cui
> From: linux-hyperv-ow...@vger.kernel.org > On Behalf Of Stefano Garzarella > Sent: Thursday, September 26, 2019 12:48 AM > > Hi Dexuan, > > On Thu, Sep 26, 2019 at 01:11:27AM +, Dexuan Cui wrote: > > ... > > NOTE: I only tested the code on Hyper-V. I can

RE: [PATCH v2] hv_sock: Add the support of hibernation

2019-09-26 Thread Dexuan Cui
> From: linux-hyperv-ow...@vger.kernel.org > On Behalf Of kbuild test robot > Sent: Thursday, September 26, 2019 9:19 PM > > Hi Dexuan, > > Thank you for the patch! Yet something to improve: > > >> net//vmw_vsock/hyperv_transport.c:970:3: error: 'struct hv_driver' has no > member named 'suspend

RE: [PATCH v2][PATCH net] hv_netvsc: Add the support of hibernation

2019-09-26 Thread Dexuan Cui
> From: linux-hyperv-ow...@vger.kernel.org > On Behalf Of kbuild test robot > Sent: Thursday, September 26, 2019 9:18 PM > > Hi Dexuan, > > Thank you for the patch! Yet something to improve: > > [auto build test ERROR on net/master] > > 'netvsc_drv.shutdown') > >> drivers/net/hyperv/netvsc_drv

RE: [PATCH] hv_balloon: Add the support of hibernation

2019-09-26 Thread Dexuan Cui
> From: David Hildenbrand > Sent: Thursday, September 26, 2019 12:20 AM > To: Dexuan Cui ; KY Srinivasan ; > Haiyang Zhang ; Stephen Hemminger > ; sas...@kernel.org; > linux-hyp...@vger.kernel.org; linux-kernel@vger.kernel.org; Michael Kelley > > Subject: Re: [PATCH] hv_

[PATCH net v2] vsock: Fix a lockdep warning in __vsock_release()

2019-09-25 Thread Dexuan Cui
xit+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 --- NOTE: I only tested the code on Hyper-V. I can not test the

RE: [PATCH] vsock: Fix a lockdep warning in __vsock_release()

2019-09-25 Thread Dexuan Cui
> From: Stefano Garzarella > 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); > > bo

RE: [PATCH v5 3/3] clocksource/drivers: Suspend/resume Hyper-V clocksource for hibernation

2019-09-25 Thread Dexuan Cui
> From: Daniel Lezcano > Sent: Wednesday, September 25, 2019 4:21 PM > To: Dexuan Cui ; a...@arndb.de; b...@alien8.de; > Haiyang Zhang ; h...@zytor.com; KY Srinivasan > ; linux-hyp...@vger.kernel.org; > linux-kernel@vger.kernel.org; mi...@redhat.com; sas...@kernel.org; Steph

[PATCH][RESEND] clocksource/drivers: hyperv_timer: Fix CPU offlining by unbinding the timer

2019-09-25 Thread Dexuan Cui
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")

RE: [PATCH v5 0/3] Enhance Hyper-V for hibernation

2019-09-25 Thread Dexuan Cui
> From: Dexuan Cui > 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, be

RE: [PATCH v2] scsi: storvsc: Add the support of hibernation

2019-09-25 Thread Dexuan Cui
> From: kbuild test robot > Sent: Wednesday, September 25, 2019 2:55 PM > To: Dexuan Cui > Cc: kbuild-...@01.org; KY Srinivasan ; Haiyang Zhang > ; Stephen Hemminger > ; sas...@kernel.org; j...@linux.ibm.com; > martin.peter...@oracle.com; linux-hyp...@vger.

[PATCH v2][PATCH net] hv_netvsc: Add the support of hibernation

2019-09-25 Thread Dexuan Cui
The existing netvsc_detach() and netvsc_attach() APIs make it easy to implement the suspend/resume callbacks. Signed-off-by: Dexuan Cui --- 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. Sa

[PATCH v2] hv_sock: Add the support of hibernation

2019-09-25 Thread Dexuan Cui
Add the necessary dummy callbacks for hibernation. Signed-off-by: Dexuan Cui Acked-by: David S. Miller --- 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

[PATCH v2] scsi: storvsc: Add the support of hibernation

2019-09-25 Thread 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 Acked-by: Martin K. Petersen

RE: [PATCH] hv_balloon: Add the support of hibernation

2019-09-25 Thread Dexuan Cui
> From: linux-hyperv-ow...@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,

RE: [PATCH 0/4] Enhance pci-hyperv to support hibernation

2019-09-25 Thread Dexuan Cui
> From: Dexuan Cui > Sent: Wednesday, September 11, 2019 4:38 PM > To: KY Srinivasan ; Haiyang Zhang > ; Stephen Hemminger > ; sas...@kernel.org; lorenzo.pieral...@arm.com; > bhelg...@google.com; linux-hyp...@vger.kernel.org; > linux-...@vger.kernel.org; linux-kernel@vge

RE: [PATCH] HID: hyperv: Add the support of hibernation

2019-09-25 Thread Dexuan Cui
> From: Dexuan Cui > Sent: Wednesday, September 11, 2019 4:36 PM > > 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 b

RE: [PATCH] Input: hyperv-keyboard: Add the support of hibernation

2019-09-25 Thread Dexuan Cui
> From: linux-hyperv-ow...@vger.kernel.org > On Behalf Of Dexuan Cui > Sent: Friday, September 20, 2019 11:56 PM > To: dmitry.torok...@gmail.com > Cc: KY Srinivasan ; Haiyang Zhang > ; Stephen Hemminger > ; sas...@kernel.org; > linux-hyp...@vger.kernel.org; linux-in...@

[PATCH v3] Drivers: hv: vmbus: Fix harmless building warnings without CONFIG_PM_SLEEP

2019-09-25 Thread Dexuan Cui
ation") Fixes: f53335e3289f ("Drivers: hv: vmbus: Suspend/resume the vmbus itself for hibernation") Reported-by: Arnd Bergmann Reviewed-by: Michael Kelley Signed-off-by: Dexuan Cui --- In v2: test CONFIG_PM_SLEEP rather than CONFIG_PM. Thanks, Arnd! In v3: Add M

RE: [PATCH 1/3] hv_utils: Add the support of hibernation

2019-09-21 Thread Dexuan Cui
> From: Vitaly Kuznetsov > Sent: Thursday, September 19, 2019 3:28 AM > > Dexuan Cui writes: > > > BTW, for vss, maybe the VM should not hibernate if there is a backup > > ongoing? -- if the file system is frozen by hv_vss_daemon, and the VM > > hibernates, th

RE: [PATCH] Input: hyperv-keyboard: Add the support of hibernation

2019-09-20 Thread Dexuan Cui
> From: dmitry.torok...@gmail.com > Sent: Thursday, September 19, 2019 9:18 AM > > Hi Dexuan, > > On Wed, Sep 11, 2019 at 11:36:20PM +, Dexuan Cui wrote: > > We need hv_kbd_pm_notify() to make sure the pm_wakeup_hard_event() > call > > does not prevent the

RE: [PATCH] Drivers: hv: vmbus: Fix harmless building warnings without CONFIG_PM

2019-09-20 Thread Dexuan Cui
> From: Arnd Bergmann > Sent: Friday, September 20, 2019 12:33 AM > On Thu, Sep 19, 2019 at 11:38 PM Dexuan Cui wrote: > > > Sent: Thursday, September 19, 2019 5:11 AM > > > On Thu, Sep 19, 2019 at 7:19 AM Dexuan Cui > wrote: > > > > I think this wi

[PATCH v2] Drivers: hv: vmbus: Fix harmless building warnings without CONFIG_PM_SLEEP

2019-09-19 Thread Dexuan Cui
ation") Fixes: f53335e3289f ("Drivers: hv: vmbus: Suspend/resume the vmbus itself for hibernation") Reported-by: Arnd Bergmann Signed-off-by: Dexuan Cui --- In v2: test CONFIG_PM_SLEEP rather than CONFIG_PM. Thanks, Arnd! drivers/hv/vmbus_drv.c | 6 ++ 1 file c

RE: [PATCH] Drivers: hv: vmbus: Fix harmless building warnings without CONFIG_PM

2019-09-19 Thread Dexuan Cui
> Sent: Thursday, September 19, 2019 5:11 AM > On Thu, Sep 19, 2019 at 7:19 AM Dexuan Cui wrote: > > > > If CONFIG_PM is not set, we can comment out these functions to avoid the > > below warnings: > > > > drivers/hv/vmbus_drv.c:2208:12: warning: ‘vmbu

RE: [PATCH 1/3] hv_utils: Add the support of hibernation

2019-09-18 Thread Dexuan Cui
> From: Vitaly Kuznetsov > Sent: Monday, September 16, 2019 1:46 AM > Dexuan Cui writes: > > >> From: Vitaly Kuznetsov > >> Sent: Thursday, September 12, 2019 9:37 AM > > > >> > +static int util_suspend(struct hv_device *dev) >

[PATCH] Drivers: hv: vmbus: Fix harmless building warnings without CONFIG_PM

2019-09-18 Thread Dexuan Cui
ot;) Fixes: f53335e3289f ("Drivers: hv: vmbus: Suspend/resume the vmbus itself for hibernation") Reported-by: Arnd Bergmann Signed-off-by: Dexuan Cui --- drivers/hv/vmbus_drv.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.

RE: [PATCH] hv: vmbus: mark PM functions as __maybe_unused

2019-09-18 Thread Dexuan Cui
> From: Arnd Bergmann > Sent: Wednesday, September 18, 2019 1:01 PM > > When CONFIG_PM is disabled, we get a couple of harmless warnings: > > drivers/hv/vmbus_drv.c:918:12: error: unused function 'vmbus_suspend' > [-Werror,-Wunused-function] > drivers/hv/vmbus_drv.c:937:12: error: unused functio

RE: [PATCH] hv_balloon: Add the support of hibernation

2019-09-13 Thread Dexuan Cui
> From: David Hildenbrand > Sent: Friday, September 13, 2019 2:44 PM > > > On recent Windows Server 2019+ hosts, the toolstacks on the hosts > > guarantees that Dynamic Memory and Memory Resizing can not be enabled > > if the virtual ACPI S4 state is enabled, and vice versa. Please refer to the >

RE: [PATCH] hv_balloon: Add the support of hibernation

2019-09-13 Thread Dexuan Cui
> From: David Hildenbrand > Sent: Friday, September 13, 2019 12:46 AM > > On 12.09.19 21:18, Dexuan Cui wrote: > > 3. Hibernation can be especially useful when we pass through a PCIe device, > > e.g. a NIC, a NVMe controller or a GPU, to the VM, as usually save/restore &g

RE: [PATCH][PATCH net-next] hv_sock: Add the support of hibernation

2019-09-13 Thread Dexuan Cui
> From: David Miller > Sent: Friday, September 13, 2019 1:04 PM > > From: Dexuan Cui > Date: Wed, 11 Sep 2019 23:37:27 + > > I request this patch should go through Sasha's tree rather than the > > net-next tree. > > That's fine: > > Acke

RE: [PATCH 1/3] hv_utils: Add the support of hibernation

2019-09-13 Thread Dexuan Cui
> From: Vitaly Kuznetsov > Sent: Thursday, September 12, 2019 9:37 AM > > +static int util_suspend(struct hv_device *dev) > > +{ > > + struct hv_util_service *srv = hv_get_drvdata(dev); > > + > > + if (srv->util_cancel_work) > > + srv->util_cancel_work(); > > + > > + vmbus_close(d

RE: [PATCH 2/3] hv_utils: Support host-initiated hibernation request

2019-09-13 Thread Dexuan Cui
> From: Vitaly Kuznetsov > Sent: Thursday, September 12, 2019 9:27 AM > > Dexuan Cui writes: > > > +static void perform_hibernation(struct work_struct *dummy) > > +{ > > + /* > > +* The user is expected to create the program, which can be a simple

RE: [PATCH] scsi: storvsc: Add the support of hibernation

2019-09-12 Thread Dexuan Cui
> From: linux-scsi-ow...@vger.kernel.org > On Behalf Of kbuild test robot > Sent: Thursday, September 12, 2019 1:54 PM > To: Dexuan Cui > Cc: kbuild-...@01.org; KY Srinivasan ; Haiyang Zhang > ; Stephen Hemminger > ; sas...@kernel.org; j...@linux.ibm.com; > martin.peter.

RE: [PATCH][PATCH net-next] hv_netvsc: Add the support of hibernation

2019-09-12 Thread Dexuan Cui
> From: Haiyang Zhang > Sent: Thursday, September 12, 2019 6:50 AM > > -Original Message- > > From: Dexuan Cui > > Sent: Wednesday, September 11, 2019 7:38 PM > > +static int netvsc_suspend(struct hv_device *dev) > > +{ > > + struct ne

RE: [PATCH] hv_balloon: Add the support of hibernation

2019-09-12 Thread Dexuan Cui
> From: David Hildenbrand > Sent: Thursday, September 12, 2019 3:09 AM > On 12.09.19 01:36, Dexuan Cui wrote: > > When hibernation is enabled, we must ignore the balloon up/down and > > hot-add requests from the host, if any. > > Why do you even care about supporting

[PATCH 2/3] hv_utils: Support host-initiated hibernation request

2019-09-11 Thread Dexuan Cui
cat /sbin/hyperv-hibernate #!/bin/bash echo disk > /sys/power/state Signed-off-by: Dexuan Cui --- drivers/hv/hv_util.c | 66 +++- 1 file changed, 65 insertions(+), 1 deletion(-) diff --git a/drivers/hv/hv_util.c b/drivers/hv/hv_util.c index 039

[PATCH 1/3] hv_utils: Add the support of hibernation

2019-09-11 Thread Dexuan Cui
On hibernation, Linux can not guarantee the host side utils operations still succeed without any issue, so let's simply cancel the work items. The host is supposed to retry the operations, if necessary. Signed-off-by: Dexuan Cui --- drivers/hv/hv_fcopy.c | 9 - drivers/hv/hv_

[PATCH 3/3] hv_utils: Support host-initiated restart request

2019-09-11 Thread Dexuan Cui
To test the code, we should run this command on the host: Restart-VM $vm -Type Reboot Signed-off-by: Dexuan Cui --- drivers/hv/hv_util.c | 23 ++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/drivers/hv/hv_util.c b/drivers/hv/hv_util.c index 9e98c5d

[PATCH 0/3] Enhance hv_utils to support hibernation

2019-09-11 Thread Dexuan Cui
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 char-misc tree. Dexuan Cui (3): hv_utils: Add the support of hibernation hv_utils: Support host-initiated hibernation request hv_utils: Support host-

[PATCH 4/4] PCI: hv: Change pci_protocol_version to per-hbus

2019-09-11 Thread Dexuan Cui
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 --- drivers/pci/controller/pc

[PATCH 0/4] Enhance pci-hyperv to support hibernation

2019-09-11 Thread Dexuan Cui
el.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 pci tree. Dexuan Cui (4): PCI: hv: Reorganize the code in preparation of hibernation PCI: hv: Add the support of hibernation PCI: hv: Do not queue new

[PATCH 1/4] PCI: hv: Reorganize the code in preparation of hibernation

2019-09-11 Thread Dexuan Cui
There is no functional change. This is just preparatory to a later patch which adds the hibernation support for the pci-hyperv driver. Signed-off-by: Dexuan Cui --- drivers/pci/controller/pci-hyperv.c | 43 - 1 file changed, 28 insertions(+), 15 deletions

[PATCH 3/4] PCI: hv: Do not queue new work items on hibernation

2019-09-11 Thread Dexuan Cui
We must make sure there is no pending work items before we call vmbus_close(). Signed-off-by: Dexuan Cui --- drivers/pci/controller/pci-hyperv.c | 33 ++--- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/drivers/pci/controller/pci-hyperv.c b/drivers

[PATCH 2/4] PCI: hv: Add the support of hibernation

2019-09-11 Thread Dexuan Cui
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. Signed-off-by: Dexuan Cui --- drivers/pci/controller/pci-hyperv.c | 76 + 1 file changed, 76

[PATCH][PATCH net-next] hv_sock: Add the support of hibernation

2019-09-11 Thread Dexuan Cui
Add the necessary dummy callbacks for hibernation. Signed-off-by: Dexuan Cui --- 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 i

[PATCH][PATCH net-next] hv_netvsc: Add the support of hibernation

2019-09-11 Thread Dexuan Cui
The existing netvsc_detach() and netvsc_attach() APIs make it easy to implement the suspend/resume callbacks. Signed-off-by: Dexuan Cui --- This patch is basically a pure Hyper-V specific change and it has a build dependency on the commit 271b2224d42f ("Drivers: hv: vmbus: Implement su

[PATCH] hv_balloon: Add the support of hibernation

2019-09-11 Thread Dexuan Cui
-by: Dexuan Cui --- 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: ht

[PATCH] Input: hyperv-keyboard: Add the support of hibernation

2019-09-11 Thread Dexuan Cui
We need hv_kbd_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 keyboard events. Signed-off-by: Dexuan Cui

[PATCH] HID: hyperv: Add the support of hibernation

2019-09-11 Thread Dexuan Cui
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

[PATCH] scsi: storvsc: Add the support of hibernation

2019-09-11 Thread 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 --- This patch is basicall

RE: [PATCH v5 0/9] Enhance the hv_vmbus driver to support hibernation

2019-09-08 Thread Dexuan Cui
> From: Sasha Levin > Sent: Sunday, September 8, 2019 5:13 AM > On Fri, Sep 06, 2019 at 10:45:31PM +0000, Dexuan Cui wrote: > >> From: Sasha Levin > >> Sent: Friday, September 6, 2019 1:03 PM > >> On Thu, Sep 05, 2019 at 11:01:14PM +, Dexuan Cui wrote:

RE: [PATCH v5 0/9] Enhance the hv_vmbus driver to support hibernation

2019-09-06 Thread Dexuan Cui
> From: Sasha Levin > Sent: Friday, September 6, 2019 1:03 PM > On Thu, Sep 05, 2019 at 11:01:14PM +0000, Dexuan Cui wrote: > >This patchset (consisting of 9 patches) was part of the v4 patchset > >(consisting > >of 12 patches): > > > >The other 3 patch

[tip: irq/core] irqdomain: Add the missing assignment of domain->fwnode for named fwnode

2019-09-06 Thread tip-bot2 for Dexuan Cui
The following commit has been merged into the irq/core branch of tip: Commit-ID: 711419e504ebd68c8f03656616829c8ad7829389 Gitweb: https://git.kernel.org/tip/711419e504ebd68c8f03656616829c8ad7829389 Author:Dexuan Cui AuthorDate:Mon, 02 Sep 2019 23:14:56 Committer

[PATCH v5 3/9] Drivers: hv: vmbus: Add a helper function is_sub_channel()

2019-09-05 Thread Dexuan Cui
The existing method of telling if a channel is sub-channel in vmbus_process_offer() is cumbersome. This new simple helper function is preferred in future. Signed-off-by: Dexuan Cui Reviewed-by: Michael Kelley --- include/linux/hyperv.h | 10 +- 1 file changed, 9 insertions(+), 1

[PATCH v5 5/9] Drivers: hv: vmbus: Ignore the offers when resuming from hibernation

2019-09-05 Thread Dexuan Cui
vmbus device's RELID sometimes can change. A later patch will address this issue by mapping the new offers to the old channels and fixing up the old channels, if necessary. Signed-off-by: Dexuan Cui Reviewed-by: Michael Kelley --- drivers/hv/channel_m

[PATCH v5 8/9] Drivers: hv: vmbus: Suspend after cleaning up hv_sock and sub channels

2019-09-05 Thread Dexuan Cui
zero. Signed-off-by: Dexuan Cui Reviewed-by: Michael Kelley --- drivers/hv/channel_mgmt.c | 26 ++ drivers/hv/connection.c | 3 +++ drivers/hv/hyperv_vmbus.h | 12 drivers/hv/vmbus_drv.c| 44 +++- 4 files

[PATCH v5 4/9] Drivers: hv: vmbus: Implement suspend/resume for VSC drivers for hibernation

2019-09-05 Thread Dexuan Cui
The high-level VSC drivers will implement device-specific callbacks. Signed-off-by: Dexuan Cui Reviewed-by: Michael Kelley --- drivers/hv/vmbus_drv.c | 46 ++ include/linux/hyperv.h | 3 +++ 2 files changed, 49 insertions(+) diff --git a/drivers/hv

[PATCH v5 7/9] Drivers: hv: vmbus: Clean up hv_sock channels by force upon suspend

2019-09-05 Thread Dexuan Cui
lds of the channels are set, and the apps will thoroughly destroy the channels after hibernation. Signed-off-by: Dexuan Cui Reviewed-by: Michael Kelley --- drivers/hv/vmbus_drv.c | 55 ++ 1 file changed, 55 insertions(+) diff --git a/drivers/hv/v

[PATCH v5 6/9] Drivers: hv: vmbus: Suspend/resume the vmbus itself for hibernation

2019-09-05 Thread Dexuan Cui
. Signed-off-by: Dexuan Cui Reviewed-by: Michael Kelley --- drivers/hv/connection.c | 3 +-- drivers/hv/hyperv_vmbus.h | 2 ++ drivers/hv/vmbus_drv.c| 59 +++ 3 files changed, 62 insertions(+), 2 deletions(-) diff --git a/drivers/hv/connection.c

[PATCH v5 1/9] Drivers: hv: vmbus: Break out synic enable and disable operations

2019-09-05 Thread Dexuan Cui
d, because when we're in hv_synic_cleanup(), we're absolutely sure sctrl.enable must be 1. Signed-off-by: Dexuan Cui Reviewed-by: Michael Kelley --- drivers/hv/hv.c | 66 ++- drivers/hv/hyperv_vmbus.h | 2 ++ 2 files changed,

[PATCH v5 9/9] Drivers: hv: vmbus: Resume after fixing up old primary channels

2019-09-05 Thread Dexuan Cui
n resume, vmbus_onoffer() finds the old channel structs, and maps the new offers to the old channels, and fixes up the old structs, and finally the resume callbacks of the VSC drivers will re-open the channels. Signed-off-by: Dexuan Cui Reviewed-by: Michael Kelley --- drivers/hv/channel_mgm

[PATCH v5 0/9] Enhance the hv_vmbus driver to support hibernation

2019-09-05 Thread Dexuan Cui
x27;s hyperv-next branch: https://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux.git/log/?h=hyperv-next , and all the 9 patches have Michael Kelley's Signed-off-by's. Please review. Thanks! Dexuan Dexuan Cui (9): Drivers: hv: vmbus: Break out synic enable and disable operation

[PATCH v5 2/9] Drivers: hv: vmbus: Suspend/resume the synic for hibernation

2019-09-05 Thread Dexuan Cui
This is needed when we resume the old kernel from the "current" kernel. Note: when hv_synic_suspend() and hv_synic_resume() run, all the non-boot CPUs have been offlined, and interrupts are disabled on CPU0. Signed-off-by: Dexuan Cui Reviewed-by: Michael Kelley --- drivers/hv/vmbus_

[PATCH v5 2/3] x86/hyper-v: Implement hv_is_hibernation_supported()

2019-09-05 Thread Dexuan Cui
ure are accepted, an extra patch will be submitted to forbid hibernation if the virtual ACPI S4 state is absent, i.e. hv_is_hibernation_supported() is false. Signed-off-by: Dexuan Cui Reviewed-by: Michael Kelley --- arch/x86/hyperv/hv_init.c | 7 +++ include/asm-generic/mshyperv.h | 2 ++

[PATCH v5 3/3] clocksource/drivers: Suspend/resume Hyper-V clocksource for hibernation

2019-09-05 Thread Dexuan Cui
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 Reviewed-by: Michael Kelley --- drivers/clocksource/hyperv_timer.c | 25 +

[PATCH v5 1/3] x86/hyper-v: Suspend/resume the hypercall page for hibernation

2019-09-05 Thread Dexuan Cui
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 Reviewed-by: Michael Kelley --- arch/x86/hyperv/hv_init.c | 33 +

[PATCH v5 0/3] Enhance Hyper-V for hibernation

2019-09-05 Thread Dexuan Cui
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: Sus

RE: [PATCH v4 01/12] x86/hyper-v: Suspend/resume the hypercall page for hibernation

2019-09-05 Thread Dexuan Cui
> From: Sasha Levin > Sent: Thursday, September 5, 2019 8:44 AM > On Tue, Sep 03, 2019 at 12:23:16AM +0000, Dexuan Cui wrote: > >This is needed for hibernation, e.g. when we resume the old kernel, we need > >to disable the "current" kernel's hypercall page

RE: "fs/namei.c: keep track of nd->root refcount status" causes boot panic

2019-09-02 Thread Dexuan Cui
FYI: this is a slightly different call-trace. I believe this also show a memory corruption... [ 17.848975] Run /init as init process Loading, please wait... starting version 239 [ 18.045913] BUG: unable to handle page fault for address: 8884bb8f4b98 [ 18.046012] #PF: supervisor write ac

RE: "fs/namei.c: keep track of nd->root refcount status" causes boot panic

2019-09-02 Thread Dexuan Cui
> From: Dexuan-Linux Cui > Sent: Monday, September 2, 2019 10:22 PM > To: Qian Cai > Cc: Al Viro ; linux-fsde...@vger.kernel.org; LKML > ; Dexuan Cui ; Lili Deng > (Wicresoft North America Ltd) > Subject: Re: "fs/namei.c: keep track of nd->root refcount status&quo

RE: [PATCH] HID: hyperv: Use in-place iterator API in the channel callback

2019-09-02 Thread Dexuan Cui
> -Original Message- > From: Dexuan Cui > Sent: Monday, August 19, 2019 7:57 PM > To: ji...@kernel.org; benjamin.tissoi...@redhat.com; > linux-in...@vger.kernel.org; linux-hyp...@vger.kernel.org; Stephen > Hemminger ; Sasha Levin > ; sas...@kernel.org; Haiyang Zh

[PATCH v4 12/12] Drivers: hv: vmbus: Resume after fixing up old primary channels

2019-09-02 Thread Dexuan Cui
n resume, vmbus_onoffer() finds the old channel structs, and maps the new offers to the old channels, and fixes up the old structs, and finally the resume callbacks of the VSC drivers will re-open the channels. Signed-off-by: Dexuan Cui --- drivers/hv/channel_mgm

[PATCH v4 07/12] Drivers: hv: vmbus: Implement suspend/resume for VSC drivers for hibernation

2019-09-02 Thread Dexuan Cui
The high-level VSC drivers will implement device-specific callbacks. Signed-off-by: Dexuan Cui Reviewed-by: Michael Kelley --- drivers/hv/vmbus_drv.c | 46 ++ include/linux/hyperv.h | 3 +++ 2 files changed, 49 insertions(+) diff --git a/drivers/hv

[PATCH v4 10/12] Drivers: hv: vmbus: Clean up hv_sock channels by force upon suspend

2019-09-02 Thread Dexuan Cui
lds of the channels are set, and the apps will thoroughly destroy the channels after hibernation. Signed-off-by: Dexuan Cui Reviewed-by: Michael Kelley --- drivers/hv/vmbus_drv.c | 55 ++ 1 file changed, 55 insertions(+) diff --git a/drivers/hv/v

[PATCH v4 05/12] Drivers: hv: vmbus: Suspend/resume the synic for hibernation

2019-09-02 Thread Dexuan Cui
This is needed when we resume the old kernel from the "current" kernel. Note: when hv_synic_suspend() and hv_synic_resume() run, all the non-boot CPUs have been offlined, and interrupts are disabled on CPU0. Signed-off-by: Dexuan Cui Reviewed-by: Michael Kelley --- drivers/hv/vmbus_

<    1   2   3   4   5   6   7   8   9   >