[PATCH v7 0/3] Drivers: hv: vmbus: use cpu_hotplug_enable/disable for CPU offlining prevention

2015-07-23 Thread Vitaly Kuznetsov
vasan] Changes since v1: - Make cpu_hotplug_disabled a counter [Radim Krčmář] Export cpu_hotplug_enable/cpu_hotplug_disable functions from cpu.c and use them instead of altering smp_ops.cpu_disable in Hyper-V vmbus module. Vitaly Kuznetsov (3): cpu-hotplug: convert cpu_hotplug_disabled to a counter

Re: [PATCH V3 3/7] Drivers: hv: vmbus: add APIs to send/recv hvsock packet and get the r/w-ability

2015-07-21 Thread Vitaly Kuznetsov
Dexuan Cui writes: > This will be used by the coming net/hvsock driver. > > Signed-off-by: Dexuan Cui > --- > drivers/hv/channel.c | 133 > ++ > drivers/hv/hyperv_vmbus.h | 4 ++ > drivers/hv/ring_buffer.c | 14 + > include/linux/hyperv.

Re: [PATCH net-next 1/1] hv_netvsc: Wait for sub-channels to be processed during probe

2015-07-17 Thread Vitaly Kuznetsov
KY Srinivasan writes: >> -Original Message- >> From: Vitaly Kuznetsov [mailto:vkuzn...@redhat.com] >> Sent: Friday, July 17, 2015 7:13 AM >> To: KY Srinivasan >> Cc: da...@davemloft.net; net...@vger.kernel.org; linux- >> ker...@vger.kernel.

Re: [V2 6/7] hvsock: introduce Hyper-V VM Sockets feature

2015-07-17 Thread Vitaly Kuznetsov
Dexuan Cui writes: >> From: David Miller >> Sent: Thursday, July 16, 2015 12:19 >> >> From: Dexuan Cui >> Date: Tue, 14 Jul 2015 03:00:48 -0700 >> >> > + pr_debug("hvsock_sk_destruct: called\n"); >> >> Debug logging just to state that a function is called is not appropriate, >> we have very s

Re: [PATCH net-next 1/1] hv_netvsc: Wait for sub-channels to be processed during probe

2015-07-17 Thread Vitaly Kuznetsov
"K. Y. Srinivasan" writes: > The current code returns from probe without waiting for the proper handling > of subchannels that may be requested. If the netvsc driver were to be rapidly > loaded/unloaded, we can trigger a panic as the unload will be tearing > down state that may not have been ful

Re: [PATCH] Drivers: hv: vmbus: prevent new subchannel creation on device shutdown

2015-07-14 Thread Vitaly Kuznetsov
Dexuan Cui writes: >> -Original Message- >> From: Vitaly Kuznetsov >> Sent: Monday, July 13, 2015 20:19 >> Subject: [PATCH] Drivers: hv: vmbus: prevent new subchannel creation on >> device >> shutdown >> >> When a new subchannel o

Re: [PATCH v6 0/3] Drivers: hv: vmbus: use cpu_hotplug_enable/disable for CPU offlining prevention

2015-07-13 Thread Vitaly Kuznetsov
Vitaly Kuznetsov writes: > Changes since v5: > - Split PATCH 1 into two (PATCH 1/3 and 3/3), rewrite changelogs. [Thomas > Gleixner] Sorry for the ping but Greg won't probably take this into his tree without some feedback on patches 1 and 3 from core kernel people. Could you

Re: [PATCH] Drivers: hv: vmbus: prevent new subchannel creation on device shutdown

2015-07-13 Thread Vitaly Kuznetsov
KY Srinivasan writes: >> -Original Message- >> From: Vitaly Kuznetsov [mailto:vkuzn...@redhat.com] >> Sent: Monday, July 13, 2015 5:19 AM >> To: de...@linuxdriverproject.org >> Cc: KY Srinivasan; Haiyang Zhang; Dexuan Cui; linux-ker...@vger.kernel.org &

[PATCH] Drivers: hv: vmbus: prevent new subchannel creation on device shutdown

2015-07-13 Thread Vitaly Kuznetsov
it in vmbus_remove() to ensure no new subchannels are created after we started the removal procedure. Check its state with mutex_trylock in vmbus_process_offer(). Signed-off-by: Vitaly Kuznetsov --- drivers/hv/channel.c | 3 +++ drivers/hv/channel_mgmt.c | 20 ++-- drive

Re: [PATCH] scsi: storvsc: make INQUIRY response SPC-compliant

2015-07-07 Thread Vitaly Kuznetsov
KY Srinivasan writes: >> -Original Message- >> From: Christoph Hellwig [mailto:h...@infradead.org] >> Sent: Friday, July 3, 2015 9:19 AM >> To: Vitaly Kuznetsov >> Cc: linux-s...@vger.kernel.org; Long Li; KY Srinivasan; Haiyang Zhang; James >> E.J. Bot

Re: [PATCH 1/1] drivers: hv: hv_utils_transport: Fixing validation of correct pointer

2015-07-03 Thread Vitaly Kuznetsov
Maninder Singh writes: > cn_msg should be validated instead of msg after memory allocation. > Thanks, This was already fixed by Dan: http://driverdev.linuxdriverproject.org/pipermail/driverdev-devel/2015-May/070193.html my Reviewed-by: http://driverdev.linuxdriverproject.org/pipermail/driverde

Re: [RFC PATCH 1/1] mshyperv: fix recognition of Hyper-V guest crash MSR's

2015-07-02 Thread Vitaly Kuznetsov
"Denis V. Lunev" writes: > From: Andrey Smetanin > > Hypervisor Top Level Functional Specification v3.1/4.0 notes that cpuid > (0x4003) EDX's 10th bit should be used to check that Hyper-V guest > crash MSR's functionality available. > > This patch should fix this recognition. Currently the c

