[PATCH V2 15/15] hyperv: Add a function to detect if the device is a vmbus dev

2016-12-03 Thread kys
From: Haiyang Zhang On Hyper-V, every VF interface has a corresponding synthetic interface managed by netvsc that share the same MAC address. netvsc registers for netdev events to manage this association. Currently we use the MAC address to manage this association but going forward, we want to us

[PATCH V2 14/15] Tools: hv: kvp: configurable external scripts path

2016-12-03 Thread kys
From: Alex Fluter error when running hypervkvpd: $ sudo ./hv_kvp_daemon -n sh: hv_get_dns_info: command not found sh: hv_get_dhcp_info: command not found sh: hv_get_dns_info: command not found sh: hv_get_dhcp_info: command not found The external scripts are not installed in system path, adding

[PATCH V2 04/15] Drivers: hv: vmbus: Enhance the rescind callback functionality

2016-12-03 Thread kys
From: K. Y. Srinivasan Enhance the rescind callback functionality by permitting the passing of an opaque pointer. This functionality will be used by vmbus device drivers to implement rescind related cleanup more efficiently. Signed-off-by: K. Y. Srinivasan --- drivers/hv/channel_mgmt.c | 11

[PATCH V2 05/15] hv: acquire vmbus_connection.channel_mutex in vmbus_free_channels()

2016-12-03 Thread kys
From: Vitaly Kuznetsov "kernel BUG at drivers/hv/channel_mgmt.c:350!" is observed when hv_vmbus module is unloaded. BUG_ON() was introduced in commit 85d9aa705184 ("Drivers: hv: vmbus: add an API vmbus_hvsock_device_unregister()") as vmbus_free_channels() codepath was apparently forgotten. Fixes

[PATCH V2 09/15] hv: switch to cpuhp state machine for synic init/cleanup

2016-12-03 Thread kys
From: Vitaly Kuznetsov To make it possible to online/offline CPUs switch to cpuhp infrastructure for doing hv_synic_init()/hv_synic_cleanup(). Signed-off-by: Vitaly Kuznetsov Signed-off-by: K. Y. Srinivasan --- drivers/hv/hv.c | 15 +++ drivers/hv/hyperv_vmbus.h |4

[PATCH V2 07/15] hv: init percpu_list in hv_synic_alloc()

2016-12-03 Thread kys
From: Vitaly Kuznetsov Initializing hv_context.percpu_list in hv_synic_alloc() helps to prevent a crash in percpu_channel_enq() when not all CPUs were online during initialization and it naturally belongs there. Signed-off-by: Vitaly Kuznetsov Signed-off-by: K. Y. Srinivasan --- drivers/hv/hv

[PATCH V2 08/15] hv: change clockevents unbind tactics

2016-12-03 Thread kys
From: Vitaly Kuznetsov To get prepared to CPU offlining support we need co change the way how we unbind clockevent devices. As one CPU may go online/offline multiple times we need to bind it in hv_synic_init() and unbind it in hv_synic_cleanup(). There is an additional corner case: when we unload

[PATCH V2 03/15] Drivers: hv: vmbus: Prevent sending data on a rescinded channel

2016-12-03 Thread kys
From: K. Y. Srinivasan After the channel is rescinded, the host does not read from the rescinded channel. Fail writes to a channel that has already been rescinded. Signed-off-by: K. Y. Srinivasan --- drivers/hv/ring_buffer.c |3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff -

[PATCH 0/5] Drivers: hv: vmbus: Some miscellaneous fixes

2016-12-06 Thread kys
From: K. Y. Srinivasan Some miscellaneous fixes. K. Y. Srinivasan (1): Drivers: hv: vmbus: Prevent sending data on a rescinded channel Vitaly Kuznetsov (4): Drivers: hv: vmbus: Raise retry/wait limits in vmbus_post_msg() hv: allocate synic pages for all present CPUs hv: init percpu_list

[PATCH 3/5] hv: init percpu_list in hv_synic_alloc()

2016-12-06 Thread kys
From: Vitaly Kuznetsov Initializing hv_context.percpu_list in hv_synic_alloc() helps to prevent a crash in percpu_channel_enq() when not all CPUs were online during initialization and it naturally belongs there. Signed-off-by: Vitaly Kuznetsov Signed-off-by: K. Y. Srinivasan Cc: --- drivers/

[PATCH 2/5] hv: allocate synic pages for all present CPUs

2016-12-06 Thread kys
From: Vitaly Kuznetsov It may happen that not all CPUs are online when we do hv_synic_alloc() and in case more CPUs come online later we may try accessing these allocated structures. Signed-off-by: Vitaly Kuznetsov Signed-off-by: K. Y. Srinivasan Cc: --- drivers/hv/hv.c |4 ++-- 1 files

[PATCH 4/5] hv: don't reset hv_context.tsc_page on crash

2016-12-06 Thread kys
From: Vitaly Kuznetsov It may happen that secondary CPUs are still alive and resetting hv_context.tsc_page will cause a consequent crash in read_hv_clock_tsc() as we don't check for it being not NULL there. It is safe as we're not freeing this page anyways. Signed-off-by: Vitaly Kuznetsov Signe

