[PATCH v4 03/12] clocksource/drivers: Suspend/resume Hyper-V clocksource for hibernation

2019-09-02 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 + 1 fi

[PATCH v4 09/12] Drivers: hv: vmbus: Suspend/resume the vmbus itself for hibernation

2019-09-02 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 v4 01/12] x86/hyper-v: Suspend/resume the hypercall page for hibernation

2019-09-02 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 | 34

[PATCH v4 00/12] Enhance the hv_vmbus driver to support hibernation

2019-09-02 Thread Dexuan Cui
d argument of print_hex_dump_debug(). Also improved the changelog. Patch 6: Improved the changelog and the comment. Added a check for the 'vmbus_proto_version' in vmbus_bus_resume(). Dexuan Cui (12): x86/hyper-v: Suspend/resume the hypercall page for hibernation x86/hyper-v:

[PATCH v4 08/12] Drivers: hv: vmbus: Ignore the offers when resuming from hibernation

2019-09-02 Thread Dexuan Cui
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 --- drivers/hv/channel_mgmt.c | 58 ++- 1 file changed, 57

[PATCH v4 04/12] Drivers: hv: vmbus: Break out synic enable and disable operations

2019-09-02 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, 39 inserti

[PATCH v4 11/12] Drivers: hv: vmbus: Suspend after cleaning up hv_sock and sub channels

2019-09-02 Thread Dexuan Cui
to zero. Signed-off-by: Dexuan Cui --- 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 changed, 84 insertions(+), 1

[PATCH v4 06/12] Drivers: hv: vmbus: Add a helper function is_sub_channel()

2019-09-02 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 v4 02/12] x86/hyper-v: Implement hv_is_hibernation_supported()

2019-09-02 Thread Dexuan Cui
, 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 --- arch/x86/hyperv/hv_init.c | 7 +++ include/asm-generic/mshyperv.h | 2 ++ 2 files changed, 9 insertions(+) diff --git

[PATCH] irqdomain: Add the missing assignment of domain->fwnode for named fwnode

2019-09-02 Thread Dexuan Cui
any interrupt. Fixes: d59f6617eef0 ("genirq: Allow fwnode to carry name information only") Fixes: 467a3bb97432 ("PCI: hv: Allocate a named fwnode instead of an address-based one") Reported-by: Lili Deng Signed-off-by: Dexuan Cui --- Note: the commit 467a3bb97432 ("PCI: hv: Al

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

2019-08-30 Thread Dexuan Cui
> From: Dexuan Cui > Sent: Friday, August 30, 2019 9:37 PM > > Is the intent to proceed and use the new offer? > Yes, since this is not an error. > > I'll add a comment before the "Mismatched offer from the host" for this. Hi Michael, I'm going to make the below

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

2019-08-30 Thread Dexuan Cui
> From: Michael Kelley > Sent: Friday, August 23, 2019 1:25 PM > > From: Dexuan Cui Sent: Monday, August 19, 2019 6:52 PM > > @@ -890,6 +937,11 @@ static void vmbus_onoffer(struct > > vmbus_channel_message_header *hdr) > >

RE: [PATCH v3 11/12] Drivers: hv: vmbus: Suspend after cleaning up hv_sock and sub channels

2019-08-30 Thread Dexuan Cui
> From: Michael Kelley > Sent: Friday, August 23, 2019 1:17 PM > > From: Dexuan Cui Sent: Monday, August 19, 2019 6:52 PM > > > > diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c > > @@ -499,6 +499,8 @@ static void vmbus_add_channel_w

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

2019-08-30 Thread Dexuan Cui
> From: Michael Kelley > Sent: Friday, August 23, 2019 1:02 PM > > From: Dexuan Cui Sent: Monday, August 19, 2019 6:52 PM > > > > Fake RESCIND_CHANNEL messages to clean up hv_sock channels by force for > > hibernation. There is no better method to clean

RE: [PATCH v3 08/12] Drivers: hv: vmbus: Ignore the offers when resuming from hibernation

2019-08-30 Thread Dexuan Cui
> From: Michael Kelley > Sent: Friday, August 23, 2019 12:57 PM > > From: Dexuan Cui Sent: August 19, 2019 6:52 PM > > > > diff --git a/drivers/hv/connection.c b/drivers/hv/connection.c > > @@ -337,6 +337,33 @@ struct vmbus_ch

RE: [PATCH v3 02/12] x86/hyper-v: Implement hv_is_hibernation_supported()

2019-08-30 Thread Dexuan Cui
> From: Michael Kelley > Sent: Friday, August 23, 2019 12:50 PM > > From: Dexuan Cui Sent: August 19, 2019 6:52 PM > > > > When a Linux VM runs on Hyper-V and hibernates, it must disable the > > memory hot-add/remove and balloon up/down capabilities in the h

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

2019-08-19 Thread Dexuan Cui
/0xc60 do_group_exit+0x47/0xc0 get_signal+0x169/0xc60 do_signal+0x30/0x710 exit_to_usermode_loop+0x50/0xa0 do_syscall_64+0x1fc/0x220 entry_SYSCALL_64_after_hwframe+0x49/0xbe Signed-off-by: Dexuan Cui --- net/vmw_vsock/af_vsock.c | 33 - net/vmw

[PATCH] Drivers: hv: vmbus: Remove the unused "tsc_page" from struct hv_context

2019-08-19 Thread Dexuan Cui
erv_timer.c). Fixes: 63ed4e0c67df ("Drivers: hv: vmbus: Consolidate all Hyper-V specific clocksource code") Signed-off-by: Dexuan Cui --- drivers/hv/hyperv_vmbus.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/hv/hyperv_vmbus.h b/drivers/hv/hyperv_vmbus.h index 362e70e..f