[PATCH] Drivers: hv: vmbus: don't send CHANNELMSG_UNLOAD on pre-Win2012R2 hosts

2015-07-01 Thread Vitaly Kuznetsov
Pre-Win2012R2 hosts don't properly handle CHANNELMSG_UNLOAD and wait_for_completion() hangs. Avoid sending such request on old hosts. Signed-off-by: Vitaly Kuznetsov --- drivers/hv/channel_mgmt.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/hv/channel_mgmt.c b/drive

[PATCH] scsi: storvsc: use shost_for_each_device() instead of open coding

2015-07-01 Thread Vitaly Kuznetsov
Comment in struct Scsi_Host says that drivers are not supposed to access __devices directly. storvsc_host_scan() doesn't happen in irq context so we can just use shost_for_each_device(). Signed-off-by: Vitaly Kuznetsov --- drivers/scsi/storvsc_drv.c | 9 + 1 file changed, 1 inse

[PATCH] scsi: storvsc: make INQUIRY response SPC-compliant

2015-07-01 Thread Vitaly Kuznetsov
ngth to 0 (thus making the reply 5-bytes long). Upper level SCSI stack complains with 'INQUIRY result too short (5), using 36'. Fix the issue by mangling Additional length field in host's reply at the driver level. Signed-off-by: Vitaly Kuznetsov --- This is a hack, the proper fix shou

[PATCH v6 0/3] Drivers: hv: vmbus: use cpu_hotplug_enable/disable for CPU offlining prevention

2015-06-26 Thread Vitaly Kuznetsov
them instead of altering smp_ops.cpu_disable in Hyper-V vmbus module. Vitaly Kuznetsov (3): cpu-hotplug: export cpu_hotplug_enable/cpu_hotplug_disable Drivers: hv: vmbus: use cpu_hotplug_enable/disable cpu-hotplug: convert cpu_hotplug_disabled to a counter Documentation/power/suspen

[PATCH v6 3/3] cpu-hotplug: convert cpu_hotplug_disabled to a counter

2015-06-26 Thread Vitaly Kuznetsov
ble_nonboot_cpus() in case an error was returned. Signed-off-by: Vitaly Kuznetsov --- Documentation/power/suspend-and-cpuhotplug.txt | 6 +++--- kernel/cpu.c | 21 + 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/Docum

[PATCH v6 2/3] Drivers: hv: vmbus: use cpu_hotplug_enable/disable

2015-06-26 Thread Vitaly Kuznetsov
Commit e513229b4c38 ("Drivers: hv: vmbus: prevent cpu offlining on newer hypervisors") was altering smp_ops.cpu_disable to prevent CPU offlining. We can bo better by using cpu_hotplug_enable/disable functions instead of such hard-coding. Reported-by: Radim Krčmář Signed-off-by: Vitaly

[PATCH v6 1/3] cpu-hotplug: export cpu_hotplug_enable/cpu_hotplug_disable

2015-06-26 Thread Vitaly Kuznetsov
Hyper-V module needs to disable cpu hotplug (offlining) as there is no support from hypervisor side to reassing already opened event channels to a different CPU. Currently it is been done by altering smp_ops.cpu_disable but it is hackish. Signed-off-by: Vitaly Kuznetsov --- kernel/cpu.c | 3

[PATCH] scsi: storvsc: be more picky about scmnd->sc_data_direction

2015-06-25 Thread Vitaly Kuznetsov
it looks like an overkill. Reported-by: Radim Krčmář Signed-off-by: Vitaly Kuznetsov --- drivers/scsi/storvsc_drv.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c index 3c6584f..61f4855 100644 --- a

[PATCH] Drivers: hv: balloon: fix hv_hotadd_state description

2015-06-25 Thread Vitaly Kuznetsov
Commit 5a75d733 ("Drivers: hv: hv_balloon: don't lose memory when onlining order is not natural") made hv_hotadd_state description a bit ambiguous. Fix this and a typo. Reported-by: Jason Wang Signed-off-by: Vitaly Kuznetsov --- drivers/hv/hv_balloon.c | 4 ++-- 1

[PATCH v5 2/2] Drivers: hv: vmbus: use cpu_hotplug_enable/disable

2015-06-25 Thread Vitaly Kuznetsov
Commit e513229b4c38 ("Drivers: hv: vmbus: prevent cpu offlining on newer hypervisors") was altering smp_ops.cpu_disable to prevent CPU offlining. We can bo better by using cpu_hotplug_enable/disable functions instead of such hard-coding. Reported-by: Radim Krčmář Signed-off-by: Vitaly

[PATCH v5 1/2] cpu-hotplug: export cpu_hotplug_enable/cpu_hotplug_disable

2015-06-25 Thread Vitaly Kuznetsov
Loaded Hyper-V module will use these functions to disable CPU hotplug under certain circumstances. Convert cpu_hotplug_disabled to a counter (protected by cpu_add_remove_lock) to support e.g. disable -> disable -> enable call sequences. Signed-off-by: Vitaly Kuznetsov --- Documentation

[PATCH v5 0/2] Drivers: hv: vmbus: use cpu_hotplug_enable/disable for CPU offlining prevention

2015-06-25 Thread Vitaly Kuznetsov
x27;s char-misc-next tree [K. Y. Srinivasan] Changes since v1: - Make cpu_hotplug_disabled a counter [Radim Krčmář] Export cpu_hotplug_enable/cpu_hotplug_disable functions from cpu.c and use them instead of altering smp_ops.cpu_disable in Hyper-V vmbus module. Vitaly Kuznetsov (2): cpu-ho

[PATCH v2] Drivers: hv: vmbus: prefer 'die' notification chain to 'panic'

2015-06-25 Thread Vitaly Kuznetsov
die' notification so keep the 'panic' notification reporter as well but guard against double reporting. Signed-off-by: Vitaly Kuznetsov --- The patch was previously named "Drivers: hv: vmbus: use 'die' notification chain instead of 'panic'". In

