[PATCH V2 0/4] Drivers: hv: Miscellaneous fixes

2017-09-17 Thread kys
From: "K. Y. Srinivasan" Miscellaneous fixes. V2: Dropped the patch: "vmbus: suppress uevents for hv_sock devices" as this was only to address test trigerred issues. Dexuan Cui (1): vmbus: don't acquire the mutex in vmbus_hvsock_device_unregister() Olaf Hering (1): Drivers: hv: fcopy:

[PATCH V2 1/4] vmbus: don't acquire the mutex in vmbus_hvsock_device_unregister()

2017-09-17 Thread kys
From: Dexuan Cui Due to commit 54a66265d675 ("Drivers: hv: vmbus: Fix rescind handling"), we need this patch to resolve the below deadlock: after we get the mutex in vmbus_hvsock_device_unregister() and call vmbus_device_unregister() -> device_unregister() -> ... -> device_release() ->

[PATCH V2 2/4] Drivers: hv: fcopy: restore correct transfer length

2017-09-17 Thread kys
From: Olaf Hering Till recently the expected length of bytes read by the daemon did depend on the context. It was either hv_start_fcopy or hv_do_fcopy. The daemon had a buffer size of two pages, which was much larger than needed. Now the expected length of bytes read by the daemon changed

[PATCH V2 3/4] vmbus: add per-channel sysfs info

2017-09-17 Thread kys
From: Stephen Hemminger This extends existing vmbus related sysfs structure to provide per-channel state information. This is useful when diagnosing issues with multiple queues in networking and storage. The existing sysfs only displayed information about the primary channel. The one place it

[PATCH V2 4/4] Drivers: hv: vmbus: Expose per-channel event counters events counters

2017-09-17 Thread kys
From: Stephen Hemminger When investigating performance, it is useful to be able to look at the number of host and guest events per-channel. This is equivalent to per-device interrupt statistics. Signed-off-by: Stephen Hemminger Signed-off-by: K. Y. Srinivasan ---

[PATCH V2 00/12] Drivers: hv: Miscellaneous fixes

2018-03-04 Thread kys
From: "K. Y. Srinivasan" Miscellaneous fixes. V2: Only the patch "Drivers: hv: vmbus: Implement Direct Mode for stimer0" has been modified to address review comments from Dan Carpenter. Dexuan Cui (1): tools: hv: fix compiler warnings about major/target_fname Haiyang Zhang

[PATCH V2 07/12] hv_vmbus: Correct the stale comments regarding cpu affinity

2018-03-04 Thread kys
From: Haiyang Zhang The comments doesn't match what the current code does, also have a typo. This patch corrects them. Signed-off-by: Haiyang Zhang Signed-off-by: K. Y. Srinivasan --- drivers/hv/channel_mgmt.c | 6 ++ include/linux/hyperv.h| 2 +- 2 files changed, 3 insertions(+), 5

[PATCH V2 01/12] tools/hv: Fix IP reporting by KVP daemon with SRIOV

2018-03-04 Thread kys
From: Haiyang Zhang On Hyper-V the VF NIC has the same MAC as the related synthetic NIC. VF NIC can work under the synthetic NIC transparently, without its own IP address. The existing KVP daemon only gets IP from the first NIC matching a MAC address, and may not be able to find the IP in this

[PATCH V2 09/12] hv_balloon: fix printk loglevel

2018-03-04 Thread kys
From: Vitaly Kuznetsov We have a mix of different ideas of which loglevel should be used. Unify on the following: - pr_info() for normal operation - pr_warn() for 'strange' host behavior - pr_err() for all errors. Signed-off-by: Vitaly Kuznetsov Signed-off-by: K. Y. Srinivasan ---

[PATCH V2 03/12] hv: Synthetic typo correction

2018-03-04 Thread kys
From: Joe Perches Just a trivial tyop fix. Signed-off-by: Joe Perches Signed-off-by: K. Y. Srinivasan --- drivers/hv/hv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hv/hv.c b/drivers/hv/hv.c index b6cacc4cccf2..31142b72f1b9 100644 --- a/drivers/hv/hv.c +++

[PATCH V2 06/12] vmbus/ring_buffer: remove some redundant helper function.

2018-03-04 Thread kys
From: "lantianyu1...@gmail.com" Some hv_get/set** helper functions in ring_buffer code are only called once or not used. This patch is to clear up these codes. Signed-off-by: Tianyu Lan Signed-off-by: K. Y. Srinivasan --- drivers/hv/ring_buffer.c | 49

[PATCH V2 10/12] hv_balloon: simplify hv_online_page()/hv_page_online_one()

2018-03-04 Thread kys
From: Vitaly Kuznetsov Instead of doing pfn_to_page() and continuosly casting page to unsigned long just cache the pfn of the page with page_to_pfn(). Signed-off-by: Vitaly Kuznetsov Signed-off-by: K. Y. Srinivasan --- drivers/hv/hv_balloon.c | 27 +-- 1 file changed,

[PATCH V2 08/12] Drivers: hv: vmbus: Implement Direct Mode for stimer0