[PATCH 5/5] Drivers: hv: vmbus: Prevent sending data on a rescinded channel

2016-12-06 Thread kys
From: K. Y. Srinivasan After the channel is rescinded, the host does not read from the rescinded channel. Fail writes to a channel that has already been rescinded. If we permit writes on a rescinded channel, since the host will not respond we will have situations where we will be unable to unlo

[PATCH 1/5] Drivers: hv: vmbus: Raise retry/wait limits in vmbus_post_msg()

2016-12-06 Thread kys
From: Vitaly Kuznetsov DoS protection conditions were altered in WS2016 and now it's easy to get -EAGAIN returned from vmbus_post_msg() (e.g. when we try changing MTU on a netvsc device in a loop). All vmbus_post_msg() callers don't retry the operation and we usually end up with a non-functional

[PATCH 0/2] Drivers: hv: vmbus: Make CPU offlining more fine grained

2016-12-07 Thread kys
From: K. Y. Srinivasan Enhance CPU online/offline management. Vitaly Kuznetsov (2): hv: switch to cpuhp state machine for synic init/cleanup hv: make CPU offlining prevention fine-grained drivers/hv/hv.c | 46 +--- drivers/hv/hyperv_vmbus

[PATCH 1/2] hv: switch to cpuhp state machine for synic init/cleanup

2016-12-07 Thread kys
From: Vitaly Kuznetsov To make it possible to online/offline CPUs switch to cpuhp infrastructure for doing hv_synic_init()/hv_synic_cleanup(). Signed-off-by: Vitaly Kuznetsov Signed-off-by: K. Y. Srinivasan --- drivers/hv/hv.c | 15 +++ drivers/hv/hyperv_vmbus.h |4

[PATCH 2/2] hv: make CPU offlining prevention fine-grained

2016-12-07 Thread kys
From: Vitaly Kuznetsov Since commit e513229b4c38 ("Drivers: hv: vmbus: prevent cpu offlining on newer hypervisors") cpu offlining was disabled. It is still true that we can't offline CPUs which have VMBus channels bound to them but we may have 'free' CPUs (e.v. we booted with maxcpus= parameter a

[PATCH 0/3] Drivers: hv: Implement VF association based on serial number

2016-12-07 Thread kys
From: K. Y. Srinivasan Implement VF association based on serial number published by the host. Greg, as promised here is the patchset that would use the API for detecting if the device is a vmbus device. If you can take the first two patches, we can submit the netvsc patch to the net-next tree.

[PATCH 2/3] hyperv: Add a function to detect if the device is a vmbus dev

2016-12-07 Thread kys
From: Haiyang Zhang On Hyper-V, every VF interface has a corresponding synthetic interface managed by netvsc that share the same MAC address. netvsc registers for netdev events to manage this association. Currently we use the MAC address to manage this association but going forward, we want to us

[PATCH 1/3] hyperv: Move hv_pci_dev and related structs to hyperv.h

2016-12-07 Thread kys
From: Haiyang Zhang Move some vPCI data structures to hyperv.h, because we share them with other module. Signed-off-by: Haiyang Zhang Signed-off-by: K. Y. Srinivasan --- drivers/pci/host/pci-hyperv.c | 91 -- include/linux/hyperv.h| 98 +

[PATCH 3/3] hv_netvsc: Implement VF matching based on serial numbers

2016-12-07 Thread kys
From: Haiyang Zhang We currently use MAC address to match VF and synthetic NICs. Hyper-V provides a serial number to both devices for this purpose. This patch implements the matching based on VF serial numbers. This is the way specified by the protocol and more reliable. Signed-off-by: Haiyang Z

[PATCH 0/6] storvsc: Miscellaneous fixes and enhancements

2016-12-14 Thread kys
From: K. Y. Srinivasan Miscellaneous fixes and enhancements. K. Y. Srinivasan (3): storvsc: Enable tracking of queue depth storvsc: Remove the restriction on max segment size storvsc: Enable multi-queue support Long Li (3): storvsc: use tagged SRB requests if supported by the device s

[PATCH 6/6] storvsc: properly set residual data length on errors

2016-12-14 Thread kys
From: Long Li On I/O errors, the Windows driver doesn't set data_transfer_length on error conditions other than SRB_STATUS_DATA_OVERRUN. In these cases we need to set data_transfer_length to 0, indicating there is no data transferred. On SRB_STATUS_DATA_OVERRUN, data_transfer_length is set by the

[PATCH 4/6] storvsc: use tagged SRB requests if supported by the device

2016-12-14 Thread kys
From: Long Li Properly set SRB flags when hosting device supports tagged queuing. This patch improves the performance on Fiber Channel disks. Signed-off-by: Long Li Reviewed-by: K. Y. Srinivasan Signed-off-by: K. Y. Srinivasan Cc: --- drivers/scsi/storvsc_drv.c |9 + 1 files cha

[PATCH 2/6] storvsc: Remove the restriction on max segment size

2016-12-14 Thread kys
From: K. Y. Srinivasan Remove the artificially imposed restriction on max segment size. Signed-off-by: K. Y. Srinivasan Reviewed-by: Long Li --- drivers/scsi/storvsc_drv.c |2 -- 1 files changed, 0 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storv