Re: [PATCH V2 06/10] Drivers: hv: vmbus: use 'die' notification chain instead of 'panic'

2015-06-25 Thread Vitaly Kuznetsov
"K. Y. Srinivasan" writes: > From: Vitaly Kuznetsov > > current_pt_regs() returns regs of the userspace process and in case of > kernel crash this is not what we need to report. E.g. when we trigger > crash with sysrq we see the following: > ... > RIP: 0010:[]

Re: [PATCH v4 1/2] cpu-hotplug: export cpu_hotplug_enable/cpu_hotplug_disable

2015-06-25 Thread Vitaly Kuznetsov
Vitaly Kuznetsov writes: > Loaded Hyper-V module will use these functions to disable CPU hotplug > under certain circumstances. Convert cpu_hotplug_disabled to a counter > (protected by cpu_add_remove_lock) to support e.g. disable -> disable -> > enable call sequences. > &g

[PATCH v3 5/5] Drivers: hv: vmbus: add special crash handler

2015-06-25 Thread Vitaly Kuznetsov
to perform some mandatory minimalistic cleanup before we start new kernel. Reported-by: K. Y. Srinivasan Signed-off-by: Vitaly Kuznetsov --- arch/x86/include/asm/mshyperv.h | 2 ++ arch/x86/kernel/cpu/mshyperv.c | 22 ++ drivers/hv/vmbus_drv.c | 14

[PATCH v3 3/5] Drivers: hv: vmbus: add special kexec handler

2015-06-25 Thread Vitaly Kuznetsov
n mshyperv.c The minimalistic cleanup consists of cleaning up clockevents, synic MSRs, guest os id MSR, and hypercall MSR. Kdump doesn't require all this stuff as it lives in a separate memory space. Signed-off-by: Vitaly Kuznetsov --- arch/x86/include/asm/mshyperv.h | 2 ++ a

[PATCH v3 0/5] Drivers: hv: add kexec support (and fix kdump)

2015-06-25 Thread Vitaly Kuznetsov
oaded kernel doesn't know about this memory and there is no way to ask the host to bring all the memory back on cleanup (or at least I'm not aware of such a way). Kexec with hotplugged memory leads to reboot (not exactly sure why). Vitaly Kuznetsov (5): Drivers: hv: vmbus: remove hv_synic_

[PATCH v3 4/5] Drivers: hv: don't do hypercalls when hypercall_page is NULL

2015-06-25 Thread Vitaly Kuznetsov
do_hypercall() function. Unfortunately we have to write the !hypercall_page check twice to not mix declarations and code. Signed-off-by: Vitaly Kuznetsov --- drivers/hv/hv.c | 13 - 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/hv/hv.c b/drivers/hv/hv.c index 5b87042

[PATCH v3 2/5] kexec: define kexec_in_progress in !CONFIG_KEXEC case

2015-06-25 Thread Vitaly Kuznetsov
If some piece of code wants to check kexec_in_progress it has to be put in #ifdef CONFIG_KEXEC block to not break the build in !CONFIG_KEXEC case. Overcome this limitation by defining kexec_in_progress to false. Signed-off-by: Vitaly Kuznetsov --- include/linux/kexec.h | 1 + 1 file changed, 1

[PATCH v3 1/5] Drivers: hv: vmbus: remove hv_synic_free_cpu() call from hv_synic_cleanup()

2015-06-25 Thread Vitaly Kuznetsov
We already have hv_synic_free() which frees all per-cpu pages for all CPUs, let's remove the hv_synic_free_cpu() call from hv_synic_cleanup() so it will be possible to do separate cleanup (writing to MSRs) and final freeing. This is going to be used to assist kexec. Signed-off-by: V

[PATCH v4 1/2] cpu-hotplug: export cpu_hotplug_enable/cpu_hotplug_disable

2015-06-24 Thread Vitaly Kuznetsov
Loaded Hyper-V module will use these functions to disable CPU hotplug under certain circumstances. Convert cpu_hotplug_disabled to a counter (protected by cpu_add_remove_lock) to support e.g. disable -> disable -> enable call sequences. Signed-off-by: Vitaly Kuznetsov --- Documentation

[PATCH v4 2/2] Drivers: hv: vmbus: use cpu_hotplug_enable/disable

2015-06-24 Thread Vitaly Kuznetsov
Commit e513229b4c38 ("Drivers: hv: vmbus: prevent cpu offlining on newer hypervisors") was altering smp_ops.cpu_disable to prevent CPU offlining. We can bo better by using cpu_hotplug_enable/disable functions instead of such hard-coding. Reported-by: Radim Krčmář Signed-off-by: Vitaly

[PATCH v4 0/2] Drivers: hv: vmbus: use cpu_hotplug_enable/disable for CPU offlining prevention

2015-06-24 Thread Vitaly Kuznetsov
sable functions from cpu.c and use them instead of altering smp_ops.cpu_disable in Hyper-V vmbus module. Vitaly Kuznetsov (2): cpu-hotplug: export cpu_hotplug_enable/cpu_hotplug_disable Drivers: hv: vmbus: use cpu_hotplug_enable/disable Documentation/power/suspend-and-cpuhotplug.txt

Re: [PATCH 1/1] cpu-hotplug: export cpu_hotplug_enable/cpu_hotplug_disable

2015-06-24 Thread Vitaly Kuznetsov
Peter Zijlstra writes: > On Wed, Jun 24, 2015 at 11:43:33AM +0200, Vitaly Kuznetsov wrote: >> Peter Zijlstra writes: >> > On Tue, Jun 23, 2015 at 04:57:05PM +, KY Srinivasan wrote: >> > >> >> > diff --git a/kernel/cpu.c b/kernel/cpu.c >>

Re: [PATCH 1/1] cpu-hotplug: export cpu_hotplug_enable/cpu_hotplug_disable