[PATCH] Input: hyperv-keyboard: Use in-place iterator API in the channel callback

2019-08-19 Thread Dexuan Cui
Simplify the ring buffer handling with the in-place API. Also avoid the dynamic allocation and the memory leak in the channel callback function. Signed-off-by: Dexuan Cui --- Hi Dmitry, can this patch go through Sasha's hyperv tree: https://git.kernel.org/pub/scm/linux/kernel/git/hyperv

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

2019-08-19 Thread Dexuan Cui
Simplify the ring buffer handling with the in-place API. Also avoid the dynamic allocation and the memory leak in the channel callback function. Signed-off-by: Dexuan Cui --- Hi Jiri, Benjamin, can this patch go through Sasha's hyperv tree: https://git.kernel.org/pub/scm/linux/kernel/git

[PATCH v3 02/12] x86/hyper-v: Implement hv_is_hibernation_supported()

2019-08-19 Thread Dexuan Cui
ACPI S4 state for a VM, so we hope to use the presence of the virtual ACPI S4 state as a hint for hv_balloon to disable the aforementioned capabilities. The new API will be used by hv_balloon. Signed-off-by: Dexuan Cui --- arch/x86/hyperv/hv_init.c | 7 +++ include/asm-generic/mshyperv.h

[PATCH v3 04/12] Drivers: hv: vmbus: Break out synic enable and disable operations

2019-08-19 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, 39 inserti

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

2019-08-19 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 | 34

[PATCH v3 08/12] Drivers: hv: vmbus: Ignore the offers when resuming from hibernation

2019-08-19 Thread Dexuan Cui
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 --- drivers/hv/channel_mgmt.c | 29 - drivers/hv/connection.c | 27

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

2019-08-19 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 v3 11/12] Drivers: hv: vmbus: Suspend after cleaning up hv_sock and sub channels

2019-08-19 Thread Dexuan Cui
to zero. Signed-off-by: Dexuan Cui --- drivers/hv/channel_mgmt.c | 28 drivers/hv/connection.c | 3 +++ drivers/hv/hyperv_vmbus.h | 12 drivers/hv/vmbus_drv.c| 41 - 4 files changed, 83 insertions(+), 1

[PATCH v3 06/12] Drivers: hv: vmbus: Add a helper function is_sub_channel()

2019-08-19 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 --- include/linux/hyperv.h | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/include

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

2019-08-19 Thread Dexuan Cui
ume, 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_mgmt.c |

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

2019-08-19 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 v3 10/12] Drivers: hv: vmbus: Clean up hv_sock channels by force upon suspend

2019-08-19 Thread Dexuan Cui
ls are set, and the apps will thoroughly destroy the channels after hibernation. Signed-off-by: Dexuan Cui --- drivers/hv/vmbus_drv.c | 55 ++ 1 file changed, 55 insertions(+) diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c index ce9974

[PATCH v3 09/12] Drivers: hv: vmbus: Suspend/resume the vmbus itself for hibernation

2019-08-19 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 v3 03/12] clocksource/drivers: Suspend/resume Hyper-V clocksource for hibernation

2019-08-19 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 + 1 fi

[PATCH v3 00/12] Enhance the hv_vmbus driver to support hibernation

2019-08-19 Thread Dexuan Cui
BUS UNLOAD message. Patch 12: Add code to fix up the old primary channels before further resuming. Dexuan Cui (12): x86/hyper-v: Suspend/resume the hypercall page for hibernation x86/hyper-v: Implement hv_is_hibernation_supported() clocksource/drivers: Suspend/resume Hyper-V c