2018-03-04 Thread kys
From: Michael Kelley The 2016 version of Hyper-V offers the option to operate the guest VM per-vcpu stimer's in Direct Mode, which means the timer interupts on its own vector rather than queueing a VMbus message. Direct Mode reduces timer processing overhead in both the hypervisor and the guest,

[PATCH V2 02/12] hyper-v: use GFP_KERNEL for hv_context.hv_numa_map

2018-03-04 Thread kys
From: Jia-Ju Bai The kzalloc function is called with GFP_ATOMIC. But according to driver call graph, it is not in atomic context, namely no spinlock is held nor in an interrupt handler. This GFP_ATOMIC is unnecessary, and replace with GFP_KERNEL. Signed-off-by: Jia-Ju Bai Reviewed-by: Vitaly

[PATCH V2 12/12] hv_balloon: trace post_status

2018-03-04 Thread kys
From: Vitaly Kuznetsov Hyper-V balloon driver makes non-trivial calculations to convert Linux's representation of free/used memory to what Hyper-V host expects to see. Add a tracepoint to see what's being sent and where the data comes from. Signed-off-by: Vitaly Kuznetsov Signed-off-by: K. Y.

[PATCH V2 11/12] hv_balloon: fix bugs in num_pages_onlined accounting

2018-03-04 Thread kys
From: Vitaly Kuznetsov Our num_pages_onlined accounting is buggy: 1) In case we're offlining a memory block which was present at boot (e.g. when there was no hotplug at all) we subtract 32k from 0 and as num_pages_onlined is unsigned get a very big positive number. 2) Commit 6df8d9aaf3af

[PATCH V2 04/12] tools: hv: fix compiler warnings about major/target_fname

2018-03-04 Thread kys
From: Dexuan Cui This patch fixes the below warnings with new glibc and gcc: hv_vss_daemon.c:100:13: warning: In the GNU C Library, "major" is defined by . For historical compatibility, it is currently defined by as well, but we plan to remove this soon. To use "major", include directly.

[PATCH V2 05/12] tools: hv: include string.h in hv_fcopy_daemon

2018-03-04 Thread kys
From: Olaf Hering The usage of strchr requires inclusion of string.h. Fixes: 0c38cda64aec ("tools: hv: remove unnecessary header files and netlink related code") Signed-off-by: Olaf Hering Signed-off-by: K. Y. Srinivasan --- tools/hv/hv_fcopy_daemon.c | 1 + 1 file changed, 1 insertion(+)

[PATCH 1/1] Drivers: hv: vmbus: Fix ring buffer signaling

2018-03-04 Thread kys
From: Michael Kelley Fix bugs in signaling the Hyper-V host when freeing space in the host->guest ring buffer: 1. The interrupt_mask must not be used to determine whether to signal on the host->guest ring buffer 2. The ring buffer write_index must be read (via hv_get_bytes_to_write)

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

2017-09-09 Thread kys
From: "K. Y. Srinivasan" Miscellaneous fixes. Dexuan Cui (2): vmbus: don't acquire the mutex in vmbus_hvsock_device_unregister() vmbus: suppress uevents for hv_sock devices Olaf Hering (1): Drivers: hv: fcopy: restore correct transfer length Stephen Hemminger (2): vmbus: add

[PATCH 5/5] Drivers: hv: vmbus: Expose per-channel event counters

2017-09-10 Thread kys
From: Stephen Hemminger When investigating performance, it is useful to be able to look at the number of host and guest events per-channel. This is equivalent to per-device interrupt statistics. Signed-off-by: Stephen Hemminger Signed-off-by: K. Y. Srinivasan ---

[PATCH 1/5] vmbus: don't acquire the mutex in vmbus_hvsock_device_unregister()

2017-09-10 Thread kys
From: Dexuan Cui Due to commit 54a66265d675 ("Drivers: hv: vmbus: Fix rescind handling"), we need this patch to resolve the below deadlock: after we get the mutex in vmbus_hvsock_device_unregister() and call vmbus_device_unregister() -> device_unregister() -> ... -> device_release() ->

[PATCH 3/5] Drivers: hv: fcopy: restore correct transfer length

2017-09-10 Thread kys
From: Olaf Hering Till recently the expected length of bytes read by the daemon did depend on the context. It was either hv_start_fcopy or hv_do_fcopy. The daemon had a buffer size of two pages, which was much larger than needed. Now the expected length of bytes read by the daemon changed

[PATCH 2/5] vmbus: suppress uevents for hv_sock devices

2017-09-10 Thread kys
From: Dexuan Cui hv_sock driver is automatically loaded when an application creates an AF_VSOCK socket, so we don't really need to trigger uevents to the user space udevd. And hv_sock devices can appear and disappear frequency, e.g. 100 per second, so triggering the udevents can cause a high

[PATCH 4/5] vmbus: add per-channel sysfs info

2017-09-10 Thread kys
From: Stephen Hemminger This extends existing vmbus related sysfs structure to provide per-channel state information. This is useful when diagnosing issues with multiple queues in networking and storage. The existing sysfs only displayed information about the primary channel. The one place it

[PATCH 12/12] hv_balloon: trace post_status