2015-06-24 Thread Vitaly Kuznetsov
Thomas Gleixner writes: > On Wed, 24 Jun 2015, Vitaly Kuznetsov wrote: > >> Peter Zijlstra writes: >> >> > On Tue, Jun 23, 2015 at 04:57:05PM +, KY Srinivasan wrote: >> > >> >> > diff --git a/kernel/cpu.c b/kernel/cpu.c >> >

Re: [PATCH 1/1] cpu-hotplug: export cpu_hotplug_enable/cpu_hotplug_disable

2015-06-24 Thread Vitaly Kuznetsov
Peter Zijlstra writes: > On Tue, Jun 23, 2015 at 04:57:05PM +, KY Srinivasan wrote: > >> > diff --git a/kernel/cpu.c b/kernel/cpu.c >> > index 94bbe46..8f35ee6 100644 >> > --- a/kernel/cpu.c >> > +++ b/kernel/cpu.c >> > @@ -190,17 +190,19 @@ void cpu_hotplug_done(void) >> > void cpu_hotplug_

Re: [PATCH V2 04/10] Drivers: hv: vmbus: add special kexec handler

2015-06-23 Thread Vitaly Kuznetsov
Olaf Hering writes: > On Thu, Jun 04, K. Y. Srinivasan wrote: > >> +++ b/arch/x86/kernel/cpu/mshyperv.c >> @@ -18,6 +18,9 @@ >> #include >> #include >> #include >> +#ifdef CONFIG_KEXEC >> +#include >> +#endif > > Is this #ifdef required? > No, it's not, but other parts of the same patch d

Re: [PATCH v3 1/6] hv: Modify vmbus to search for all MMIO ranges available

2015-06-17 Thread Vitaly Kuznetsov
ja...@microsoft.com writes: > From: Jake Oshins > > Before this patch, hv_vmbus would search the ACPI namespace above its > device looking for a _CRS (current resources) object, and hunt through > the list of resources in there looking for one that described memory- > mapped I/O space above the 4

[PATCH v2 2/3] Drivers: hv: vmbus: add special kexec handler

2015-06-03 Thread Vitaly Kuznetsov
n mshyperv.c The minimalistic cleanup consists of cleaning up clockevents, synic MSRs, guest os id MSR, and hypercall MSR. Kdump doesn't require all this stuff as it lives in a separate memory space. Signed-off-by: Vitaly Kuznetsov --- arch/x86/include/asm/mshyperv.h | 2 ++ a

[PATCH v2 3/3] Drivers: hv: don't do hypercalls when hypercall_page is NULL

2015-06-03 Thread Vitaly Kuznetsov
do_hypercall() function. Unfortunately we have to write the !hypercall_page check twice to not mix declarations and code. Signed-off-by: Vitaly Kuznetsov --- drivers/hv/hv.c | 13 - 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/hv/hv.c b/drivers/hv/hv.c index 5b87042

[PATCH v2 0/3] Drivers: hv: add kexec support

2015-06-03 Thread Vitaly Kuznetsov
with balloned out memory is not possible as the newly loaded kernel doesn't know about this memory and there is no way to ask the host to bring all the memory back on cleanup (or at least I'm not aware of such a way). Kexec with hotplugged memory leads to reboot (not exactly sure why). V

[PATCH v2 1/3] Drivers: hv: vmbus: remove hv_synic_free_cpu() call from hv_synic_cleanup()

2015-06-03 Thread Vitaly Kuznetsov
We already have hv_synic_free() which frees all per-cpu pages for all CPUs, let's remove the hv_synic_free_cpu() call from hv_synic_cleanup() so it will be possible to do separate cleanup (writing to MSRs) and final freeing. This is going to be used to assist kexec. Signed-off-by: V

[PATCH 0/2] Drivers: hv: util: two fixes

2015-06-02 Thread Vitaly Kuznetsov
Fix two issues reported by Dan Carpenter and kbuild test robot. Vitaly Kuznetsov (2): Drivers: hv: kvp: check kzalloc return value Drivers: hv: fcopy: dynamically allocate smsg_out in fcopy_send_data() drivers/hv/hv_fcopy.c | 21 + drivers/hv/hv_kvp.c | 3 +++ 2 files

[PATCH 1/2] Drivers: hv: kvp: check kzalloc return value

2015-06-02 Thread Vitaly Kuznetsov
e to wait. Reported-by: Dan Carpenter Signed-off-by: Vitaly Kuznetsov --- drivers/hv/hv_kvp.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/hv/hv_kvp.c b/drivers/hv/hv_kvp.c index d85798d..74c38a9 100644 --- a/drivers/hv/hv_kvp.c +++ b/drivers/hv/hv_kvp.c @@ -353,6 +353,9 @@

[PATCH 2/2] Drivers: hv: fcopy: dynamically allocate smsg_out in fcopy_send_data()

2015-06-02 Thread Vitaly Kuznetsov
struct hv_start_fcopy is too big to be on stack on i386, the following warning is reported: >> drivers/hv/hv_fcopy.c:159:1: warning: the frame size of 1088 bytes is larger >> than 1024 bytes [-Wframe-larger-than=] Reported-by: kbuild test robot Signed-off-by: Vitaly Kuznetsov ---

Re: [patch] hv: util: checking the wrong variable

2015-06-02 Thread Vitaly Kuznetsov
Dan Carpenter writes: > We don't catch this allocation failure because there is a typo and we > check the wrong variable. > > Fixes: 14b50f80c32d ('Drivers: hv: util: introduce hv_utils_transport > abstraction') > Signed-off-by: Dan Carpenter Reviewed-b

[PATCH v3 2/2] Drivers: hv: vmbus: use cpu_hotplug_enable/disable