[PATCH 1/6] storvsc: Enable tracking of queue depth

2016-12-14 Thread kys
From: K. Y. Srinivasan Enable tracking of queue depth. Signed-off-by: K. Y. Srinivasan Reviewed-by: Long Li --- drivers/scsi/storvsc_drv.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c index 05526b7..ccb2101 10

[PATCH 3/6] storvsc: Enable multi-queue support

2016-12-14 Thread kys
From: K. Y. Srinivasan Enable multi-q support. We will allocate the outgoing channel using the following policy: 1. We will make every effort to pick a channel that is in the same NUMA node that is initiating the I/O 2. The mapping between the guest CPU and the outgoin

[PATCH 5/6] storvsc: properly handle SRB_ERROR when sense message is present

2016-12-14 Thread kys
From: Long Li When sense message is present on error, we should pass along to the upper layer to decide how to deal with the error. This patch fixes connectivity issues with Fiber Channel devices. Signed-off-by: Long Li Reviewed-by: K. Y. Srinivasan Signed-off-by: K. Y. Srinivasan Cc: --- d

[PATCH 0/4] Drivers: hv: Fix some rescind handling issues

2016-12-22 Thread kys
From: K. Y. Srinivasan Fix some rescind handling issues. K. Y. Srinivasan (4): Drivers: hv: vmbus: Fix a rescind handling bug Drivers: hv: util: kvp: Fix a rescind processing issue Drivers: hv: util: Fcopy: Fix a rescind processing issue Drivers: hv: util: Backup: Fix a rescind processin

[PATCH 1/4] Drivers: hv: vmbus: Fix a rescind handling bug

2016-12-22 Thread kys
From: K. Y. Srinivasan The host can rescind a channel that has been offered to the guest and once the channel is rescinded, the host does not respond to any requests on that channel. Deal with the case where the guest may be blocked waiting for a response from the host. Signed-off-by: K. Y. Srin

[PATCH 3/4] Drivers: hv: util: Fcopy: Fix a rescind processing issue

2016-12-22 Thread kys
From: K. Y. Srinivasan Fcopy may use a char device to support the communication between the user level daemon and the driver. When the Fcopy channel is rescinded we need to make sure that the char device is fully cleaned up before we can process a new Fcopy offer from the host. Implement this log

[PATCH 4/4] Drivers: hv: util: Backup: Fix a rescind processing issue

2016-12-22 Thread kys
From: K. Y. Srinivasan VSS may use a char device to support the communication between the user level daemon and the driver. When the VSS channel is rescinded we need to make sure that the char device is fully cleaned up before we can process a new VSS offer from the host. Implement this logic. S

[PATCH 2/4] Drivers: hv: util: kvp: Fix a rescind processing issue

2016-12-22 Thread kys
From: K. Y. Srinivasan KVP may use a char device to support the communication between the user level daemon and the driver. When the KVP channel is rescinded we need to make sure that the char device is fully cleaned up before we can process a new KVP offer from the host. Implement this logic. S

[PATCH 00/18] Drivers: hv: vmbus: Restructure architecture specific code

2016-12-30 Thread kys
From: K. Y. Srinivasan The current Hyper-V code under drivers/hv has bunch of X86 specific code. Restructure the code and move al architecture specific code to the appropriate files. As I was working on this restructuring, Roman Kagan has submitted patches to restructure the Hyper-V header file

[PATCH 10/18] Drivers: hv: vmbus: Restructure the clockevents code

2016-12-30 Thread kys
From: K. Y. Srinivasan Move the relevant code that programs the hypervisor to an architecture specific file. Signed-off-by: K. Y. Srinivasan --- arch/x86/include/asm/mshyperv.h |4 drivers/hv/hv.c | 10 +- 2 files changed, 9 insertions(+), 5 deletions(-) dif

[PATCH 11/18] Drivers: hv: util: Use hv_get_current_tick() to get current tick

2016-12-30 Thread kys
From: K. Y. Srinivasan As part of the effort to interact with Hyper-V in an instruction set architecture independent way, use the new API to get the current tick. Signed-off-by: K. Y. Srinivasan --- drivers/hv/hv_util.c |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a

[PATCH 15/18] Drivers: hv: vmbus: Define APIs to manipulate the synthetic interrupt controller

2016-12-30 Thread kys
From: K. Y. Srinivasan As part of cleaning up architecture specific code, define APIs to manipulate the interrupt controller state. Signed-off-by: K. Y. Srinivasan --- arch/x86/include/asm/mshyperv.h |3 +++ drivers/hv/hv.c |8 2 files changed, 7 insertions(+),

[PATCH 07/18] Drivers: hv: vmbus: Move the crash notification function

2016-12-30 Thread kys
From: K. Y. Srinivasan As part of the effort to separate out architecture specific code, move the crash notification function. Signed-off-by: K. Y. Srinivasan --- arch/x86/hyperv/hv_init.c | 26 ++ arch/x86/include/asm/mshyperv.h|1 + arch/x86/include

[PATCH 18/18] Drivers: hv: vmbus: Cleanup hyperv_vmbus.h