2018-02-11 Thread kys
From: Vitaly Kuznetsov Hyper-V balloon driver makes non-trivial calculations to convert Linux's representation of free/used memory to what Hyper-V host expects to see. Add a tracepoint to see what's being sent and where the data comes from. Signed-off-by: Vitaly Kuznetsov Signed-off-by: K. Y.

[PATCH 00/12] Drivers: hv: Miscellaneous fixes

2018-02-11 Thread kys
From: "K. Y. Srinivasan" Miscellaneous fixes. Dexuan Cui (1): tools: hv: fix compiler warnings about major/target_fname Haiyang Zhang (2): tools/hv: Fix IP reporting by KVP daemon with SRIOV hv_vmbus: Correct the stale comments regarding cpu affinity Jia-Ju Bai (1): hyper-v: use

[PATCH 03/12] hv: Synthetic typo correction

2018-02-11 Thread kys
From: Joe Perches Just a trivial tyop fix. Signed-off-by: Joe Perches Signed-off-by: K. Y. Srinivasan --- drivers/hv/hv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hv/hv.c b/drivers/hv/hv.c index b6cacc4cccf2..31142b72f1b9 100644 --- a/drivers/hv/hv.c +++

[PATCH 10/12] hv_balloon: simplify hv_online_page()/hv_page_online_one()

2018-02-11 Thread kys
From: Vitaly Kuznetsov Instead of doing pfn_to_page() and continuosly casting page to unsigned long just cache the pfn of the page with page_to_pfn(). Signed-off-by: Vitaly Kuznetsov Signed-off-by: K. Y. Srinivasan --- drivers/hv/hv_balloon.c | 27 +-- 1 file changed,

[PATCH 08/12] Drivers: hv: vmbus: Implement Direct Mode for stimer0

2018-02-11 Thread kys
From: Michael Kelley The 2016 version of Hyper-V offers the option to operate the guest VM per-vcpu stimer's in Direct Mode, which means the timer interupts on its own vector rather than queueing a VMbus message. Direct Mode reduces timer processing overhead in both the hypervisor and the guest,

[PATCH 05/12] tools: hv: include string.h in hv_fcopy_daemon

2018-02-11 Thread kys
From: Olaf Hering The usage of strchr requires inclusion of string.h. Fixes: 0c38cda64aec ("tools: hv: remove unnecessary header files and netlink related code") Signed-off-by: Olaf Hering Signed-off-by: K. Y. Srinivasan --- tools/hv/hv_fcopy_daemon.c | 1 + 1 file changed, 1 insertion(+)

[PATCH 11/12] hv_balloon: fix bugs in num_pages_onlined accounting

2018-02-11 Thread kys
From: Vitaly Kuznetsov Our num_pages_onlined accounting is buggy: 1) In case we're offlining a memory block which was present at boot (e.g. when there was no hotplug at all) we subtract 32k from 0 and as num_pages_onlined is unsigned get a very big positive number. 2) Commit 6df8d9aaf3af

[PATCH 07/12] hv_vmbus: Correct the stale comments regarding cpu affinity

2018-02-11 Thread kys
From: Haiyang Zhang The comments doesn't match what the current code does, also have a typo. This patch corrects them. Signed-off-by: Haiyang Zhang Signed-off-by: K. Y. Srinivasan --- drivers/hv/channel_mgmt.c | 6 ++ include/linux/hyperv.h| 2 +- 2 files changed, 3 insertions(+), 5

[PATCH 09/12] hv_balloon: fix printk loglevel

2018-02-11 Thread kys
From: Vitaly Kuznetsov We have a mix of different ideas of which loglevel should be used. Unify on the following: - pr_info() for normal operation - pr_warn() for 'strange' host behavior - pr_err() for all errors. Signed-off-by: Vitaly Kuznetsov Signed-off-by: K. Y. Srinivasan ---

[PATCH 01/12] tools/hv: Fix IP reporting by KVP daemon with SRIOV

2018-02-11 Thread kys
From: Haiyang Zhang On Hyper-V the VF NIC has the same MAC as the related synthetic NIC. VF NIC can work under the synthetic NIC transparently, without its own IP address. The existing KVP daemon only gets IP from the first NIC matching a MAC address, and may not be able to find the IP in this

[PATCH 04/12] tools: hv: fix compiler warnings about major/target_fname

2018-02-11 Thread kys
From: Dexuan Cui This patch fixes the below warnings with new glibc and gcc: hv_vss_daemon.c:100:13: warning: In the GNU C Library, "major" is defined by . For historical compatibility, it is currently defined by as well, but we plan to remove this soon. To use "major", include directly.

[PATCH 02/12] hyper-v: use GFP_KERNEL for hv_context.hv_numa_map

2018-02-11 Thread kys
From: Jia-Ju Bai The kzalloc function is called with GFP_ATOMIC. But according to driver call graph, it is not in atomic context, namely no spinlock is held nor in an interrupt handler. This GFP_ATOMIC is unnecessary, and replace with GFP_KERNEL. Signed-off-by: Jia-Ju Bai Reviewed-by: Vitaly