2015-06-02 Thread Vitaly Kuznetsov
Commit e513229b4c38 ("Drivers: hv: vmbus: prevent cpu offlining on newer hypervisors") was altering smp_ops.cpu_disable to prevent CPU offlining. We can bo better by using cpu_hotplug_enable/disable functions instead of such hard-coding. Reported-by: Radim Krčmář Signed-off-by: Vitaly

[PATCH v3 1/2] cpu-hotplug: export cpu_hotplug_enable/cpu_hotplug_disable

2015-06-02 Thread Vitaly Kuznetsov
Loaded Hyper-V module will use these functions to disable CPU hotplug under certain circumstances. Convert cpu_hotplug_disabled to a counter (protected by cpu_add_remove_lock) to support e.g. disable -> disable -> enable call sequences. Signed-off-by: Vitaly Kuznetsov --- Documentation

[PATCH v3 0/2] Drivers: hv: vmbus: use cpu_hotplug_enable/disable for CPU offlining prevention

2015-06-02 Thread Vitaly Kuznetsov
per-V vmbus module. Vitaly Kuznetsov (2): cpu-hotplug: export cpu_hotplug_enable/cpu_hotplug_disable Drivers: hv: vmbus: use cpu_hotplug_enable/disable Documentation/power/suspend-and-cpuhotplug.txt | 6 ++-- drivers/hv/vmbus_drv.c | 38 +++--- kernel/

[PATCH] Drivers: hv: vmbus: use 'die' notification chain instead of 'panic'

2015-05-28 Thread Vitaly Kuznetsov
is called manually from some other part of kernel we won't be reporting crash to the hypervisor (but we have no valuable information to report anyway). Signed-off-by: Vitaly Kuznetsov --- drivers/hv/vmbus_drv.c | 23 ++- 1 file changed, 10 insertions(+), 13 deletions(-

Re: [PATCH v2 0/2] Drivers: hv: vmbus: use cpu_hotplug_enable/disable for CPU offlining prevention

2015-05-27 Thread Vitaly Kuznetsov
KY Srinivasan writes: >> -Original Message- >> From: Vitaly Kuznetsov [mailto:vkuzn...@redhat.com] >> Sent: Thursday, May 21, 2015 9:22 AM >> To: de...@linuxdriverproject.org >> Cc: KY Srinivasan; Haiyang Zhang; linux-ker...@vger.kernel.org; Dexuan Cui; &g

[PATCH v2 0/2] Drivers: hv: vmbus: use cpu_hotplug_enable/disable for CPU offlining prevention

2015-05-21 Thread Vitaly Kuznetsov
Changes since v1: - Make cpu_hotplug_disabled a counter [Radim Krčmář] Export cpu_hotplug_enable/cpu_hotplug_disable functions from cpu.c and use them instead of altering smp_ops.cpu_disable in Hyper-V vmbus module. Vitaly Kuznetsov (2): cpu-hotplug: export cpu_hotplug_enable

[PATCH v2 2/2] Drivers: hv: vmbus: use cpu_hotplug_enable/disable

2015-05-21 Thread Vitaly Kuznetsov
Commit e513229b4c38 ("Drivers: hv: vmbus: prevent cpu offlining on newer hypervisors") was altering smp_ops.cpu_disable to prevent CPU offlining. We can bo better by using cpu_hotplug_enable/disable functions instead of such hard-coding. Reported-by: Radim Krčmář Signed-off-by: Vitaly

[PATCH v2 1/2] cpu-hotplug: export cpu_hotplug_enable/cpu_hotplug_disable

2015-05-21 Thread Vitaly Kuznetsov
Loaded Hyper-V module will use these functions to disable CPU hotplug under certain circumstances. Convert cpu_hotplug_disabled to a counter (protected by cpu_add_remove_lock) to support e.g. disable -> disable -> enable call sequences. Signed-off-by: Vitaly Kuznetsov --- Documentation

[PATCH 2/3] Drivers: hv: vmbus: add special kexec handler

2015-05-20 Thread Vitaly Kuznetsov
n mshyperv.c The minimalistic cleanup consists of cleaning up clockevents, synic MSRs, guest os id MSR, and hypercall MSR. Kdump doesn't require all this stuff as it lives in a separate memory space. Signed-off-by: Vitaly Kuznetsov --- arch/x86/include/asm/mshyperv.h | 2 ++ a

[PATCH 3/3] Drivers: hv: don't do hypercalls when hypercall_page is NULL

2015-05-20 Thread Vitaly Kuznetsov
do_hypercall() function. Unfortunately we have to write the !hypercall_page check twice to not mix declarations and code. Signed-off-by: Vitaly Kuznetsov --- drivers/hv/hv.c | 13 - 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/hv/hv.c b/drivers/hv/hv.c index 5b87042

[PATCH 1/3] Drivers: hv: vmbus: remove hv_synic_free_cpu() call from hv_synic_cleanup()

2015-05-20 Thread Vitaly Kuznetsov
We already have hv_synic_free() which frees all per-cpu pages for all CPUs, let's remove the hv_synic_free_cpu() call from hv_synic_cleanup() so it will be possible to do separate cleanup (writing to MSRs) and final freeing. This is going to be used to assist kexec. Signed-off-by: V

[PATCH 0/3] Drivers: hv: add kexec support

2015-05-20 Thread Vitaly Kuznetsov
] Drivers: hv: vmbus: Cleanup the vmbus unload path" Vitaly Kuznetsov (3): Drivers: hv: vmbus: remove hv_synic_free_cpu() call from hv_synic_cleanup() Drivers: hv: vmbus: add special kexec handler Drivers: hv: don't do hypercalls when hypercall_page is NULL arch/x86/include/as

Re: [PATCH 1/2] cpu-hotplug: export cpu_hotplug_enable/cpu_hotplug_disable