2016-12-30 Thread kys
From: K. Y. Srinivasan Get rid of all unused definitions. Signed-off-by: K. Y. Srinivasan --- drivers/hv/hyperv_vmbus.h | 152 + 1 files changed, 2 insertions(+), 150 deletions(-) diff --git a/drivers/hv/hyperv_vmbus.h b/drivers/hv/hyperv_vmbus.h i

[PATCH 08/18] Drivers: hv: vmbus: Move the check for hypercall page setup

2016-12-30 Thread kys
From: K. Y. Srinivasan As part of the effort to separate out architecture specific code, move the check for detecting if the hypercall page is setup. Signed-off-by: K. Y. Srinivasan --- arch/x86/hyperv/hv_init.c | 15 +++ arch/x86/include/asm/mshyperv.h |1 + drivers/hv

[PATCH 01/18] Drivers: hv: vmbus: Move the definition of hv_x64_msr_hypercall_contents

2016-12-30 Thread kys
From: K. Y. Srinivasan As part of the effort to separate out architecture specific code, move the definition of hv_x64_msr_hypercall_contents to x86 specific header file. Signed-off-by: K. Y. Srinivasan --- arch/x86/include/asm/mshyperv.h | 12 drivers/hv/hyperv_vmbus.h |

[PATCH 09/18] Drivers: hv: vmbus: Move the code to signal end of message

2016-12-30 Thread kys
From: K. Y. Srinivasan As part of the effort to separate out architecture specific code, move the code for signaling end of message. Signed-off-by: K. Y. Srinivasan --- arch/x86/include/asm/mshyperv.h | 37 + drivers/hv/channel_mgmt.c |1 + drive

[PATCH 06/18] Drivers: hv: vmbus: Move the extracting of Hypervisor version information

2016-12-30 Thread kys
From: K. Y. Srinivasan As part of the effort to separate out architecture specific code, extract hypervisor version information in an architecture specific file. Signed-off-by: K. Y. Srinivasan --- arch/x86/include/asm/mshyperv.h | 19 +++ arch/x86/kernel/cpu/mshyperv.c | 20 +

[PATCH 12/18] Drivers: hv: vmbus: Get rid of an unsused variable

2016-12-30 Thread kys
From: K. Y. Srinivasan The version variable while it is initialized is not used; get rid of it. Signed-off-by: K. Y. Srinivasan --- drivers/hv/hv.c |4 1 files changed, 0 insertions(+), 4 deletions(-) diff --git a/drivers/hv/hv.c b/drivers/hv/hv.c index 0afffd8..5a2a329 100644 --- a/

[PATCH 02/18] Drivers: hv: vmbus: Move the definition of generate_guest_id()

2016-12-30 Thread kys
From: K. Y. Srinivasan As part of the effort to separate out architecture specific code, move the definition of generate_guest_id() to x86 specific header file. Signed-off-by: K. Y. Srinivasan --- arch/x86/include/asm/mshyperv.h | 43 +++ drivers/hv/hyperv

[PATCH 03/18] Drivers: hv vmbus: Move Hypercall page setup out of common code

2016-12-30 Thread kys
From: K. Y. Srinivasan As part of the effort to separate out architecture specific code, move the hypercall page setup to an architecture specific file. Signed-off-by: K. Y. Srinivasan --- arch/x86/Kbuild |3 ++ arch/x86/hyperv/Makefile|1 + arch/x86/hyperv/hv_i

[PATCH 13/18] Drivers: hv: vmbus: Define APIs to manipulate the message page