[PATCH 06/12] vmbus/ring_buffer: remove some redundant helper function.

2018-02-11 Thread kys
From: "lantianyu1...@gmail.com" Some hv_get/set** helper functions in ring_buffer code are only called once or not used. This patch is to clear up these codes. Signed-off-by: Tianyu Lan Signed-off-by: K. Y. Srinivasan --- drivers/hv/ring_buffer.c | 49

[PATCH 1/1] Drivers: HV: Send one page worth of kmsg dump over Hyper-V during panic

2018-07-07 Thread kys
From: Sunil Muthuswamy In the VM mode on Hyper-V, currently, when the kernel panics, an error code and few register values are populated in an MSR and the Hypervisor notified. This information is collected on the host. The amount of information currently collected is found to be limited and not

[PATCH 0/4] Drivers: hv: vmbus: Miscellaneous fixes/enhancements

2018-07-28 Thread kys
From: "K. Y. Srinivasan" Miscellaneous fixes/enhancements Stephen Hemminger (1): Drivers: hv: vmbus: add numa_node to sysfs Sunil Muthuswamy (3): Drivers: hv: vmus: Fix the check for return value from kmsg get dump buffer Drivers: hv: vmbus: Fix the issue with freeing up

[PATCH 1/4] Drivers: hv: vmus: Fix the check for return value from kmsg get dump buffer