2015-05-19 Thread Vitaly Kuznetsov
Peter Zijlstra writes: > On Tue, May 19, 2015 at 02:15:41PM +0200, Vitaly Kuznetsov wrote: >> Loaded Hyper-V module will use these functions to disable CPU hotplug >> under certain circumstances. > > What's wrong with get_online_cpus() ? We need to disable cpu offli

[PATCH 2/2] Drivers: hv: vmbus: use cpu_hotplug_enable/disable

2015-05-19 Thread Vitaly Kuznetsov
Commit e513229b4c38 ("Drivers: hv: vmbus: prevent cpu offlining on newer hypervisors") was alteringd smp_ops.cpu_disable to prevent CPU offlining. We can bo better by using cpu_hotplug_enable/disable functions instead of such hard-coding. Reported-by: Radim Krčmář Signed-off-by: Vitaly

[PATCH 1/2] cpu-hotplug: export cpu_hotplug_enable/cpu_hotplug_disable

2015-05-19 Thread Vitaly Kuznetsov
Loaded Hyper-V module will use these functions to disable CPU hotplug under certain circumstances. Signed-off-by: Vitaly Kuznetsov --- kernel/cpu.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kernel/cpu.c b/kernel/cpu.c index 94bbe46..dc005e7 100644 --- a/kernel/cpu.c

[PATCH 0/2] Drivers: hv: vmbus: use cpu_hotplug_enable/disable for CPU offlining prevention

2015-05-19 Thread Vitaly Kuznetsov
Export cpu_hotplug_enable/cpu_hotplug_disable functions from cpu.c and use them instead of altering the smp_ops.cpu_disable in Hyper-V vmbus module. Vitaly Kuznetsov (2): cpu-hotplug: export cpu_hotplug_enable/cpu_hotplug_disable Drivers: hv: vmbus: use cpu_hotplug_enable/disable drivers/hv

[PATCH] Drivers: hv: balloon: check if ha_region_mutex was acquired in MEM_CANCEL_ONLINE case

2015-05-19 Thread Vitaly Kuznetsov
after the hv_memory_notifier() in the notification chain failed so we need to add the mutex_is_locked() check. In case of MEM_ONLINE we are always supposed to have the mutex locked. Signed-off-by: Vitaly Kuznetsov --- drivers/hv/hv_balloon.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) dif

Re: [PATCH v2 3/3] Drivers: hv: vmbus: setup irq after synic is initialized

2015-05-12 Thread Vitaly Kuznetsov
KY Srinivasan writes: >> -Original Message- >> From: Vitaly Kuznetsov [mailto:vkuzn...@redhat.com] >> Sent: Tuesday, April 21, 2015 9:22 AM >> To: KY Srinivasan >> Cc: Haiyang Zhang; de...@linuxdriverproject.org; linux- >> ker...@vger.kernel.org;

[PATCH v2 4/6] Drivers: hv: vmbus: move init_vp_index() call to vmbus_process_offer()

2015-04-27 Thread Vitaly Kuznetsov
. This is a small refactoring without a functional change. Signed-off-by: Vitaly Kuznetsov --- drivers/hv/channel_mgmt.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c index c53a171..655c0a0 100644 --- a/drivers/hv

[PATCH v2 1/6] Drivers: hv: vmbus: unify calls to percpu_channel_enq()

2015-04-27 Thread Vitaly Kuznetsov
Remove some code duplication, no functional change intended. Signed-off-by: Vitaly Kuznetsov --- drivers/hv/channel_mgmt.c | 51 +-- 1 file changed, 18 insertions(+), 33 deletions(-) diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c

[PATCH v2 0/6] Drivers: hv: vmbus: fair round robin algorithm for vmbus_get_outgoing_channel()

2015-04-27 Thread Vitaly Kuznetsov
Patch 06) (this is not true anymore, see 'Changes'). Patches 01 - 04 are cleanup/refactoring. Vitaly Kuznetsov (6): Drivers: hv: vmbus: unify calls to percpu_channel_enq() Drivers: hv: vmbus: briefly comment num_sc and next_oc Drivers: hv: vmbus: decrease num_sc on subchannel

[PATCH v2 6/6] Drivers: hv: vmbus: improve selection of an outgoing channel

2015-04-27 Thread Vitaly Kuznetsov
u, use round-robin as a fallback. Signed-off-by: Vitaly Kuznetsov --- drivers/hv/channel_mgmt.c | 39 +++ 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c index 1f1417d..cdc3914 100644 --- a/drivers/

[PATCH v2 5/6] Drivers: hv: vmbus: distribute subchannels among all vcpus

2015-04-27 Thread Vitaly Kuznetsov
. Signed-off-by: Vitaly Kuznetsov --- drivers/hv/channel_mgmt.c | 29 - 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c index 655c0a0..1f1417d 100644 --- a/drivers/hv/channel_mgmt.c +++ b/drivers/hv

[PATCH v2 3/6] Drivers: hv: vmbus: decrease num_sc on subchannel removal

2015-04-27 Thread Vitaly Kuznetsov
It is unlikely that that host will ask us to close only one subchannel for a device but let's be consistent. Do both num_sc++ and num_sc-- with channel->lock to be on the safe side. Signed-off-by: Vitaly Kuznetsov --- drivers/hv/channel_mgmt.c | 3 ++- 1 file changed, 2 insertio

[PATCH v2 2/6] Drivers: hv: vmbus: briefly comment num_sc and next_oc

2015-04-27 Thread Vitaly Kuznetsov
next_oc and num_sc fields of struct vmbus_channel deserve a description. Move them closer to sc_list as these fields are related to it. Signed-off-by: Vitaly Kuznetsov --- include/linux/hyperv.h | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/include/linux

Re: [PATCH 5/6] Drivers: hv: vmbus: distribute subchannels among all vcpus

2015-04-27 Thread Vitaly Kuznetsov
KY Srinivasan writes: >> -Original Message- >> From: Vitaly Kuznetsov [mailto:vkuzn...@redhat.com] >> Sent: Friday, April 24, 2015 2:05 AM >> To: Dexuan Cui >> Cc: KY Srinivasan; Haiyang Zhang; de...@linuxdriverproject.org; linux- >> ker...@vger.k