2016-12-30 Thread kys
From: K. Y. Srinivasan As part of cleaning up architecture specific code, define APIs to manipulate the message page. Signed-off-by: K. Y. Srinivasan --- arch/x86/include/asm/mshyperv.h |3 +++ drivers/hv/hv.c |8 2 files changed, 7 insertions(+), 4 deletions(-

[PATCH 14/18] Drivers: hv: vmbus: Define APIs to manipulate the event page

2016-12-30 Thread kys
From: K. Y. Srinivasan As part of cleaning up architecture specific code, define APIs to manipulate the event page. Signed-off-by: K. Y. Srinivasan --- arch/x86/include/asm/mshyperv.h |3 +++ drivers/hv/hv.c |8 2 files changed, 7 insertions(+), 4 deletions(-)

[PATCH 16/18] Drivers: hv: vmbus: Define an API to retrieve virtual processor index

2016-12-30 Thread kys
From: K. Y. Srinivasan As part of cleaning up architecture specific code, define an API to retrieve the virtual procesor index. Signed-off-by: K. Y. Srinivasan --- arch/x86/include/asm/mshyperv.h |2 ++ drivers/hv/hv.c |2 +- 2 files changed, 3 insertions(+), 1 deletion

[PATCH 04/18] Drivers: hv: vmbus: Move Hypercall invocation code out of common code

2016-12-30 Thread kys
From: K. Y. Srinivasan As part of the effort to separate out architecture specific code, move the hypercall invocation code to an architecture specific file. Signed-off-by: K. Y. Srinivasan --- arch/x86/hyperv/hv_init.c | 54 +++--- arch/x86/include/asm/

[PATCH 05/18] Drivers: hv: vmbus: Consolidate all Hyper-V specific clocksource code

2016-12-30 Thread kys
From: K. Y. Srinivasan As part of the effort to separate out architecture specific code, consolidate all Hyper-V specific clocksource code to an architecture specific code. Signed-off-by: K. Y. Srinivasan --- arch/x86/hyperv/hv_init.c | 104 +++ arch/

[PATCH 17/18] Drivers: hv: vmbus: Define an APIs to manage interrupt state

2016-12-30 Thread kys
From: K. Y. Srinivasan As part of cleaning up architecture specific code, define APIs to manage interrupt state. Signed-off-by: K. Y. Srinivasan --- arch/x86/include/asm/mshyperv.h |3 +++ drivers/hv/hv.c | 12 2 files changed, 11 insertions(+), 4 deletions(-

[PATCH 2/3] Drivers: hv: vmbus: Reduce the delay between retries in vmbus_post_msg()

2016-07-01 Thread kys
From: K. Y. Srinivasan The current delay between retries is unnecessarily high and is negatively affecting the time it takes to boot the system. Signed-off-by: K. Y. Srinivasan --- drivers/hv/connection.c |8 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/h

[PATCH 0/3] Drivers: hv: vmbus: Miscellaneous adjustments

2016-07-01 Thread kys
From: K. Y. Srinivasan Some miscellaneous adjustments to the vmbus driver. K. Y. Srinivasan (3): Drivers: hv: vmbus: Enable explicit signaling policy for NIC channels Drivers: hv: vmbus: Reduce the delay between retries in vmbus_post_msg() Drivers: hv: vmbus: Implement a mechanism to t

[PATCH 1/3] Drivers: hv: vmbus: Enable explicit signaling policy for NIC channels

2016-07-01 Thread kys
From: K. Y. Srinivasan For synthetic NIC channels, enable explicit signaling policy as netvsc wants to explicitly control when the host is to be signaled. Signed-off-by: K. Y. Srinivasan --- drivers/hv/channel.c | 18 -- drivers/hv/channel_mgmt.c |2 ++ drivers/hv/hy

[PATCH 3/3] Drivers: hv: vmbus: Implement a mechanism to tag the channel for low latency

2016-07-01 Thread kys
From: K. Y. Srinivasan On Hyper-V, performance critical channels use the monitor mechanism to signal the host when the guest posts mesages for the host. This mechanism minimizes the hypervisor intercepts and also makes the host more efficient in that each time the host is woken up, it processes a

[PATCH RESEND net-next] netvsc: Use the new in-place consumption APIs in the rx path

2016-07-05 Thread kys
From: K. Y. Srinivasan Use the new APIs for eliminating a copy on the receive path. These new APIs also help in minimizing the number of memory barriers we end up issuing (in the ringbuffer code) since we can better control when we want to expose the ring state to the host. The patch is being re

[PATCH 0/4] Drivers: hv: vmbus: Make in-place consumption always possible

2016-07-06 Thread kys
From: K. Y. Srinivasan Make in-place consumption of VMBus packets always possible. Currently we forbid it when a packet 'wraps around' the ring so we can't provide a single pointer to it. The idea if this series is dead simple: let's make a single virtual mapping for two copies (actually, two se

[PATCH 4/4] Drivers: hv: ring_buffer: count on wrap around mappings in get_next_pkt_raw()

2016-07-06 Thread kys
From: Vitaly Kuznetsov With wrap around mappings in place we can always provide drivers with direct links to packets on the ring buffer, even when they wrap around. Do the required updates to get_next_pkt_raw()/put_pkt_raw() Signed-off-by: Vitaly Kuznetsov Signed-off-by: K. Y. Srinivasan Teste

[PATCH 3/4] Drivers: hv: ring_buffer: use wrap around mappings in hv_copy{from, to}_ringbuffer()

2016-07-06 Thread kys
From: Vitaly Kuznetsov With wrap around mappings for ring buffers we can always use a single memcpy() to do the job. Signed-off-by: Vitaly Kuznetsov Signed-off-by: K. Y. Srinivasan Tested-by: Dexuan Cui --- drivers/hv/ring_buffer.c | 24 +++- 1 files changed, 3 insertio

[PATCH 1/4] Drivers: hv: cleanup vmbus_open() for wrap around mappings

2016-07-06 Thread kys
From: Vitaly Kuznetsov In preparation for doing wrap around mappings for ring buffers cleanup vmbus_open() function: - check that ring sizes are PAGE_SIZE aligned (they are for all in-kernel drivers now); - kfree(open_info) on error only after we kzalloc() it (not an issue as it is valid to c

[PATCH 2/4] Drivers: hv: ring_buffer: wrap around mappings for ring buffers

2016-07-06 Thread kys
From: Vitaly Kuznetsov Make it possible to always use a single memcpy() or to provide a direct link to a packet on the ring buffer by creating virtual mapping for two copies of the ring buffer with vmap(). Utilize currently empty hv_ringbuffer_cleanup() to do the unmap. While on it, replace size

[PATCH 1/1] Drivers: hv: Introduce a policy for controlling channel affinity

2016-07-06 Thread kys
From: K. Y. Srinivasan Introduce a mechanism to control how channels will be affinitized. We will support two policies: 1. HV_BALANCED: All performance critical channels will be dstributed evenly amongst all the available NUMA nodes. Once the Node is assigned, we will assign the CPU based on a s

[PATCH 1/1] Tools: hv: kvp: ensure kvp device fd is closed on exec

2016-07-06 Thread kys
From: Vitaly Kuznetsov KVP daemon does fork()/exec() (with popen()) so we need to close our fds to avoid sharing them with child processes. The immediate implication of not doing so I see is SELinux complaining about 'ip' trying to access '/dev/vmbus/hv_kvp'. Signed-off-by: Vitaly Kuznetsov Sig

[PATCH 0/2] Drivers: hv: util: Some fixes to the backup driver

2016-08-18 Thread kys
From: K. Y. Srinivasan Some fixes to the backup driver. Alex Ng (2): Drivers: hv: utils: Continue to poll VSS channel after handling requests. Drivers: hv: utils: Check VSS daemon is listening before a hot backup drivers/hv/hv_snapshot.c | 92 ++---

[PATCH 2/2] Drivers: hv: utils: Check VSS daemon is listening before a hot backup

2016-08-18 Thread kys
From: Alex Ng Hyper-V host will send a VSS_OP_HOT_BACKUP request to check if guest is ready for a live backup/snapshot. The driver should respond to the check only if the daemon is running and listening to requests. This allows the host to fallback to standard snapshots in case the VSS daemon is

[PATCH 1/2] Drivers: hv: utils: Continue to poll VSS channel after handling requests.

2016-08-18 Thread kys
From: Alex Ng Multiple VSS_OP_HOT_BACKUP requests may arrive in quick succession, even though the host only signals once. The driver wass handling the first request while ignoring the others in the ring buffer. We should poll the VSS channel after handling a request to continue processing other r

[PATCH 0/5] Drivers: hv: balloon: Miscellaneous fixes.

2016-08-24 Thread kys
From: K. Y. Srinivasan Miscellaneous fixes to the balloon driver. Alex Ng (1): Drivers: hv: balloon: Use available memory value in pressure report Vitaly Kuznetsov (4): Drivers: hv: balloon: keep track of where ha_region starts Drivers: hv: balloon: account for gaps in hot add regions D

[PATCH 1/5] Drivers: hv: balloon: keep track of where ha_region starts

2016-08-24 Thread kys
From: Vitaly Kuznetsov Windows 2012 (non-R2) does not specify hot add region in hot add requests and the logic in hot_add_req() is trying to find a 128Mb-aligned region covering the request. It may also happen that host's requests are not 128Mb aligned and the created ha_region will start before

[PATCH 2/5] Drivers: hv: balloon: account for gaps in hot add regions

2016-08-24 Thread kys
From: Vitaly Kuznetsov I'm observing the following hot add requests from the WS2012 host: hot_add_req: start_pfn = 0x108200 count = 330752 hot_add_req: start_pfn = 0x158e00 count = 193536 hot_add_req: start_pfn = 0x188400 count = 239616 As the host doesn't specify hot add regions we're trying t

[PATCH 3/5] Drivers: hv: balloon: don't wait for ol_waitevent when memhp_auto_online is enabled

2016-08-24 Thread kys
From: Vitaly Kuznetsov With the recently introduced in-kernel memory onlining (MEMORY_HOTPLUG_DEFAULT_ONLINE) these is no point in waiting for pages to come online in the driver and we can get rid of the waiting. Signed-off-by: Vitaly Kuznetsov Signed-off-by: K. Y. Srinivasan --- drivers/hv/h

[PATCH 4/5] Drivers: hv: balloon: replace ha_region_mutex with spinlock

2016-08-24 Thread kys
From: Vitaly Kuznetsov lockdep reports possible circular locking dependency when udev is used for memory onlining: systemd-udevd/3996 is trying to acquire lock: ((memory_chain).rwsem){.+}, at: [] __blocking_notifier_call_chain+0x4e/0xc0 but task is already holding lock: (&dm_device.h

[PATCH 5/5] Drivers: hv: balloon: Use available memory value in pressure report

2016-08-24 Thread kys
From: Alex Ng Reports for available memory should use the si_mem_available() value. The previous freeram value does not include available page cache memory. Signed-off-by: Alex Ng Signed-off-by: K. Y. Srinivasan --- drivers/hv/hv_balloon.c | 13 + 1 files changed, 5 insertions(+

[PATCH 0/7] Drivers: hv: Some miscellaneous fixes

2016-09-02 Thread kys
From: K. Y. Srinivasan Some miscellaneous fixes and enhancements. These patches were all sent earlier but failed to apply clean on Greg's tree. These have now been rebased. Alex Ng (2): Drivers: hv: utils: Continue to poll VSS channel after handling requests. Drivers: hv: utils: Check VS

[PATCH 5/7] Drivers: hv: Introduce a policy for controlling channel affinity

2016-09-02 Thread kys
From: K. Y. Srinivasan Introduce a mechanism to control how channels will be affinitized. We will support two policies: 1. HV_BALANCED: All performance critical channels will be dstributed evenly amongst all the available NUMA nodes. Once the Node is assigned, we will assign the CPU based on a s

[PATCH 1/7] Drivers: hv: cleanup vmbus_open() for wrap around mappings

2016-09-02 Thread kys
From: Vitaly Kuznetsov In preparation for doing wrap around mappings for ring buffers cleanup vmbus_open() function: - check that ring sizes are PAGE_SIZE aligned (they are for all in-kernel drivers now); - kfree(open_info) on error only after we kzalloc() it (not an issue as it is valid to c

[PATCH 6/7] Drivers: hv: utils: Continue to poll VSS channel after handling requests.

2016-09-02 Thread kys
From: Alex Ng Multiple VSS_OP_HOT_BACKUP requests may arrive in quick succession, even though the host only signals once. The driver wass handling the first request while ignoring the others in the ring buffer. We should poll the VSS channel after handling a request to continue processing other r

[PATCH 3/7] Drivers: hv: ring_buffer: use wrap around mappings in hv_copy{from, to}_ringbuffer()

2016-09-02 Thread kys
From: Vitaly Kuznetsov With wrap around mappings for ring buffers we can always use a single memcpy() to do the job. Signed-off-by: Vitaly Kuznetsov Signed-off-by: K. Y. Srinivasan Tested-by: Dexuan Cui --- drivers/hv/ring_buffer.c | 24 +++- 1 files changed, 3 insertio

[PATCH 7/7] Drivers: hv: utils: Check VSS daemon is listening before a hot backup

2016-09-02 Thread kys
From: Alex Ng Hyper-V host will send a VSS_OP_HOT_BACKUP request to check if guest is ready for a live backup/snapshot. The driver should respond to the check only if the daemon is running and listening to requests. This allows the host to fallback to standard snapshots in case the VSS daemon is

[PATCH 4/7] Drivers: hv: ring_buffer: count on wrap around mappings in get_next_pkt_raw()

2016-09-02 Thread kys
From: Vitaly Kuznetsov With wrap around mappings in place we can always provide drivers with direct links to packets on the ring buffer, even when they wrap around. Do the required updates to get_next_pkt_raw()/put_pkt_raw() Signed-off-by: Vitaly Kuznetsov Signed-off-by: K. Y. Srinivasan Teste

[PATCH 2/7] Drivers: hv: ring_buffer: wrap around mappings for ring buffers

2016-09-02 Thread kys
From: Vitaly Kuznetsov Make it possible to always use a single memcpy() or to provide a direct link to a packet on the ring buffer by creating virtual mapping for two copies of the ring buffer with vmap(). Utilize currently empty hv_ringbuffer_cleanup() to do the unmap. While on it, replace size

[PATCH] Drivers: hv: vmbus: Revert commit bb08d431a914

2016-09-06 Thread kys
From: K. Y. Srinivasan To deal with the merge conflict between net-next and char-misc trees, revert commit bb08d431a914 from char-misc tree. This commit can be rebased and applied once net-next picks up char-misc changes. --- include/linux/hyperv.h | 32 +--- 1 file

[PATCH V2 1/1] Revert "Drivers: hv: ring_buffer: count on wrap around mappings in get_next_pkt_raw()"

2016-09-06 Thread kys
From: K. Y. Srinivasan To deal with the merge conflict between net-next and char-misc trees, revert commit bb08d431a914 from char-misc tree. This commit can be rebased and applied once net-next picks up char-misc changes. Here is the commit log of the reverted patch: "With wrap around mappings i

[PATCH 0/2] Drivers: hv: vmbus: Some miscellaneous fixes

2016-09-07 Thread kys
From: K. Y. Srinivasan Some miscellaneous fixes. Dexuan Cui (1): Drivers: hv: vmbus: suppress some "hv_vmbus: Unknown GUID" warnings Stephen Hemminger (1): Driver: hv: vmbus: Make mmio resource local drivers/hv/channel_mgmt.c | 26 -- drivers/hv/vmbus_drv.c|

[PATCH 2/2] Drivers: hv: vmbus: suppress some "hv_vmbus: Unknown GUID" warnings

2016-09-07 Thread kys
From: Dexuan Cui Some VMBus devices are not needed by Linux guest[1][2], and, VMBus channels of Hyper-V Sockets don't really mean usual synthetic devices, so let's suppress the warnings for them. [1] https://support.microsoft.com/en-us/kb/2925727 [2] https://msdn.microsoft.com/en-us/library/jj98

[PATCH 1/2] Driver: hv: vmbus: Make mmio resource local

2016-09-07 Thread kys
From: Stephen Hemminger This fixes a sparse warning because hyperv_mmio resources are only used in this one file and should be static. Signed-off-by: Stephen Hemminger Signed-off-by: K. Y. Srinivasan --- drivers/hv/vmbus_drv.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) dif

[PATCH 0/3] Drivers: hv: util: Support the latest time synch protocol from the host

2016-09-08 Thread kys
From: K. Y. Srinivasan WS2016 has introduced a new protocol for conditioning guest clock. Support this new protocol. Alex Ng (3): Drivers: hv: utils: Rename version definitions to reflect protocol version. Drivers: hv: utils: Use TimeSync samples to adjust the clock after boot. Dri

[PATCH 3/3] Drivers: hv: utils: Support TimeSync version 4.0 protocol samples.

2016-09-08 Thread kys
From: Alex Ng This enables support for more accurate TimeSync v4 samples when hosted under Windows Server 2016 and newer hosts. The new time samples include a "vmreferencetime" field that represents the guest's TSC value when the host generated its time sample. This value lets the guest calculat

[PATCH 1/3] Drivers: hv: utils: Rename version definitions to reflect protocol version.

2016-09-08 Thread kys
From: Alex Ng Different Windows host versions may reuse the same protocol version when negotiating the TimeSync, Shutdown, and Heartbeat protocols. We should only refer to the protocol version to avoid conflating the two concepts. Signed-off-by: Alex Ng Signed-off-by: K. Y. Srinivasan --- dri

[PATCH 2/3] Drivers: hv: utils: Use TimeSync samples to adjust the clock after boot.

2016-09-08 Thread kys
From: Alex Ng Only the first 50 samples after boot were being used to discipline the clock. After the first 50 samples, any samples from the host were ignored and the guest clock would eventually drift from the host clock. This patch allows TimeSync-enabled guests to continuously synchronize the

[PATCH 1/1] Drivers: hv: hv_util: Avoid dynamic allocation in time synch

2016-09-08 Thread kys
From: Vivek yadav Under stress, we have seen allocation failure in time synch code. Avoid this dynamic allocation. Signed-off-by: Vivek Yadav Signed-off-by: K. Y. Srinivasan --- drivers/hv/hv_util.c | 39 --- 1 files changed, 28 insertions(+), 11 deletion

[PATCH 0/2] Drivers: hv: vmbus: Use persistent IDs for vmbus device names

2016-09-16 Thread kys
From: K. Y. Srinivasan Use IDs that persist across reboots as vmbus device IDs. Vitaly Kuznetsov (2): Drivers: hv: make VMBus bus ids persistent Drivers: hv: get rid of id in struct vmbus_channel drivers/hv/channel_mgmt.c |2 -- drivers/hv/vmbus_drv.c|4 ++-- include/linux/hype

[PATCH 1/1] Drivers: hv: hv_util: Avoid dynamic allocation in time synch

2016-09-16 Thread kys
From: Vivek yadav Under stress, we have seen allocation failure in time synch code. Avoid this dynamic allocation. Signed-off-by: Vivek Yadav Signed-off-by: K. Y. Srinivasan --- drivers/hv/hv_util.c | 39 --- 1 files changed, 28 insertions(+), 11 deletion

[PATCH 1/2] Drivers: hv: make VMBus bus ids persistent

2016-09-16 Thread kys
From: Vitaly Kuznetsov Some tools use bus ids to identify devices and they count on the fact that these ids are persistent across reboot. This may be not true for VMBus as we use auto incremented counter from alloc_channel() as such id. Switch to using if_instance from channel offer, this id is s

[PATCH 2/2] Drivers: hv: get rid of id in struct vmbus_channel

2016-09-16 Thread kys
From: Vitaly Kuznetsov The auto incremented counter is not being used anymore, get rid of it. Signed-off-by: Vitaly Kuznetsov Signed-off-by: K. Y. Srinivasan --- drivers/hv/channel_mgmt.c |2 -- include/linux/hyperv.h|3 --- 2 files changed, 0 insertions(+), 5 deletions(-) diff -

[PATCH 1/1] hv: do not lose pending heartbeat vmbus packets

2016-10-05 Thread kys
From: Long Li The host keeps sending heartbeat packets independent of the guest responding to them. Even though we respond to the heartbeat messages at interrupt level, we can have situations where there maybe multiple heartbeat messages pending that have not been responded to. For instance this

[PATCH V2 1/1] hv: do not lose pending heartbeat vmbus packets

2016-10-05 Thread kys
From: Long Li The host keeps sending heartbeat packets independent of the guest responding to them. Even though we respond to the heartbeat messages at interrupt level, we can have situations where there maybe multiple heartbeat messages pending that have not been responded to. For instance this

[PATCH 00/15] Drivers: hv: Some miscellaneous fixes and enhancements

2016-10-30 Thread kys
From: K. Y. Srinivasan Some miscellaneous fixes and enhancements. Alex Ng (6): Drivers: hv: utils: Fix the mapping between host version and protocol to use Drivers: hv: balloon: Disable hot add when CONFIG_MEMORY_HOTPLUG is not set Drivers: hv: balloon: Add logging for dynamic memo

[PATCH 04/15] Drivers: hv: balloon: Disable hot add when CONFIG_MEMORY_HOTPLUG is not set

2016-10-30 Thread kys
From: Alex Ng If the guest does not support memory hotplugging, it should respond to the host with zero pages added and successful result code. This signals to the host that hotplugging is not supported and the host will avoid sending future hot-add requests. Signed-off-by: Alex Ng Signed-off-b

[PATCH 13/15] Drivers: hv: vmbus: Base host signaling strictly on the ring state

2016-10-30 Thread kys
the performance otherwise. +* +* KYS: Oct. 30, 2016: +* It looks like Windows hosts have logic to deal with DOS attacks that +* can be triggered if it receives interrupts when it is not expecting +* the interrupt. The host expects interrupts only when the ring +

<    1   2   3   4   5   >