2018-07-28 Thread kys
From: Sunil Muthuswamy The code to support panic control message was checking the return was checking the return value from kmsg_dump_get_buffer as error value, which is not what the routine returns. This fixes it. Fixes: 81b18bce48af ("Drivers: HV: Send one page worth of kmsg dump over

[PATCH 3/4] Drivers: hv: vmbus: Get rid of MSR access from vmbus_drv.c

2018-07-28 Thread kys
From: Sunil Muthuswamy Get rid of ISA specific code from vmus_drv.c which is common code. Fixes: 81b18bce48af ("Drivers: HV: Send one page worth of kmsg dump over Hyper-V during panic") Signed-off-by: Sunil Muthuswamy Signed-off-by: K. Y. Srinivasan --- arch/x86/include/asm/mshyperv.h | 3

[PATCH 4/4] Drivers: hv: vmbus: add numa_node to sysfs

2018-07-28 Thread kys
From: Stephen Hemminger Being able to find the numa_node for a device is useful for userspace drivers (DPDK) and also for diagnosing performance issues. This makes vmbus similar to pci. Signed-off-by: Stephen Hemminger Signed-off-by: K. Y. Srinivasan ---

[PATCH 2/4] Drivers: hv: vmbus: Fix the issue with freeing up hv_ctl_table_hdr

2018-07-28 Thread kys
From: Sunil Muthuswamy The check to free the Hyper-V control table header was reversed. This fixes it. Fixes: 81b18bce48af ("Drivers: HV: Send one page worth of kmsg dump over Hyper-V during panic") Signed-off-by: Sunil Muthuswamy Signed-off-by: K. Y. Srinivasan --- drivers/hv/vmbus_drv.c

[PATCH 0/8] Drivers: hv: Miscellaneous fixes/improvements

2018-06-05 Thread kys
From: "K. Y. Srinivasan" Some miscellaneous fixes/improvements. Arjan van de Ven (1): use the new async probing feature for the hyperv drivers Dexuan Cui (1): Drivers: hv: vmbus: Fix the offer_in_progress in vmbus_process_offer() Michael Kelley (4): x86/hyperv: Add interrupt handler

[PATCH 3/8] Drivers: hv: vmbus: Add comments on ring buffer signaling

2018-06-05 Thread kys
From: Michael Kelley Add comments describing intricacies of Hyper-V ring buffer signaling code. This information is not in Hyper-V public documents, so include here to capture the knowledge for future coders. There are no code changes in this commit. Signed-off-by: Michael Kelley

[PATCH 4/8] Drivers: hv: vmbus: Fix the offer_in_progress in vmbus_process_offer()

2018-06-05 Thread kys
From: Dexuan Cui I didn't really hit a real bug, but just happened to spot the bug: we have decreased the counter at the beginning of vmbus_process_offer(), so we mustn't decrease it again. Fixes: 6f3d791f3006 ("Drivers: hv: vmbus: Fix rescind handling issues") Signed-off-by: Dexuan Cui Cc:

[PATCH 7/8] tools: hv: update lsvmbus to be compatible with python3

2018-06-05 Thread kys
From: Olaf Hering Python3 changed the way how 'print' works. Adjust the code to a syntax that is understood by python2 and python3. Signed-off-by: Olaf Hering Acked-by: Dexuan Cui Signed-off-by: K. Y. Srinivasan --- tools/hv/lsvmbus | 12 ++-- 1 file changed, 6 insertions(+), 6

[PATCH 8/8] Tools: hv: vss: fix loop device detection

2018-06-05 Thread kys
From: Vitaly Kuznetsov Commit ea81fdf0981d ("Tools: hv: vss: Skip freezing filesystems backed by loop") added skip for filesystems backed by loop device. However, it seems the detection of such cases is incomplete. It was found that with 'devicemapper' storage driver docker creates the

[PATCH 2/8] x86/hyperv: Add interrupt handler annotations

2018-06-05 Thread kys
From: Michael Kelley Add standard interrupt handler annotations to hyperv_vector_handler(). This does not fix any observed bug, but avoids potential removal of the code by link time optimization and makes it consistent with hv_stimer0_vector_handler in the same source file. Suggested-by: Thomas

[PATCH 6/8] Drivers: hv: vmbus: Make TLFS #define names architecture neutral

2018-06-05 Thread kys
From: Michael Kelley The Hyper-V feature and hint flags in hyperv-tlfs.h are all defined with the string "X64" in the name. Some of these flags are indeed x86/x64 specific, but others are not. For the ones that are used in architecture independent Hyper-V driver code, or will be used in the

[PATCH 1/8] use the new async probing feature for the hyperv drivers

2018-06-05 Thread kys
From: Arjan van de Ven Recent kernels support asynchronous probing; most hyperv drivers can be probed async easily so set the required flag for this. Signed-off-by: Arjan van de Ven Signed-off-by: Stephen Hemminger Signed-off-by: K. Y. Srinivasan --- drivers/hid/hid-hyperv.c |

[PATCH 5/8] Drivers: hv: vmbus: Remove x86 MSR refs in arch independent code

2018-06-05 Thread kys
From: Michael Kelley In architecture independent code for manipulating Hyper-V synthetic timers and synthetic interrupts, pass in an ordinal number identifying the timer or interrupt, rather than an actual MSR register address. Then in x86/x64 specific code, map the ordinal number to the

[PATCH 0/4] Hyper-V: Enable Linux guests on Hyper-V on ARM64

2018-11-21 Thread kys
From: "K. Y. Srinivasan" This series enables Linux guests running on Hyper-V on ARM64 hardware. New ARM64-specific code in arch/arm64/hyperv initializes Hyper-V, including its synthetic clocks and hypercall mechanism. Existing architecture independent drivers for Hyper-V's VMbus and synthetic

[PATCH 0/4] Hyper-V: Enable Linux guests on Hyper-V on ARM64

2018-11-21 Thread kys
From: "K. Y. Srinivasan" This series enables Linux guests running on Hyper-V on ARM64 hardware. New ARM64-specific code in arch/arm64/hyperv initializes Hyper-V, including its synthetic clocks and hypercall mechanism. Existing architecture independent drivers for Hyper-V's VMbus and synthetic

[PATCH 1/4] arm64: hyperv: Add core Hyper-V include files

2018-11-21 Thread kys
From: Michael Kelley hyperv-tlfs.h defines Hyper-V interfaces from the Hyper-V Top Level Functional Spec (TLFS). The TLFS is distinctly oriented to x86/x64, and Hyper-V has not separated out the architecture-dependent parts into x86/x64 vs. ARM64. So hyperv-tlfs.h includes information for ARM64

[PATCH 4/4] Drivers: hv: Enable CONFIG_HYPERV on ARM64

2018-11-21 Thread kys
From: Michael Kelley Update drivers/hv/Kconfig so CONFIG_HYPERV can be selected on ARM64, causing the Hyper-V specific code to be built. Signed-off-by: Michael Kelley Signed-off-by: K. Y. Srinivasan --- drivers/hv/Kconfig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git

[PATCH 2/4] arm64: hyperv: Add support for Hyper-V as a hypervisor

2018-11-21 Thread kys
From: Michael Kelley Add ARM64-specific code to enable Hyper-V. This code includes: * Detecting Hyper-V and initializing the guest/Hyper-V interface * Setting up Hyper-V's synthetic clocks * Making hypercalls using the HVC instruction * Setting up VMbus and stimer0 interrupts * Setting up kexec

[PATCH 3/4] Drivers: hv: vmbus: Add hooks for per-CPU IRQ

2018-11-21 Thread kys
From: Michael Kelley Add hooks to enable/disable a per-CPU IRQ for VMbus. These hooks are in the architecture independent setup and shutdown paths for Hyper-V, and are needed by Linux guests on Hyper-V on ARM64. The x86/x64 implementation is null because VMbus interrupts on x86/x64 don't use an

[PATCH] Drivers: hv: vmbus: Remove the useless API vmbus_get_outgoing_channel()

2018-11-25 Thread kys
From: Dexuan Cui Commit d86adf482b84 ("scsi: storvsc: Enable multi-queue support") removed the usage of the API in Jan 2017, and the API is not used since then. netvsc and storvsc have their own algorithms to determine the outgoing channel, so this API is useless. And the API is potentially

[PATCH 0/2] Drivers: hv: vmbus: Miscellaneous fixes

2018-11-25 Thread kys
From: "K. Y. Srinivasan" Miscellaneous fixes. Dexuan Cui (2): Drivers: hv: vmbus: check the creation_status in vmbus_establish_gpadl() Drivers: hv: vmbus: offload the handling of channels to two workqueues drivers/hv/channel.c | 8 ++ drivers/hv/channel_mgmt.c | 188

[PATCH 1/2] Drivers: hv: vmbus: check the creation_status in vmbus_establish_gpadl()

2018-11-25 Thread kys
From: Dexuan Cui This is a longstanding issue: if the vmbus upper-layer drivers try to consume too many GPADLs, the host may return with an error 0xC044 (STATUS_QUOTA_EXCEEDED), but currently we forget to check the creation_status, and hence we can pass an invalid GPADL handle into the

[PATCH 2/2] Drivers: hv: vmbus: offload the handling of channels to two workqueues

2018-11-25 Thread kys
From: Dexuan Cui vmbus_process_offer() mustn't call channel->sc_creation_callback() directly for sub-channels, because sc_creation_callback() -> vmbus_open() may never get the host's response to the OPEN_CHANNEL message (the host may rescind a channel at any time, e.g. in the case of hot

[PATCH] vmbus: don't return values for uninitalized channels

2018-08-20 Thread kys
From: Stephen Hemminger For unsupported device types, the vmbus channel ringbuffer is never initialized, and therefore reading the sysfs files will return garbage or cause a kernel OOPS. Fixes: c2e5df616e1a ("vmbus: add per-channel sysfs info") Signed-off-by: Stephen Hemminger Signed-off-by:

[PATCH 0/5] Miscellaneous fixes/enhancements

2018-08-10 Thread kys
From: "K. Y. Srinivasan" Miscellaneous fixes/enhancements. K. Y. Srinivasan (1): Tools: hv: Fix a bug in the key delete code Michael Kelley (1): Drivers: hv: vmbus: Fix synic per-cpu context initialization Stephen Hemminger (3): vmbus: add driver_override support uio_hv_generic:

[PATCH 5/5] Drivers: hv: vmbus: Fix synic per-cpu context initialization

2018-08-10 Thread kys
From: Michael Kelley If hv_synic_alloc() errors out, the state of the per-cpu context for some CPUs is unknown since the zero'ing is done as each CPU is iterated over. In such case, hv_synic_cleanup() may try to free memory based on uninitialized values. Fix this by zero'ing the per-cpu

[PATCH 1/5] Tools: hv: Fix a bug in the key delete code

2018-08-10 Thread kys
From: "K. Y. Srinivasan" Fix a bug in the key delete code - the num_records range from 0 to num_records-1. Signed-off-by: K. Y. Srinivasan Reported-by: David Binderman Cc: --- tools/hv/hv_kvp_daemon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH 4/5] uio_hv_generic: drop #ifdef DEBUG

2018-08-10 Thread kys
From: Stephen Hemminger DEBUG is leftover from the development phase, remove it. Signed-off-by: Stephen Hemminger Signed-off-by: K. Y. Srinivasan --- drivers/uio/uio_hv_generic.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/uio/uio_hv_generic.c b/drivers/uio/uio_hv_generic.c

[PATCH 3/5] uio_hv_generic: increase size of receive and send buffers

2018-08-10 Thread kys
From: Stephen Hemminger When using DPDK there is significant performance boost by using the largest possible send and receive buffer area. Unfortunately, with UIO model there is not a good way to configure this at run time. But it is okay to have a bigger buffer available even if application

[PATCH 2/5] vmbus: add driver_override support

2018-08-10 Thread kys
From: Stephen Hemminger Add support for overriding the default driver for a VMBus device in the same way that it can be done for PCI devices. This patch adds the /sys/bus/vmbus/devices/.../driver_override file and the logic for matching. This is used by driverctl tool to do driver override.

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

2018-10-16 Thread kys
From: "K. Y. Srinivasan" Miscellaneous fixes. Dexuan Cui (3): Drivers: hv: kvp: Fix the recent regression caused by incorrect clean-up Drivers: hv: kvp: Use %u to print U32 Tools: hv: kvp: Fix a warning of buffer overflow with gcc 8.0.1 Haiyang Zhang (1): hv_utils: update name in

[PATCH 4/5] Drivers: hv: kvp: Use %u to print U32

2018-10-16 Thread kys
From: Dexuan Cui I didn't find a real issue. Let's just make it consistent with the next "case REG_U64:" where %llu is used. Signed-off-by: Dexuan Cui Cc: K. Y. Srinivasan Cc: Haiyang Zhang Cc: Stephen Hemminger Cc: Signed-off-by: K. Y. Srinivasan --- drivers/hv/hv_kvp.c | 2 +- 1 file

[PATCH 5/5] Tools: hv: kvp: Fix a warning of buffer overflow with gcc 8.0.1

2018-10-16 Thread kys
From: Dexuan Cui The patch fixes: hv_kvp_daemon.c: In function 'kvp_set_ip_info': hv_kvp_daemon.c:1305:2: note: 'snprintf' output between 41 and 4136 bytes into a destination of size 4096 Signed-off-by: Dexuan Cui Cc: K. Y. Srinivasan Cc: Haiyang Zhang Cc: Stephen Hemminger Cc:

[PATCH 3/5] Drivers: hv: kvp: Fix the recent regression caused by incorrect clean-up

2018-10-16 Thread kys
From: Dexuan Cui In kvp_send_key(), we do need call process_ib_ipinfo() if message->kvp_hdr.operation is KVP_OP_GET_IP_INFO, because it turns out the userland hv_kvp_daemon needs the info of operation, adapter_id and addr_family. With the incorrect fc62c3b1977d, the host can't get the VM's IP

[PATCH 1/5] Drivers: hv: vmbus: Get rid of unnecessary state in hv_context

2018-10-16 Thread kys
From: "K. Y. Srinivasan" Currently we are replicating state in struct hv_context that is unnecessary - this state can be retrieved from the hypervisor. Furthermore, this is a per-cpu state that is being maintained as a global state in struct hv_context. Get rid of this state in struct

[PATCH 2/5] hv_utils: update name in struct hv_driver util_drv

2018-10-16 Thread kys
From: Haiyang Zhang The correct module name is hv_utils. This patch corrects the name in struct hv_driver util_drv. Signed-off-by: Haiyang Zhang Signed-off-by: K. Y. Srinivasan --- drivers/hv/hv_util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hv/hv_util.c

[PATCH V2 3/5] Drivers: hv: kvp: Fix the recent regression caused by incorrect clean-up

2018-10-17 Thread kys
From: Dexuan Cui In kvp_send_key(), we do need call process_ib_ipinfo() if message->kvp_hdr.operation is KVP_OP_GET_IP_INFO, because it turns out the userland hv_kvp_daemon needs the info of operation, adapter_id and addr_family. With the incorrect fc62c3b1977d, the host can't get the VM's IP

[PATCH V2 5/5] Tools: hv: kvp: Fix a warning of buffer overflow with gcc 8.0.1

2018-10-17 Thread kys
From: Dexuan Cui The patch fixes: hv_kvp_daemon.c: In function 'kvp_set_ip_info': hv_kvp_daemon.c:1305:2: note: 'snprintf' output between 41 and 4136 bytes into a destination of size 4096 The "(unsigned int)str_len" is to avoid: hv_kvp_daemon.c:1309:30: warning: comparison of integer

[PATCH V2 2/5] hv_utils: update name in struct hv_driver util_drv

2018-10-17 Thread kys
From: Haiyang Zhang The correct module name is hv_utils. This patch corrects the name in struct hv_driver util_drv. Signed-off-by: Haiyang Zhang Signed-off-by: K. Y. Srinivasan --- drivers/hv/hv_util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hv/hv_util.c

[PATCH V2 1/5] Drivers: hv: vmbus: Get rid of unnecessary state in hv_context

2018-10-17 Thread kys
From: "K. Y. Srinivasan" Currently we are replicating state in struct hv_context that is unnecessary - this state can be retrieved from the hypervisor. Furthermore, this is a per-cpu state that is being maintained as a global state in struct hv_context. Get rid of this state in struct

[PATCH V2 0/5] Drivers: hv: Miscellaneous fixes

2018-10-17 Thread kys
From: "K. Y. Srinivasan" Miscellaneous fixes. V2: Addressed comments from Greg. Dexuan Cui (3): Drivers: hv: kvp: Fix the recent regression caused by incorrect clean-up Drivers: hv: kvp: Use %u to print U32 Tools: hv: kvp: Fix a warning of buffer overflow with gcc 8.0.1 Haiyang

[PATCH V2 4/5] Drivers: hv: kvp: Use %u to print U32

2018-10-17 Thread kys
From: Dexuan Cui I didn't find a real issue. Let's just make it consistent with the next "case REG_U64:" where %llu is used. Signed-off-by: Dexuan Cui Cc: K. Y. Srinivasan Cc: Haiyang Zhang Cc: Stephen Hemminger Signed-off-by: K. Y. Srinivasan --- drivers/hv/hv_kvp.c | 2 +- 1 file

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

2018-08-01 Thread kys
From: "K. Y. Srinivasan" Miscellaneous fixes. Dexuan Cui (1): Drivers: hv: vmbus: Reset the channel callback in vmbus_onoffer_rescind() Michael Kelley (2): Drivers: hv: vmbus: Remove use of slow_virt_to_phys() Drivers: hv: vmbus: Cleanup synic memory free path drivers/hv/channel.c

[PATCH 3/3] Drivers: hv: vmbus: Cleanup synic memory free path

2018-08-01 Thread kys
From: Michael Kelley clk_evt memory is not being freed when the synic is shutdown or when there is an allocation error. Add the appropriate kfree() call, along with a comment to clarify how the memory gets freed after an allocation error. Make the free path consistent by removing checks for

[PATCH 2/3] Drivers: hv: vmbus: Remove use of slow_virt_to_phys()

2018-08-01 Thread kys
From: Michael Kelley slow_virt_to_phys() is only implemented for arch/x86. Remove its use in arch independent Hyper-V drivers, and replace with test for vmalloc() address followed by appropriate v-to-p function. This follows the typical pattern of other drivers and avoids the need to implement

[PATCH 1/3] Drivers: hv: vmbus: Reset the channel callback in vmbus_onoffer_rescind()

2018-08-01 Thread kys
From: Dexuan Cui Before setting channel->rescind in vmbus_rescind_cleanup(), we should make sure the channel callback won't run any more, otherwise a high-level driver like pci_hyperv, which may be infinitely waiting for the host VSP's response and notices the channel has been rescinded, can't

[PATCH 0/4] Drivers: hv: Miscellaneous fixes

2018-09-23 Thread kys
From: "K. Y. Srinivasan" Miscellaneous fixes. Dexuan Cui (4): Drivers: hv: vmbus: Fix the descriptions of some function parameters Drivers: hv: kvp: Fix the indentation of some "break" statements Drivers: hv: kvp: Fix two "this statement may fall through" warnings Drivers: hv: vmbus:

[PATCH 2/4] Drivers: hv: kvp: Fix the indentation of some "break" statements

2018-09-23 Thread kys
From: Dexuan Cui No functional change. Signed-off-by: Dexuan Cui Cc: K. Y. Srinivasan Cc: Haiyang Zhang Cc: Stephen Hemminger Signed-off-by: K. Y. Srinivasan --- drivers/hv/hv_kvp.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/hv/hv_kvp.c

[PATCH 4/4] Drivers: hv: vmbus: Use cpumask_var_t for on-stack cpu mask

2018-09-23 Thread kys
From: Dexuan Cui A cpumask structure on the stack can cause a warning with CONFIG_NR_CPUS=8192 (e.g. Ubuntu 16.04 and 18.04 use this): drivers/hv//channel_mgmt.c: In function ‘init_vp_index’: drivers/hv//channel_mgmt.c:702:1: warning: the frame size of 1032 bytes is larger than 1024 bytes

[PATCH 1/4] Drivers: hv: vmbus: Fix the descriptions of some function parameters

2018-09-23 Thread kys
From: Dexuan Cui No functional change. Added descriptions for some parameters. Fixed some typos. Removed some out-of-date comments. Signed-off-by: Dexuan Cui Cc: Jonathan Corbet Cc: linux-...@vger.kernel.org Cc: K. Y. Srinivasan Cc: Haiyang Zhang Cc: Stephen Hemminger Signed-off-by: K. Y.

[PATCH 3/4] Drivers: hv: kvp: Fix two "this statement may fall through" warnings

2018-09-23 Thread kys
From: Dexuan Cui We don't need to call process_ib_ipinfo() if message->kvp_hdr.operation is KVP_OP_GET_IP_INFO in kvp_send_key(), because here we just need to pass on the op code from the host to the userspace; when the userspace returns the info requested by the host, we pass the info on to the

[PATCH 1/1] X86: Fix the circular dependency in IPI enlightenment.

2018-07-03 Thread kys
From: "K. Y. Srinivasan" The IPI hypercalls depend on being able to map the Linux notion of CPU ID to the hypervisor's notion of the CPU ID. The array hv_vp_index[] provides this mapping. Code for populating this array depends on the IPI functionality. Break this circular dependency. Fixes:

[PATCH 1/1] X86/Hyper-V:: Fix the circular dependency in IPI enlightenment.

2018-07-03 Thread kys
From: "K. Y. Srinivasan" The IPI hypercalls depend on being able to map the Linux notion of CPU ID to the hypervisor's notion of the CPU ID. The array hv_vp_index[] provides this mapping. Code for populating this array depends on the IPI functionality. Break this circular dependency. Fixes:

[PATCH 1/1] x86/hyper-v: Fix a merge error

2018-07-19 Thread kys
From: "K. Y. Srinivasan" When the mapping betwween the Linux notion of CPU ID to the hypervisor's notion of CPU ID is not initialized, we should fall back on the non-enligghtened path for IPI. A merge error introduced this bug; fix it. Fixes: 1268ed0c474a ("Merge branch 'x86/urgent' into

[PATCH 0/2] Drivers: hv: Miscellaneous fixes

2018-09-16 Thread kys
From: "K. Y. Srinivasan" Some miscellaneous fixes. Dexuan Cui (1): Drivers: hv: vmbus: Use get/put_cpu() in vmbus_connect() Vitaly Kuznetsov (1): tools: hv: fcopy: set 'error' in case an unknown operation was requested drivers/hv/connection.c| 8 +---

[PATCH 2/2] tools: hv: fcopy: set 'error' in case an unknown operation was requested

2018-09-16 Thread kys
From: Vitaly Kuznetsov 'error' variable is left uninitialized in case we see an unknown operation. As we don't immediately return and proceed to pwrite() we need to set it to something, HV_E_FAIL sounds good enough. Signed-off-by: Vitaly Kuznetsov Signed-off-by: K. Y. Srinivasan ---

[PATCH 1/2] Drivers: hv: vmbus: Use get/put_cpu() in vmbus_connect()

2018-09-16 Thread kys
From: Dexuan Cui With CONFIG_DEBUG_PREEMPT=y, I always see this warning: BUG: using smp_processor_id() in preemptible [] Fix the false warning by using get/put_cpu(). Here vmbus_connect() sends a message to the host and waits for the host's response. The host will deliver the response

[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

[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 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

<    1   2   3   4   5   6   7   8   9   >