Re: [PATCH v2 0/3] Drivers: hv: vmbus: additional fixes for the setup/teardown path

2015-04-24 Thread Vitaly Kuznetsov
Dexuan Cui writes: >> -Original Message- >> From: Vitaly Kuznetsov [mailto:vkuzn...@redhat.com] >> Sent: Wednesday, April 22, 2015 0:22 >> To: KY Srinivasan >> Cc: Haiyang Zhang; de...@linuxdriverproject.org; linux- >> ker...@vger.kernel.org; Dexuan C

Re: [PATCH 5/6] Drivers: hv: vmbus: distribute subchannels among all vcpus

2015-04-24 Thread Vitaly Kuznetsov
Dexuan Cui writes: >> -Original Message- >> From: Vitaly Kuznetsov [mailto:vkuzn...@redhat.com] >> Sent: Tuesday, April 21, 2015 22:28 >> To: KY Srinivasan >> Cc: Haiyang Zhang; de...@linuxdriverproject.org; linux- >> ker...@vger.kernel.org; Dexuan Cui

Re: [PATCH 6/6] Drivers: hv: vmbus: do a fair round robin when selecting an outgoing channel

2015-04-24 Thread Vitaly Kuznetsov
Dexuan Cui writes: >> -Original Message- >> From: Vitaly Kuznetsov [mailto:vkuzn...@redhat.com] >> Sent: Tuesday, April 21, 2015 22:28 >> To: KY Srinivasan >> Cc: Haiyang Zhang; de...@linuxdriverproject.org; linux- >> ker...@vger.kernel.org; Dexuan Cui

Re: [PATCH 4/6] Drivers: hv: vmbus: move init_vp_index() call to vmbus_process_offer()

2015-04-24 Thread Vitaly Kuznetsov
Dexuan Cui writes: >> -Original Message- >> From: Vitaly Kuznetsov [mailto:vkuzn...@redhat.com] >> Sent: Tuesday, April 21, 2015 22:28 >> To: KY Srinivasan >> Cc: Haiyang Zhang; de...@linuxdriverproject.org; linux- >> ker...@vger.kernel.org; Dexuan Cui

Re: [PATCH 3/6] Drivers: hv: vmbus: decrease num_sc on subchannel removal

2015-04-24 Thread Vitaly Kuznetsov
Dexuan Cui writes: >> -Original Message- >> From: Vitaly Kuznetsov [mailto:vkuzn...@redhat.com] >> Sent: Tuesday, April 21, 2015 22:28 >> To: KY Srinivasan >> Cc: Haiyang Zhang; de...@linuxdriverproject.org; linux- >> ker...@vger.kernel.org; Dexuan Cui

Re: [PATCH net-next, 1/1] hv_netvsc: call dump_rndis_message() only in netvsc debug mode

2015-04-22 Thread Vitaly Kuznetsov
six...@microsoft.com writes: > From: Simon Xiao > > Signed-off-by: Simon Xiao > Reviewed-by: K. Y. Srinivasan > Reviewed-by: Haiyang Zhang I don't quite understand what problem is being solved here (and empty commit message doesn't is not very helpful). netdev_dbg() is not being printed by d

[PATCH v2 3/3] Drivers: hv: vmbus: setup irq after synic is initialized

2015-04-21 Thread Vitaly Kuznetsov
vmbus_isr() uses synic pages which are being setup in hv_synic_alloc(), we need to register this irq handler only after we allocate all the required pages. Signed-off-by: Vitaly Kuznetsov --- drivers/hv/vmbus_drv.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers

[PATCH v2 1/3] Drivers: hv: vmbus: do cleanup on all vmbus_open() failure paths

2015-04-21 Thread Vitaly Kuznetsov
_info->response.open_result.status as the return value as all other errors we return from vmbus_open() are -EXXX and vmbus_open() callers are not supposed to analyze host error codes. Signed-off-by: Vitaly Kuznetsov --- drivers/hv/channel.c | 13 ++--- 1 file changed, 6 insertions(+), 7 deletions(-) diff

[PATCH v2 2/3] Drivers: hv: vmbus: kill tasklets on module unload

2015-04-21 Thread Vitaly Kuznetsov
Explicitly kill tasklets we create on module unload. Signed-off-by: Vitaly Kuznetsov --- drivers/hv/vmbus_drv.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c index 2b56260..cf20400 100644 --- a/drivers/hv/vmbus_drv.c

[PATCH v2 0/3] Drivers: hv: vmbus: additional fixes for the setup/teardown path

2015-04-21 Thread Vitaly Kuznetsov
vmbus unload path" series (with the fix I suggested). I tested the whole set on Gen2 Win2012R2 guest, load/unload path seems being stable. Can you please take a look? Thanks, Vitaly Kuznetsov (3): Drivers: hv: vmbus: do cleanup on all vmbus_open() failure paths Drivers: hv: vmbus: kill ta

[PATCH 1/6] Drivers: hv: vmbus: unify calls to percpu_channel_enq()

2015-04-21 Thread Vitaly Kuznetsov
Remove some code duplication, no functional change intended. Signed-off-by: Vitaly Kuznetsov --- drivers/hv/channel_mgmt.c | 51 +-- 1 file changed, 18 insertions(+), 33 deletions(-) diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c

[PATCH 2/6] Drivers: hv: vmbus: briefly comment num_sc and next_oc

2015-04-21 Thread Vitaly Kuznetsov
next_oc and num_sc fields of struct vmbus_channel deserve a description. Move them closer to sc_list as these fields are related to it. Signed-off-by: Vitaly Kuznetsov --- include/linux/hyperv.h | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/include/linux