[PATCH net v2] hv_netvsc: Fix a warning of suspicious RCU usage

2019-08-08 Thread Dexuan Cui
This fixes a warning of "suspicious rcu_dereference_check() usage" when nload runs. Fixes: 776e726bfb34 ("netvsc: fix RCU warning in get_stats") Signed-off-by: Dexuan Cui --- Changes in v2: Made the minimal required change. Added a Fixes tag. Removed

RE: [PATCH net] hv_netvsc: Fix a warning of suspicious RCU usage

2019-08-08 Thread Dexuan Cui
> From: David Miller > Sent: Thursday, August 8, 2019 6:14 PM > To: Dexuan Cui > Cc: net...@vger.kernel.org; Haiyang Zhang ; > Stephen Hemminger ; sas...@kernel.org; KY > Srinivasan ; Michael Kelley ; > linux-hyp...@vger.kernel.org; linux-kernel@vger.kerne

RE: [PATCH v2 6/7] Drivers: hv: vmbus: Suspend/resume the vmbus itself for hibernation

2019-08-07 Thread Dexuan Cui
> From: Dexuan Cui > Sent: Wednesday, July 31, 2019 10:52 AM > To: linux-hyp...@vger.kernel.org; gre...@linuxfoundation.org; Stephen > @@ -2050,6 +2095,10 @@ static int vmbus_acpi_add(struct acpi_device > *device) > }; > MODULE_DEVICE_TABLE(acpi, vmbus_acpi_device_ids

RE: [PATCH net] hv_netvsc: Fix a warning of suspicious RCU usage

2019-08-07 Thread Dexuan Cui
> From: Jakub Kicinski > Sent: Tuesday, August 6, 2019 12:13 PM > To: Dexuan Cui > > On Tue, 6 Aug 2019 05:17:44 +0000, Dexuan Cui wrote: > > This fixes a warning of "suspicious rcu_dereference_check() usage" > > when nload runs. > > > >

RE: [PATCH v2] PCI: hv: Fix panic by calling hv_pci_remove_slots() earlier

2019-08-06 Thread Dexuan Cui
> From: linux-hyperv-ow...@vger.kernel.org > On Behalf Of Bjorn Helgaas > Sent: Tuesday, August 6, 2019 1:16 PM > To: Dexuan Cui > > Thanks for updating this. But you didn't update the subject line, > which is really still a little too low-level. Maybe Lorenzo will fix &g

[PATCH net] hv_netvsc: Fix a warning of suspicious RCU usage

2019-08-05 Thread Dexuan Cui
This fixes a warning of "suspicious rcu_dereference_check() usage" when nload runs. Signed-off-by: Stephen Hemminger Signed-off-by: Dexuan Cui --- drivers/net/hyperv/netvsc_drv.c | 44 +++-- 1 file changed, 26 insertions(+), 18 deletions(-) diff --git

RE: [PATCH v2 net] hv_sock: Fix hang when a connection is closed

2019-08-02 Thread Dexuan Cui
> From: linux-hyperv-ow...@vger.kernel.org > Sent: Friday, August 2, 2019 5:27 PM > ... > Applied and queued up for -stable. > > Do not ever CC: stable for networking patches, we submit to -stable manually. Thanks, David! I'll remember to not add the stable tag for network patches. Thanks, --

RE: [PATCH v2 00/11] VSOCK: add vsock_test test suite

2019-08-01 Thread Dexuan Cui
> From: Stefano Garzarella > Sent: Thursday, August 1, 2019 8:26 AM > > The vsock_diag.ko module already has a test suite but the core AF_VSOCK > functionality has no tests. This patch series adds several test cases that > exercise AF_VSOCK SOCK_STREAM socket semantics (send/recv, >

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

2019-07-31 Thread Dexuan Cui
When the VM resumes, the host re-sends the offers. We should not add the offers to the global vmbus_connection.chn_list again. Added some debug code, in case the host screws up the exact info related to the offers. Signed-off-by: Dexuan Cui --- drivers/hv/channel_mgmt.c | 29

[PATCH v2 3/7] Drivers: hv: vmbus: Break out synic enable and disable operations

2019-07-31 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, 39 inserti

[PATCH v2 6/7] Drivers: hv: vmbus: Suspend/resume the vmbus itself for hibernation

2019-07-31 Thread Dexuan Cui
. Signed-off-by: Dexuan Cui --- drivers/hv/connection.c | 3 +-- drivers/hv/hyperv_vmbus.h | 2 ++ drivers/hv/vmbus_drv.c| 50 +++ 3 files changed, 53 insertions(+), 2 deletions(-) diff --git a/drivers/hv/connection.c b/drivers/hv/connection.c

[PATCH v2 2/7] clocksource/drivers: Suspend/resume Hyper-V clocksource for hibernation

2019-07-31 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 + 1 fi

[PATCH v2 4/7] Drivers: hv: vmbus: Suspend/resume the synic for hibernation

2019-07-31 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 --- drivers/hv/vmbus_

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

2019-07-31 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 | 34

[PATCH v2 0/7] Enhance the hv_vmbus driver to support hibernation

2019-07-31 Thread Dexuan Cui
: Improved the changelog and the comment. Added a check for the 'vmbus_proto_version' in vmbus_bus_resume(). Thanks, Dexuan Dexuan Cui (7): x86/hyper-v: Suspend/resume the hypercall page for hibernation clocksource/drivers: Suspend/resume Hyper-V clocksource for hibernation Drivers: hv: vm

[PATCH v2 7/7] Drivers: hv: vmbus: Implement suspend/resume for VSC drivers for hibernation

2019-07-31 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 | 42 ++ include/linux/hyperv.h | 3 +++ 2 files changed, 45 insertions(+) diff --git a/drivers/hv

[PATCH v2 net] hv_sock: Fix hang when a connection is closed

2019-07-30 Thread Dexuan Cui
cnt is still 4. The issue can be resolved if an extra reference is taken when the connection is established. Fixes: a9eeb998c28d ("hv_sock: Add support for delayed close") Signed-off-by: Dexuan Cui Cc: sta...@vger.kernel.org --- Changes in v2: Changed the location of the sock_h

RE: [PATCH 6/7] Drivers: hv: vmbus: Suspend/resume the vmbus itself for hibernation

2019-07-30 Thread Dexuan Cui
> From: Michael Kelley > Sent: Tuesday, July 30, 2019 4:26 PM > From: Dexuan Cui Sent: Monday, July 8, 2019 10:30 > PM > > > > This is needed when we resume the old kernel from the "current" kernel. > > Perhaps a bit more descriptive commit message coul

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

2019-07-30 Thread Dexuan Cui
> From: Michael Kelley > Sent: Tuesday, July 30, 2019 4:07 PM > > + > > + if (oldchannel != NULL) { > > + atomic_dec(_connection.offer_in_progress); > > + > > + /* > > +* We're resuming from hibernation: we expect the host to send > > +* exactly the

RE: [PATCH 3/7] Drivers: hv: vmbus: Split hv_synic_init/cleanup into regs and timer settings

2019-07-30 Thread Dexuan Cui
> From: Michael Kelley > Sent: Tuesday, July 30, 2019 3:36 PM > > From: Dexuan Cui Sent: Monday, July 8, 2019 10:29 > PM > > > > There is only one functional change: the unnecessary check > > "if (sctrl.enable != 1) return -EFAULT;" is removed,

RE: [PATCH net] hv_sock: Fix hang when a connection is closed

2019-07-29 Thread Dexuan Cui
> From: Sunil Muthuswamy > Sent: Monday, July 29, 2019 10:21 AM > > --- a/net/vmw_vsock/hyperv_transport.c > > +++ b/net/vmw_vsock/hyperv_transport.c > > @@ -309,9 +309,16 @@ static void hvs_close_connection(struct > vmbus_channel *chan) > > { > > struct sock *sk =

[PATCH net] hv_sock: Fix hang when a connection is closed

2019-07-28 Thread Dexuan Cui
hvs_do_close_lock_held() may decrease the reference count to 0 and free the sk struct completely, and then the following release_sock(sk) may hang. Fixes: a9eeb998c28d ("hv_sock: Add support for delayed close") Signed-off-by: Dexuan Cui Cc: sta...@vger.kernel.org --- With the pro

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

2019-07-26 Thread Dexuan Cui
ask_inactive schedule_hrtimeout(, 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")

[PATCH 3/7] Drivers: hv: vmbus: Split hv_synic_init/cleanup into regs and timer settings

2019-07-08 Thread Dexuan Cui
to support hibernation. Signed-off-by: Dexuan Cui --- drivers/hv/hv.c | 66 ++- drivers/hv/hyperv_vmbus.h | 2 ++ 2 files changed, 39 insertions(+), 29 deletions(-) diff --git a/drivers/hv/hv.c b/drivers/hv/hv.c index 6188fb7..fcc5279 100644 --- a/

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

2019-07-08 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 --- arch/x86/hyperv/hv_init.c | 34 ++ 1 file changed, 34 insertion

[PATCH 4/7] Drivers: hv: vmbus: Suspend/resume the synic for hibernation

2019-07-08 Thread Dexuan Cui
This is needed when we resume the old kernel from the "current" kernel. Signed-off-by: Dexuan Cui --- drivers/hv/vmbus_drv.c | 40 1 file changed, 40 insertions(+) diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c index 72d5a7

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

2019-07-08 Thread Dexuan Cui
. Please review. Thanks, Dexuan Dexuan Cui (7): x86/hyper-v: Suspend/resume the hypercall page for hibernation clocksource/drivers: Suspend/resume Hyper-V clocksource for hibernation Drivers: hv: vmbus: Split hv_synic_init/cleanup into regs and timer settings Drivers: hv: vmbus: Suspend

[PATCH 2/7] clocksource/drivers: Suspend/resume Hyper-V clocksource for hibernation

2019-07-08 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 --- drivers/clocksource/hyperv_timer.c | 25 + 1 file changed, 25 insertions(+)

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

2019-07-08 Thread Dexuan Cui
This is needed when we resume the old kernel from the "current" kernel. Signed-off-by: Dexuan Cui --- drivers/hv/connection.c | 3 +-- drivers/hv/hyperv_vmbus.h | 2 ++ drivers/hv/vmbus_drv.c| 40 3 files changed, 43 insertions(+), 2

[PATCH 7/7] Drivers: hv: vmbus: Implement suspend/resume for VSC drivers for hibernation

2019-07-08 Thread Dexuan Cui
The high-level VSC drivers will implement device-specific callbacks. Signed-off-by: Dexuan Cui --- drivers/hv/vmbus_drv.c | 42 ++ include/linux/hyperv.h | 3 +++ 2 files changed, 45 insertions(+) diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv

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

2019-07-08 Thread Dexuan Cui
When the VM resumes, the host re-sends the offers. We should not add the offers to the global vmbus_connection.chn_list again. Added some debug code, in case the host screws up the exact info related to the offers. Signed-off-by: Dexuan Cui --- drivers/hv/channel_mgmt.c | 28

[PATCH] ACPI: PM: Fix "multiple definition of acpi_sleep_state_supported" for ARM64

2019-07-05 Thread Dexuan Cui
If CONFIG_ACPI_SYSTEM_POWER_STATES_SUPPORT is not set, the dummy version of the function should be static. Fixes: 1e2c3f0f1e93 ("ACPI: PM: Make acpi_sleep_state_supported() non-static") Signed-off-by: Dexuan Cui Reported-by: kbuild test robot --- Sorry for not doing it right in th

[PATCH] ACPI: PM: Make acpi_sleep_state_supported() non-static

2019-07-03 Thread Dexuan Cui
in the always-built-in module arch/x86/hyperv/hv_init.c, and the API will be called by hv_balloon. Signed-off-by: Dexuan Cui --- Previously I posted a version that tries to export the function: https://lkml.org/lkml/2019/6/14/1077, which may be an overkill. So I proposed a second patch (which

RE: [PATCH] PCI: hv: fix pci-hyperv build, depends on SYSFS

2019-07-02 Thread Dexuan Cui
> From: linux-hyperv-ow...@vger.kernel.org > On Behalf Of Randy Dunlap > Sent: Tuesday, July 2, 2019 8:25 PM > To: Matthew Wilcox > Cc: LKML ; linux-hyp...@vger.kernel.org; Jake > Oshins ; KY Srinivasan ; Haiyang > Zhang ; Stephen Hemminger > ; Sasha Levin ; linux-pci > ; Bjorn Helgaas >

RE: [PATCH] PCI: hv: fix pci-hyperv build, depends on SYSFS

2019-07-02 Thread Dexuan Cui
> From: linux-hyperv-ow...@vger.kernel.org > On Behalf Of Randy Dunlap > Sent: Tuesday, July 2, 2019 4:25 PM > ERROR: "pci_destroy_slot" [drivers/pci/controller/pci-hyperv.ko] undefined! > ERROR: "pci_create_slot" [drivers/pci/controller/pci-hyperv.ko] undefined! > > drivers/pci/slot.o is only

RE: [PATCH] ACPI: PM: Export the function acpi_sleep_state_supported()

2019-06-21 Thread Dexuan Cui
> From: linux-hyperv-ow...@vger.kernel.org > > ... > > When a Linux guest runs on Hyper-V (x86_32, x86_64, or ARM64) , we have a > > front-end balloon driver in the guest, which balloons up/down and > > hot adds/removes the guest's memory when the host requests that. The > > problem > > is: the

RE: [PATCH] ACPI: PM: Export the function acpi_sleep_state_supported()

2019-06-19 Thread Dexuan Cui
> From: linux-hyperv-ow...@vger.kernel.org > On Behalf Of Lorenzo Pieralisi > Sent: Monday, June 17, 2019 9:15 AM > > ... > > + some ARM experts who worked on arch/arm/kernel/hibernate.c. > > > > drivers/acpi/sleep.c is only built if ACPI_SYSTEM_POWER_STATES_SUPPORT > > is defined, but it looks

RE: [PATCH net] hvsock: fix epollout hang from race condition

2019-06-15 Thread Dexuan Cui
> From: Sunil Muthuswamy > Sent: Saturday, June 15, 2019 12:23 AM > To: Dexuan Cui ; David Miller > > ... > > It looks a simple inline assembly code can confuse gcc. I'm not sure if I > > should > > report a bug for gcc... > > > > I posted a pa

RE: [PATCH net] hvsock: fix epollout hang from race condition

2019-06-14 Thread Dexuan Cui
> From: linux-hyperv-ow...@vger.kernel.org > On Behalf Of Dexuan Cui > Sent: Friday, June 14, 2019 8:23 PM > To: David Miller ; Sunil Muthuswamy > > Cc: KY Srinivasan ; Haiyang Zhang > ; Stephen Hemminger > ; sas...@kernel.org; Michael Kelley > ; net...@v

[PATCH net] hv_sock: Suppress bogus "may be used uninitialized" warnings

2019-06-14 Thread Dexuan Cui
. The code is not buggy here. Signed-off-by: Dexuan Cui --- net/vmw_vsock/hyperv_transport.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/vmw_vsock/hyperv_transport.c b/net/vmw_vsock/hyperv_transport.c index 8d1ea9eda8a2..cd3f47f54fa7 100644 --- a/net/vmw_vsock/hyperv_t

RE: [PATCH net] hvsock: fix epollout hang from race condition

2019-06-14 Thread Dexuan Cui
> From: linux-hyperv-ow...@vger.kernel.org > On Behalf Of David Miller > Sent: Friday, June 14, 2019 7:15 PM > To: Sunil Muthuswamy > > This adds lots of new warnings: > > net/vmw_vsock/hyperv_transport.c: In function ‘hvs_probe’: > net/vmw_vsock/hyperv_transport.c:205:20: warning: ‘vnew’ may

RE: [PATCH] ACPI: PM: Export the function acpi_sleep_state_supported()

2019-06-14 Thread Dexuan Cui
> From: linux-hyperv-ow...@vger.kernel.org > On Behalf Of Russell King > On Fri, Jun 14, 2019 at 10:19:02PM +0000, Dexuan Cui wrote: > > It looks ARM does not support the ACPI S4 state, then how do we know > > if an ARM host supports hibernation or not? > > D

RE: [PATCH 2/2] hv_balloon: Reorganize the probe function

2019-06-14 Thread Dexuan Cui
> From: Michael Kelley > Sent: Friday, June 14, 2019 2:56 PM > > ... > > + ret = balloon_connect_vsp(dev); > > + if (ret != 0) > > + return ret; > > + > > dm_device.state = DM_INITIALIZED; > > - last_post_time = jiffies; > > I was curious about the above deletion. But I

RE: [PATCH] ACPI: PM: Export the function acpi_sleep_state_supported()

2019-06-14 Thread Dexuan Cui
> -Original Message- > From: Michael Kelley > Sent: Friday, June 14, 2019 1:48 PM > To: Dexuan Cui ; linux-a...@vger.kernel.org; > r...@rjwysocki.net; l...@kernel.org; robert.mo...@intel.com; > erik.schma...@intel.com > Cc: linux-hyp...@vger.kernel.org; linux-kerne

[PATCH 2/2] hv_balloon: Reorganize the probe function

2019-06-14 Thread Dexuan Cui
Move the code that negotiates with the host to a new function balloon_connect_vsp() and improve the error handling. This makes the code more readable and paves the way for the support of hibernation in future. Makes no real logic change here. Signed-off-by: Dexuan Cui --- drivers/hv

[PATCH 1/2] hv_balloon: Use a static page for the balloon_up send buffer

2019-06-14 Thread Dexuan Cui
It's unnecessary to dynamically allocate the buffer. Signed-off-by: Dexuan Cui --- drivers/hv/hv_balloon.c | 19 --- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/drivers/hv/hv_balloon.c b/drivers/hv/hv_balloon.c index dd475f3bcc8a..13381ea3e3e7 100644

[PATCH] ACPI: PM: Export the function acpi_sleep_state_supported()

2019-06-14 Thread Dexuan Cui
. Signed-off-by: Dexuan Cui --- drivers/acpi/sleep.c| 3 ++- include/acpi/acpi_bus.h | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c index a34deccd7317..69755411e008 100644 --- a/drivers/acpi/sleep.c +++ b/drivers/acpi/sleep.c

RE: [PATCH net] hvsock: fix epollout hang from race condition

2019-06-13 Thread Dexuan Cui
> Earlier hv_stream_has_space was setting/clearing the pending size on every > call. > > Signed-off-by: Sunil Muthuswamy Hi Sunil, thanks for the fix! It looks good. Reviewed-by: Dexuan Cui

RE: [PATCH net-next] hv_sock: perf: loop in send() to maximize bandwidth

2019-05-22 Thread Dexuan Cui
a from the channel. In such a case, > the send() can maximize the bandwidth (and consequently minimize the cpu > cycles) by iterating until the channel is found to be full. Reviewed-by: Dexuan Cui The patch looks good. Thanks, Sunil! Thanks, -- Dexuan

RE: [PATCH net-next] hv_sock: perf: Allow the socket buffer size options to influence the actual socket buffers

2019-05-22 Thread Dexuan Cui
sing the SO_SNDBUF and > the SO_RCVBUF socket options. > ... > > Signed-off-by: Sunil Muthuswamy Reviewed-by: Dexuan Cui The patch looks good. Thanks, Sunil! Thanks, -- Dexuan

RE: [PATCH] PCI: hv: Detect and fix Hyper-V PCI domain number collision

2019-05-21 Thread Dexuan Cui
> From: Stephen Hemminger > Sent: Tuesday, May 21, 2019 9:40 PM > > Thanks for working this out with the host team. > Now if we could just get some persistent slot information it would make udev > in systemd happy. The slot info comes from the serial number "hpdev->desc.ser", which may not

RE: [PATCH] PCI: hv: Detect and fix Hyper-V PCI domain number collision

2019-05-21 Thread Dexuan Cui
; Signed-off-by: Haiyang Zhang The patch looks good to me. Reviewed-by: Dexuan Cui

RE: [PATCH] hv_sock: perf: loop in send() to maximize bandwidth

2019-05-19 Thread Dexuan Cui
t probably because the bottleneck on throughput is > somewhere else. > 2. The average system (or kernel) cpu time goes down by 10%+ with this > change, for the same amount of data transfer. > > Signed-off-by: Sunil Muthuswamy Reviewed-by: Dexuan Cui The patch looks good. Thanks, Sunil! Thanks, -- Dexuan

[PATCH] Drivers: hv: vmbus: Fix virt_to_hvpfn() for X86_PAE

2019-05-07 Thread Dexuan Cui
ivers: hv: vmbus: Remove use of slow_virt_to_phys()") Cc: sta...@vger.kernel.org Cc: Michael Kelley Reported-and-tested-by: Juliana Rodrigueiro Signed-off-by: Dexuan Cui --- drivers/hv/channel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hv/channel.c b/

RE: [PATCH v2] hv: tools: fixed Python pep8/flake8 warnings for lsvmbus

2019-05-06 Thread Dexuan Cui
> From: Adrian Vladu > Sent: Monday, May 6, 2019 10:34 AM > To: linux-kernel@vger.kernel.org > Cc: Adrian Vladu ; KY Srinivasan > ; Haiyang Zhang ; Stephen > Hemminger ; Sasha Levin ; > Dexuan Cui ; Alessandro Pilotti > > Subject: [PATCH v2] hv: tools: fixed

RE: [PATCH] smp: Do not warn if smp_call_function_single() is doing a self call.

2019-04-17 Thread Dexuan Cui
> From: Thomas Gleixner > Sent: Tuesday, April 16, 2019 1:13 PM > > ... > > True. And before we start digging deeper into this, let's step back: why > > do we need to do clockevents_unbind_device() on hybernation? Can we just > > disable the device and re-enable it back on resume? We do

RE: [PATCH] smp: Do not warn if smp_call_function_single() is doing a self call.

2019-04-15 Thread Dexuan Cui
> From: Peter Zijlstra > Sent: Monday, April 15, 2019 5:21 AM > To: Dexuan Cui > > On Fri, Apr 12, 2019 at 11:53:57PM +0000, Dexuan Cui wrote: > > If smp_call_function_single() is calling the function for itself, it's safe > > to run with irqs_disabled() == true

[PATCH] smp: Do not warn if smp_call_function_single() is doing a self call.

2019-04-12 Thread Dexuan Cui
ic_cleanup() -> clockevents_unbind_device() -> clockevents_unbind() -> smp_call_function_single(). When the .suspend callback runs, only CPU0 is online and irqs_disabled() is true. Signed-off-by: Dexuan Cui --- kernel/smp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --g

[PATCH] vmbus: Remove the undesired put_cpu_ptr() in hv_synic_cleanup()

2019-04-12 Thread Dexuan Cui
With CONFIG_DEBUG_PREEMPT=y, the put_cpu_ptr() triggiers an underflow warning in preempt_count_sub(). Fixes: 37cdd991fac8 ("vmbus: put related per-cpu variable together") Cc: sta...@vger.kernel.org Cc: Stephen Hemminger Signed-off-by: Dexuan Cui --- drivers/hv/hv.c | 1 - 1 file

[PATCH 2/3] PCI: hv: Add hv_pci_remove_slots() when we unload the driver

2019-03-04 Thread Dexuan Cui
root 0 Feb 7 10:49 2-1 drwxr-xr-x 2 root root 0 Feb 7 10:51 2-2 The patch adds the missing code. Fixes: a15f2c08c708 ("PCI: hv: support reporting serial number as slot information") Signed-off-by: Dexuan Cui Acked-by: Stephen Hemminger Cc: sta...@vger.kernel.org --- drivers/pc

[PATCH 3/3] PCI: hv: Add pci_destroy_slot() in pci_devices_present_work(), if necessary

2019-03-04 Thread Dexuan Cui
hv_pci_eject_device() to poll the channel's ringbuffer to work around the "hangs in hv_compose_msi_msg()" issue: see commit de0aa7b2f97d ("PCI: hv: Fix 2 hang issues in hv_compose_msi_msg()") Fixes: a15f2c08c708 ("PCI: hv: support reporting serial number as slot information"

[PATCH 1/3] PCI: hv: Fix a memory leak in hv_eject_device_work()

2019-03-04 Thread Dexuan Cui
4daace0d8ce8 ("PCI: hv: Add paravirtual PCI front-end for Microsoft Hyper-V VMs") Signed-off-by: Dexuan Cui Cc: --- drivers/pci/controller/pci-hyperv.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/pci/controller/pci-hyperv.c b/drivers/pci/controller/pci-hyperv.c i

[PATCH 0/3] pci-hyperv: fix memory leak and add pci_destroy_slot()

2019-03-04 Thread Dexuan Cui
s more work is required to make this scenaro work correctly, and since removing the driver is not really a "usual" usage, we can address this scenario in the future. Please review the patchset. Dexuan Cui (3): PCI: hv: Fix a memory leak in hv_eject_device_work() PCI: hv: Add hv_

RE: [PATCH] PCI: hv: Add hv_pci_remove_slots() when we unload the driver

2019-02-12 Thread Dexuan Cui
> From: Lorenzo Pieralisi > Sent: Tuesday, February 12, 2019 4:13 AM > ... > This patch fixes three bugs: > > 1) set hpdev->pci_slot to NULL > 2) move code destroying the slot inside a locked region in >hv_eject_device_work() > 3) Add missing slots removal code in hv_pci_remove() > > We

RE: [PATCH] PCI: hv: Add hv_pci_remove_slots() when we unload the driver

2019-02-11 Thread Dexuan Cui
> From: Sasha Levin > Sent: Monday, February 11, 2019 9:26 AM > To: Sasha Levin ; Dexuan Cui ; > Lorenzo Pieralisi > Cc: linux-kernel@vger.kernel.org; sta...@vger.kernel.org; Stephen Hemminger > ; sta...@vger.kernel.org > Subject: Re: [PATCH] PCI: hv: Add hv_pci_remove_s

[PATCH] PCI: hv: Add hv_pci_remove_slots() when we unload the driver

2019-02-07 Thread Dexuan Cui
dds the missing code, and in hv_eject_device_work() it also moves pci_destroy_slot() to an earlier place where we hold the pci lock. Fixes: a15f2c08c708 ("PCI: hv: support reporting serial number as slot information") Signed-off-by: Dexuan Cui Cc: sta...@vger.kernel.org Cc: Steph

RE: [PATCH] libnvdimm/dimm: Add a no-BLK quirk based on NVDIMM family

2019-02-05 Thread Dexuan Cui
> From: Dan Williams > Sent: Tuesday, February 5, 2019 9:12 AM > On Tue, Feb 5, 2019 at 8:53 AM Dexuan Cui wrote: > > > > > From: Dan Williams > > > Sent: Sunday, February 3, 2019 11:14 AM > > > > ... > > > > As I understand, the es

<    1   2   3   4   5   6   7   8   9   10   >