[PATCH 3/6] Drivers: hv: vmbus: decrease num_sc on subchannel removal

2015-04-21 Thread Vitaly Kuznetsov
It is unlikely that that host will ask us to close only one subchannel for a device but let's be consistent. Do both num_sc++ and num_sc-- with channel->lock to be on the safe side. Signed-off-by: Vitaly Kuznetsov --- drivers/hv/channel_mgmt.c | 3 ++- 1 file changed, 2 insertio

[PATCH 4/6] Drivers: hv: vmbus: move init_vp_index() call to vmbus_process_offer()

2015-04-21 Thread Vitaly Kuznetsov
. This is a small refactoring without a functional change. Signed-off-by: Vitaly Kuznetsov --- drivers/hv/channel_mgmt.c | 142 +++--- 1 file changed, 71 insertions(+), 71 deletions(-) diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c index

[PATCH 6/6] Drivers: hv: vmbus: do a fair round robin when selecting an outgoing channel

2015-04-21 Thread Vitaly Kuznetsov
hecking for current cpu aslo creates additional complexity. Simplify the vmbus_get_outgoing_channel() function, make it do what the comment before it says. Signed-off-by: Vitaly Kuznetsov --- drivers/hv/channel_mgmt.c | 27 +-- 1 file changed, 9 insertions(+), 18 del

[PATCH 5/6] Drivers: hv: vmbus: distribute subchannels among all vcpus

2015-04-21 Thread Vitaly Kuznetsov
. Signed-off-by: Vitaly Kuznetsov --- drivers/hv/channel_mgmt.c | 29 - 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c index 8f2761f..daa6417 100644 --- a/drivers/hv/channel_mgmt.c +++ b/drivers/hv

[PATCH 0/6] Drivers: hv: vmbus: fair round robin algorithm for vmbus_get_outgoing_channel()

2015-04-21 Thread Vitaly Kuznetsov
o subchannel for the current vcpu). Please let me know if you think it is preferable. Vitaly Kuznetsov (6): Drivers: hv: vmbus: unify calls to percpu_channel_enq() Drivers: hv: vmbus: briefly comment num_sc and next_oc Drivers: hv: vmbus: decrease num_sc on subchannel removal Driv

Re: [PATCH 1/3] Drivers: hv: vmbus: do cleanup on all vmbus_open() failure paths

2015-04-21 Thread Vitaly Kuznetsov
Dan Carpenter writes: > On Tue, Apr 21, 2015 at 10:17:52AM +0200, Vitaly Kuznetsov wrote: >> diff --git a/drivers/hv/channel.c b/drivers/hv/channel.c >> index 54da66d..836386f 100644 >> --- a/drivers/hv/channel.c >> +++ b/drivers/hv/channel.c >> @@ -186,11

Re: [PATCH 1/3] Drivers: hv: vmbus: do cleanup on all vmbus_open() failure paths

2015-04-21 Thread Vitaly Kuznetsov
Dexuan Cui writes: >> -Original Message- >> From: Vitaly Kuznetsov [mailto:vkuzn...@redhat.com] >> Sent: Tuesday, April 21, 2015 16:18 >> To: KY Srinivasan >> Cc: Haiyang Zhang; de...@linuxdriverproject.org; linux- >> ker...@vger.kernel.org; Dexuan Cui

[PATCH 0/3] Drivers: hv: vmbus: additional fixes for the setup/teardown path

2015-04-21 Thread Vitaly Kuznetsov
K. Y., here are 3 additional patches for your "[PATCH 0/5] Drivers: hv: vmbus: Cleanup the vmbus unload path" series (with the fix I suggested). I tested the whole set on Gen2 Win2012R2 guest, load/unload path seems being stable. Can you please take a look? Thanks, Vitaly Ku

[PATCH 3/3] Drivers: hv: vmbus: setup irq after synic is initialized

2015-04-21 Thread Vitaly Kuznetsov
vmbus_isr() uses synic pages which are being setup in hv_synic_alloc(), we need to register this irq handler only after we allocate all the required pages. Signed-off-by: Vitaly Kuznetsov --- drivers/hv/vmbus_drv.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers

[PATCH 2/3] Drivers: hv: vmbus: kill tasklets on module unload

2015-04-21 Thread Vitaly Kuznetsov
Explicitly kill tasklets we create on module unload. Signed-off-by: Vitaly Kuznetsov --- drivers/hv/vmbus_drv.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c index 2b56260..cf20400 100644 --- a/drivers/hv/vmbus_drv.c

[PATCH 1/3] Drivers: hv: vmbus: do cleanup on all vmbus_open() failure paths

2015-04-21 Thread Vitaly Kuznetsov
In case there was an error reported in the response to the CHANNELMSG_OPENCHANNEL call we need to do the cleanup as a vmbus_open() user won't be doing it after receiving an error. The cleanup should be done on all failure paths. Signed-off-by: Vitaly Kuznetsov --- drivers/hv/channel.

Re: [PATCH 5/5] Drivers: hv: vmbus: Implement the protocol for tearing down vmbus state

2015-04-20 Thread Vitaly Kuznetsov
KY Srinivasan writes: >> -Original Message- >> From: Vitaly Kuznetsov [mailto:vkuzn...@redhat.com] >> Sent: Monday, April 20, 2015 2:40 AM >> To: KY Srinivasan >> Cc: gre...@linuxfoundation.org; linux-ker...@vger.kernel.org; >> de...@linux

Re: [PATCH 5/5] Drivers: hv: vmbus: Implement the protocol for tearing down vmbus state

2015-04-20 Thread Vitaly Kuznetsov
Vitaly Kuznetsov writes: > "K. Y. Srinivasan" writes: > >> Implement the protocol for tearing down the monitor state established with >> the host. >> >> Signed-off-by: K. Y. Srinivasan > > Unfortunatelly this patch leads to the following crash

<    3   4   5   6   7   8   9   10   >