[PATCH 10/15] tools: hv: fix a compile warning in snprintf

2016-10-30 Thread kys
From: Weibing Zhang hv_kvp_daemon.c: In function .kvp_mac_to_if_name.: hv_kvp_daemon.c:705:2: warning: format not a string literal and no format arguments [-Wformat-security] snprintf(dev_id, sizeof(dev_id), kvp_net_dir); ^ hv_kvp_daemon.c:705:2: warning: format not a string literal and no f

[PATCH 08/15] Drivers: hv: balloon: Fix info request to show max page count

2016-10-30 Thread kys
From: Alex Ng Balloon driver was only printing the size of the info blob and not the actual content. This fixes it so that the info blob (max page count as configured in Hyper-V) is printed out. Signed-off-by: Alex Ng Signed-off-by: K. Y. Srinivasan --- drivers/hv/hv_balloon.c |9 +++-

[PATCH 07/15] Drivers: hv: vss: Operation timeouts should match host expectation

2016-10-30 Thread kys
From: Alex Ng Increase the timeout of backup operations. When system is under I/O load, it needs more time to freeze. These timeout values should also match the host timeout values more closely. Signed-off-by: Alex Ng Signed-off-by: K. Y. Srinivasan --- drivers/hv/hv_snapshot.c |8 ++-

[PATCH 11/15] tools: hv: remove unnecessary header files and netlink related code

2016-10-30 Thread kys
From: Weibing Zhang Remove unnecessary header files and netlink related code as the daemons do not use netlink to communicate with the kernel now. Signed-off-by: Weibing Zhang Signed-off-by: K. Y. Srinivasan --- tools/hv/hv_fcopy_daemon.c |7 --- tools/hv/hv_kvp_daemon.c |7

[PATCH 05/15] Drivers: hv: balloon: Add logging for dynamic memory operations

2016-10-30 Thread kys
From: Alex Ng Added logging to help troubleshoot common ballooning, hot add, and versioning issues. Signed-off-by: Alex Ng Signed-off-by: K. Y. Srinivasan --- drivers/hv/hv_balloon.c | 31 --- 1 files changed, 28 insertions(+), 3 deletions(-) diff --git a/driver

[PATCH 15/15] Drivers: hv: vmbus: On the read path cleanup the logic to interrupt the host

2016-10-30 Thread kys
From: K. Y. Srinivasan Signal the host when we determine the host is to be signaled - on th read path. The currrent code determines the need to signal in the ringbuffer code and actually issues the signal elsewhere. This can result in the host viewing this interrupt as spurious since the host may

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

2016-10-30 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() The first version of this commit was reverted (65a532f3d50a) to deal wi

[PATCH 02/15] Drivers: hv: utils: reduce HV_UTIL_NEGO_TIMEOUT timeout

2016-10-30 Thread kys
From: Vitaly Kuznetsov I discovered that at least WS2016TP5 host has 60 seconds timeout for the ICMSGTYPE_NEGOTIATE message so we need to lower guest's timeout a little bit to make sure we always respond in time. Let's make it 55 seconds. Signed-off-by: Vitaly Kuznetsov Signed-off-by: K. Y. Sri

[PATCH 12/15] vmbus: make sysfs names consistent with PCI

2016-10-30 Thread kys
From: Stephen Hemminger In commit 9a56e5d6a0ba ("Drivers: hv: make VMBus bus ids persistent") the name of vmbus devices in sysfs changed to be (in 4.9-rc1): /sys/bus/vmbus/vmbus-6aebe374-9ba0-11e6-933c-00259086b36b The prefix ("vmbus-") is redundant and differs from how PCI is represented in s

[PATCH 03/15] Drivers: hv: utils: Fix the mapping between host version and protocol to use

2016-10-30 Thread kys
From: Alex Ng We should intentionally declare the protocols to use for every known host and default to using the latest protocol if the host is unknown or new. Signed-off-by: Alex Ng Signed-off-by: K. Y. Srinivasan --- drivers/hv/hv_util.c |9 ++--- 1 files changed, 6 insertions(+), 3

[PATCH 14/15] Drivers: hv: vmbus: On write cleanup the logic to interrupt the host

2016-10-30 Thread kys
ritten anything. This is a rare -* enough condition that it should not matter. -* NOTE: in this case, the hvsock channel is an exception, because -* it looks the host side's hvsock implementation has a throttling -* mechanism which can hurt the performance otherwise. -

[PATCH 06/15] Drivers: hv: vss: Improve log messages.

2016-10-30 Thread kys
From: Alex Ng Adding log messages to help troubleshoot error cases and transaction handling. Signed-off-by: Alex Ng Signed-off-by: K. Y. Srinivasan --- drivers/hv/hv_snapshot.c | 25 +++-- 1 files changed, 19 insertions(+), 6 deletions(-) diff --git a/drivers/hv/hv_snap

[PATCH 09/15] tools: hv: remove unnecessary link flag

2016-10-30 Thread kys
From: Weibing Zhang The link flag pthread is not needed. Signed-off-by: Weibing Zhang Signed-off-by: K. Y. Srinivasan --- tools/hv/Makefile |3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/tools/hv/Makefile b/tools/hv/Makefile index a8c4644..0d1e61b 100644 --- a/tool

[PATCH 1/1] vmbus: make sysfs names consistent with PCI

2016-10-31 Thread kys
From: Stephen Hemminger In commit 9a56e5d6a0ba ("Drivers: hv: make VMBus bus ids persistent") the name of vmbus devices in sysfs changed to be (in 4.9-rc1): /sys/bus/vmbus/vmbus-6aebe374-9ba0-11e6-933c-00259086b36b The prefix ("vmbus-") is redundant and differs from how PCI is represented in s

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

2016-11-01 Thread kys
From: K. Y. Srinivasan Some miscellaneous fixes and enhancements. V2: Fixed a build issue reported by Greg. Only Patch # 13 is affected. 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_HOT

[PATCH V2 10/14] tools: hv: fix a compile warning in snprintf

2016-11-01 Thread kys
From: Weibing Zhang hv_kvp_daemon.c: In function .kvp_mac_to_if_name.: hv_kvp_daemon.c:705:2: warning: format not a string literal and no format arguments [-Wformat-security] snprintf(dev_id, sizeof(dev_id), kvp_net_dir); ^ hv_kvp_daemon.c:705:2: warning: format not a string literal and no f

[PATCH V2 08/14] Drivers: hv: balloon: Fix info request to show max page count

2016-11-01 Thread kys
From: Alex Ng Balloon driver was only printing the size of the info blob and not the actual content. This fixes it so that the info blob (max page count as configured in Hyper-V) is printed out. Signed-off-by: Alex Ng Signed-off-by: K. Y. Srinivasan --- drivers/hv/hv_balloon.c |9 +++-

[PATCH V2 12/14] Drivers: hv: vmbus: Base host signaling strictly on the ring state

2016-11-01 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 +

[PATCH V2 01/14] Drivers: hv: ring_buffer: count on wrap around mappings in get_next_pkt_raw() (v2)

2016-11-01 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() The first version of this commit was reverted (65a532f3d50a) to deal wi

[PATCH V2 13/14] Drivers: hv: vmbus: On write cleanup the logic to interrupt the host

2016-11-01 Thread kys
his is a rare -* enough condition that it should not matter. -* NOTE: in this case, the hvsock channel is an exception, because -* it looks the host side's hvsock implementation has a throttling -* mechanism which can hurt the performance otherwise. -

[PATCH V2 05/14] Drivers: hv: balloon: Add logging for dynamic memory operations

2016-11-01 Thread kys
From: Alex Ng Added logging to help troubleshoot common ballooning, hot add, and versioning issues. Signed-off-by: Alex Ng Signed-off-by: K. Y. Srinivasan --- drivers/hv/hv_balloon.c | 31 --- 1 files changed, 28 insertions(+), 3 deletions(-) diff --git a/driver

[PATCH V2 11/14] tools: hv: remove unnecessary header files and netlink related code

2016-11-01 Thread kys
From: Weibing Zhang Remove unnecessary header files and netlink related code as the daemons do not use netlink to communicate with the kernel now. Signed-off-by: Weibing Zhang Signed-off-by: K. Y. Srinivasan --- tools/hv/hv_fcopy_daemon.c |7 --- tools/hv/hv_kvp_daemon.c |7

[PATCH V2 06/14] Drivers: hv: vss: Improve log messages.

2016-11-01 Thread kys
From: Alex Ng Adding log messages to help troubleshoot error cases and transaction handling. Signed-off-by: Alex Ng Signed-off-by: K. Y. Srinivasan --- drivers/hv/hv_snapshot.c | 25 +++-- 1 files changed, 19 insertions(+), 6 deletions(-) diff --git a/drivers/hv/hv_snap

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

2016-11-01 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 V2 02/14] Drivers: hv: utils: reduce HV_UTIL_NEGO_TIMEOUT timeout

2016-11-01 Thread kys
From: Vitaly Kuznetsov I discovered that at least WS2016TP5 host has 60 seconds timeout for the ICMSGTYPE_NEGOTIATE message so we need to lower guest's timeout a little bit to make sure we always respond in time. Let's make it 55 seconds. Signed-off-by: Vitaly Kuznetsov Signed-off-by: K. Y. Sri

[PATCH V2 14/14] Drivers: hv: vmbus: On the read path cleanup the logic to interrupt the host

2016-11-01 Thread kys
From: K. Y. Srinivasan Signal the host when we determine the host is to be signaled - on th read path. The currrent code determines the need to signal in the ringbuffer code and actually issues the signal elsewhere. This can result in the host viewing this interrupt as spurious since the host may

[PATCH V2 07/14] Drivers: hv: vss: Operation timeouts should match host expectation

2016-11-01 Thread kys
From: Alex Ng Increase the timeout of backup operations. When system is under I/O load, it needs more time to freeze. These timeout values should also match the host timeout values more closely. Signed-off-by: Alex Ng Signed-off-by: K. Y. Srinivasan --- drivers/hv/hv_snapshot.c |8 ++-

[PATCH V2 09/14] tools: hv: remove unnecessary link flag

2016-11-01 Thread kys
From: Weibing Zhang The link flag pthread is not needed. Signed-off-by: Weibing Zhang Signed-off-by: K. Y. Srinivasan --- tools/hv/Makefile |3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/tools/hv/Makefile b/tools/hv/Makefile index a8c4644..0d1e61b 100644 --- a/tool

[PATCH V2 03/14] Drivers: hv: utils: Fix the mapping between host version and protocol to use

2016-11-01 Thread kys
From: Alex Ng We should intentionally declare the protocols to use for every known host and default to using the latest protocol if the host is unknown or new. Signed-off-by: Alex Ng Signed-off-by: K. Y. Srinivasan --- drivers/hv/hv_util.c |9 ++--- 1 files changed, 6 insertions(+), 3

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

2016-11-06 Thread kys
From: K. Y. Srinivasan Some miscellaneous fixes and enhancements. V2: Fixed a build issue reported by Greg. Only Patch # 13 is affected. V3: Address Stephen's comment. Only patch 3 is affected. Alex Ng (6): Drivers: hv: utils: Fix the mapping between host version and protocol to use Dri

[PATCH V3 12/14] Drivers: hv: vmbus: Base host signaling strictly on the ring state

2016-11-06 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 +

[PATCH V3 11/14] tools: hv: remove unnecessary header files and netlink related code

2016-11-06 Thread kys
From: Weibing Zhang Remove unnecessary header files and netlink related code as the daemons do not use netlink to communicate with the kernel now. Signed-off-by: Weibing Zhang Signed-off-by: K. Y. Srinivasan --- tools/hv/hv_fcopy_daemon.c |7 --- tools/hv/hv_kvp_daemon.c |7

[PATCH V3 02/14] Drivers: hv: utils: reduce HV_UTIL_NEGO_TIMEOUT timeout

2016-11-06 Thread kys
From: Vitaly Kuznetsov I discovered that at least WS2016TP5 host has 60 seconds timeout for the ICMSGTYPE_NEGOTIATE message so we need to lower guest's timeout a little bit to make sure we always respond in time. Let's make it 55 seconds. Signed-off-by: Vitaly Kuznetsov Signed-off-by: K. Y. Sri

[PATCH V3 09/14] tools: hv: remove unnecessary link flag

2016-11-06 Thread kys
From: Weibing Zhang The link flag pthread is not needed. Signed-off-by: Weibing Zhang Signed-off-by: K. Y. Srinivasan --- tools/hv/Makefile |3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/tools/hv/Makefile b/tools/hv/Makefile index a8c4644..0d1e61b 100644 --- a/tool

[PATCH V3 13/14] Drivers: hv: vmbus: On write cleanup the logic to interrupt the host

2016-11-06 Thread kys
his is a rare -* enough condition that it should not matter. -* NOTE: in this case, the hvsock channel is an exception, because -* it looks the host side's hvsock implementation has a throttling -* mechanism which can hurt the performance otherwise. -

[PATCH V3 01/14] Drivers: hv: ring_buffer: count on wrap around mappings in get_next_pkt_raw() (v2)

2016-11-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() The first version of this commit was reverted (65a532f3d50a) to deal wi

[PATCH V3 03/14] Drivers: hv: utils: Fix the mapping between host version and protocol to use

2016-11-06 Thread kys
From: Alex Ng We should intentionally declare the protocols to use for every known host and default to using the latest protocol if the host is unknown or new. Signed-off-by: Alex Ng Signed-off-by: K. Y. Srinivasan --- V3: Addressed Stephen's comment drivers/hv/hv_util.c |9 +

[PATCH V3 14/14] Drivers: hv: vmbus: On the read path cleanup the logic to interrupt the host

2016-11-06 Thread kys
From: K. Y. Srinivasan Signal the host when we determine the host is to be signaled - on th read path. The currrent code determines the need to signal in the ringbuffer code and actually issues the signal elsewhere. This can result in the host viewing this interrupt as spurious since the host may

[PATCH V3 07/14] Drivers: hv: vss: Operation timeouts should match host expectation

2016-11-06 Thread kys
From: Alex Ng Increase the timeout of backup operations. When system is under I/O load, it needs more time to freeze. These timeout values should also match the host timeout values more closely. Signed-off-by: Alex Ng Signed-off-by: K. Y. Srinivasan --- drivers/hv/hv_snapshot.c |8 ++-

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

2016-11-06 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 V3 10/14] tools: hv: fix a compile warning in snprintf

2016-11-06 Thread kys
From: Weibing Zhang hv_kvp_daemon.c: In function .kvp_mac_to_if_name.: hv_kvp_daemon.c:705:2: warning: format not a string literal and no format arguments [-Wformat-security] snprintf(dev_id, sizeof(dev_id), kvp_net_dir); ^ hv_kvp_daemon.c:705:2: warning: format not a string literal and no f

[PATCH V3 05/14] Drivers: hv: balloon: Add logging for dynamic memory operations

2016-11-06 Thread kys
From: Alex Ng Added logging to help troubleshoot common ballooning, hot add, and versioning issues. Signed-off-by: Alex Ng Signed-off-by: K. Y. Srinivasan --- drivers/hv/hv_balloon.c | 31 --- 1 files changed, 28 insertions(+), 3 deletions(-) diff --git a/driver

[PATCH V3 06/14] Drivers: hv: vss: Improve log messages.

2016-11-06 Thread kys
From: Alex Ng Adding log messages to help troubleshoot error cases and transaction handling. Signed-off-by: Alex Ng Signed-off-by: K. Y. Srinivasan --- drivers/hv/hv_snapshot.c | 25 +++-- 1 files changed, 19 insertions(+), 6 deletions(-) diff --git a/drivers/hv/hv_snap

[PATCH V3 08/14] Drivers: hv: balloon: Fix info request to show max page count

2016-11-06 Thread kys
From: Alex Ng Balloon driver was only printing the size of the info blob and not the actual content. This fixes it so that the info blob (max page count as configured in Hyper-V) is printed out. Signed-off-by: Alex Ng Signed-off-by: K. Y. Srinivasan --- drivers/hv/hv_balloon.c |9 +++-

[PATCH 00/10] Hyper-V: paravirtualized remote TLB flushing and hypercall improvements

2017-06-25 Thread kys
From: K. Y. Srinivasan Hyper-V supports hypercalls for doing local and remote TLB flushing and gives its guests hints when using hypercall is preferred. While doing hypercalls for local TLB flushes is probably not practical (and is not being suggested by modern Hyper-V versions) remote TLB flush

[PATCH 03/10] x86/hyper-v: make hv_do_hypercall() inline

2017-06-25 Thread kys
From: Vitaly Kuznetsov We have only three call sites for hv_do_hypercall() and we're going to change HVCALL_SIGNAL_EVENT to doing fast hypercall so we can inline this function for optimization. Hyper-V top level functional specification states that r9-r11 registers and flags may be clobbered by

[PATCH 06/10] x86/hyper-v: implement rep hypercalls

2017-06-25 Thread kys
From: Vitaly Kuznetsov Rep hypercalls are normal hypercalls which perform multiple actions at once. Hyper-V guarantees to return exectution to the caller in not more than 50us and the caller needs to use hypercall continuation. Touch NMI watchdog between hypercall invocations. This is going to b

[PATCH 01/10] x86/hyper-v: include hyperv/ only when CONFIG_HYPERV is set

2017-06-25 Thread kys
From: Vitaly Kuznetsov Code is arch/x86/hyperv/ is only needed when CONFIG_HYPERV is set, the 'basic' support and detection lives in arch/x86/kernel/cpu/mshyperv.c which is included when CONFIG_HYPERVISOR_GUEST is set. Signed-off-by: Vitaly Kuznetsov Reviewed-by: Andy Shevchenko Signed-off-by:

[PATCH 02/10] x86/hyper-v: stash the max number of virtual/logical processor

2017-06-25 Thread kys
From: Vitaly Kuznetsov Max virtual processor will be needed for 'extended' hypercalls supporting more than 64 vCPUs. While on it, unify on 'Hyper-V' in mshyperv.c as we currently have a mix, report acquired misc features as well. Signed-off-by: Vitaly Kuznetsov Reviewed-by: Andy Shevchenko Sig

[PATCH 04/10] x86/hyper-v: fast hypercall implementation

2017-06-25 Thread kys
From: Vitaly Kuznetsov Hyper-V supports 'fast' hypercalls when all parameters are passed through registers. Implement an inline version of a simpliest of these calls: hypercall with one 8-byte input and no output. Signed-off-by: Vitaly Kuznetsov Reviewed-by: Andy Shevchenko Signed-off-by: K. Y

[PATCH 05/10] hyper-v: use fast hypercall for HVCALL_SIGNAL_EVENT

2017-06-25 Thread kys
From: Vitaly Kuznetsov We need to pass only 8 bytes of input for HvSignalEvent which makes it a perfect fit for fast hypercall. hv_input_signal_event_buffer is not needed any more and hv_input_signal_event is converted to union for convenience. Signed-off-by: Vitaly Kuznetsov Reviewed-by: Andy

[PATCH 10/10] tracing/hyper-v: trace hyperv_mmu_flush_tlb_others()

2017-06-25 Thread kys
From: Vitaly Kuznetsov Add Hyper-V tracing subsystem and trace hyperv_mmu_flush_tlb_others(). Tracing is done the same way we do xen_mmu_flush_tlb_others(). Signed-off-by: Vitaly Kuznetsov Signed-off-by: K. Y. Srinivasan --- MAINTAINERS |1 + arch/x86/hyperv/mmu.c

[PATCH 09/10] x86/hyper-v: support extended CPU ranges for TLB flush hypercalls

2017-06-25 Thread kys
From: Vitaly Kuznetsov Hyper-V hosts may support more than 64 vCPUs, we need to use HVCALL_FLUSH_VIRTUAL_ADDRESS_SPACE_EX/LIST_EX hypercalls in this case. Signed-off-by: Vitaly Kuznetsov Signed-off-by: K. Y. Srinivasan --- arch/x86/hyperv/mmu.c | 130

[PATCH 07/10] hyper-v: globalize vp_index

2017-06-25 Thread kys
From: Vitaly Kuznetsov To support implementing remote TLB flushing on Hyper-V with a hypercall we need to make vp_index available outside of vmbus module. Rename and globalize. Signed-off-by: Vitaly Kuznetsov Reviewed-by: Andy Shevchenko Signed-off-by: K. Y. Srinivasan --- arch/x86/hyperv/hv

[PATCH 08/10] x86/hyper-v: use hypercall for remote TLB flush

2017-06-25 Thread kys
From: Vitaly Kuznetsov Hyper-V host can suggest us to use hypercall for doing remote TLB flush, this is supposed to work faster than IPIs. Implementation details: to do HvFlushVirtualAddress{Space,List} hypercalls we need to put the input somewhere in memory and we don't really want to have memo

[PATCH 0/6] Drivers: hv: vmbus: Ringbuffer cleanup and optimizations

2017-06-25 Thread kys
From: K. Y. Srinivasan This removes unused bits from vmbus internals, and also does some optimization to the host signalling part of ring buffer logic. Stephen Hemminger (6): vmbus: simplify hv_ringbuffer_read vmbus: drop unused ring_buffer_info elements vmbus: refactor hv_signal_on_read

[PATCH 0/6] Drivers: hv: vmbus: Ringbuffer cleanup and optimizations

2017-06-25 Thread kys
From: K. Y. Srinivasan This patch set removes unused bits from vmbus internals, and also does some optimization to the host signalling part of ring buffer logic. Stephen Hemminger (6): vmbus: simplify hv_ringbuffer_read vmbus: drop unused ring_buffer_info elements vmbus: refactor hv_signal

[PATCH 3/6] vmbus: refactor hv_signal_on_read

2017-06-25 Thread kys
From: Stephen Hemminger The function hv_signal_on_read was defined in hyperv.h and only used in one place in ring_buffer code. Clearer to just move it inline there. Signed-off-by: Stephen Hemminger Signed-off-by: K. Y. Srinivasan --- drivers/hv/ring_buffer.c | 32 +++

[PATCH 4/6] vmbus: eliminate duplicate cached index

2017-06-25 Thread kys
From: Stephen Hemminger Don't need cached read index anymore now that packet iterator is used. The iterator has the original read index until the visible read_index is updated. Signed-off-by: Stephen Hemminger Signed-off-by: K. Y. Srinivasan --- drivers/hv/ring_buffer.c | 17 ---

[PATCH 5/6] vmbus: more host signalling avoidance

2017-06-25 Thread kys
From: Stephen Hemminger Don't signal host if it has disabled interrupts for that ring buffer. Check the feature bit to see if host supports pending send size flag. Signed-off-by: Stephen Hemminger Signed-off-by: K. Y. Srinivasan --- drivers/hv/ring_buffer.c | 27 +++

[PATCH 2/6] vmbus: drop unused ring_buffer_info elements

2017-06-25 Thread kys
From: Stephen Hemminger The elements ring_data_start_offset and priv_write_index are not used. Signed-off-by: Stephen Hemminger Signed-off-by: K. Y. Srinivasan --- include/linux/hyperv.h |2 -- 1 files changed, 0 insertions(+), 2 deletions(-) diff --git a/include/linux/hyperv.h b/include

[PATCH 1/6] vmbus: simplify hv_ringbuffer_read

2017-06-25 Thread kys
From: Stephen Hemminger With new iterator functions (and the double mapping) the ring buffer read function can be greatly simplified. Signed-off-by: Stephen Hemminger Signed-off-by: K. Y. Srinivasan --- drivers/hv/ring_buffer.c | 118 +++--- 1 files ch

[PATCH 6/6] vmbus: add prefetch to ring buffer iterator

2017-06-25 Thread kys
From: Stephen Hemminger When iterating over incoming ring elements from the host, prefetch the next descriptor so that it is cache hot. Signed-off-by: Stephen Hemminger Signed-off-by: K. Y. Srinivasan --- drivers/hv/ring_buffer.c |7 ++- 1 files changed, 6 insertions(+), 1 deletions(-

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

2017-06-25 Thread kys
From: K. Y. Srinivasan Miscellaneous fixes. Alex Ng (1): Tools: hv: vss: Skip freezing filesystems backed by loop Stephen Hemminger (1): vmbus: re-enable channel tasklet drivers/hv/channel.c |2 ++ tools/hv/hv_vss_daemon.c |7 +++ 2 files changed, 9 insertions(+), 0 deleti

[PATCH 1/2] Tools: hv: vss: Skip freezing filesystems backed by loop

2017-06-25 Thread kys
From: Alex Ng Skip loop devices from the freeze/thaw operation. Signed-off-by: Alex Ng Signed-off-by: Vyronas Tsingaras Signed-off-by: K. Y. Srinivasan --- tools/hv/hv_vss_daemon.c |7 +++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/tools/hv/hv_vss_daemon.c b/tools

[PATCH 2/2] vmbus: re-enable channel tasklet

2017-06-25 Thread kys
From: Stephen Hemminger This problem shows up in 4.11 when netvsc driver is removed and reloaded. The problem is that the channel is closed during module removal and the tasklet for processing responses is disabled. When module is reloaded the channel is reopened but the tasklet is marked as disa

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

2017-08-06 Thread kys
From: K. Y. Srinivasan Miscellaneous fixes. Alex Ng (5): Tools: hv: vss: Skip freezing filesystems backed by loop Drivers: hv: balloon: Correctly update onlined page count Drivers: hv: balloon: Show the max dynamic memory assigned Drivers: hv: balloon: Initialize last_post_time on startu

[PATCH 2/5] Drivers: hv: balloon: Correctly update onlined page count

2017-08-06 Thread kys
From: Alex Ng Previously, num_pages_onlined was updated using value from memory online notifier. This is incorrect because they assume that all hot-added pages are online, even though we only online the amount that's backed by the host. We should update num_pages_onlined only when the balloon dri

[PATCH 5/5] Drivers: hv: kvp: Use MAX_ADAPTER_ID_SIZE for translating adapter id

2017-08-06 Thread kys
From: Alex Ng There's a bug which passes the output buffer size as MAX_IP_ADDR_SIZE, when converting the adapter_id field to UTF16. This is much larger than the actual size (MAX_ADAPTER_ID_SIZE). Fix this by passing the proper size. Fortunately, the translation is limited by the length of the in

[PATCH 1/5] Tools: hv: vss: Skip freezing filesystems backed by loop

2017-08-06 Thread kys
From: Alex Ng Since a loop device is backed by a file, a backup will already result in its parent filesystem being frozen. It's sufficient to just freeze the parent filesystem, so we can skip the loop device. This avoids a situation where a loop device and its parent filesystem are both frozen a

[PATCH 3/5] Drivers: hv: balloon: Show the max dynamic memory assigned

2017-08-06 Thread kys
From: Alex Ng Previously we were only showing max number of pages. We should make it more clear that this value is the max amount of dynamic memory that the Hyper-V host is willing to assign to this guest. Signed-off-by: Alex Ng Signed-off-by: K. Y. Srinivasan --- drivers/hv/hv_balloon.c |

[PATCH 4/5] Drivers: hv: balloon: Initialize last_post_time on startup

2017-08-06 Thread kys
From: Alex Ng When left uninitialized, this sometimes fails the following check in post_status(): if (!time_after(now, (last_post_time + HZ))) { return; } This causes unnecessary delays in reporting memory pressure to host after booting up. Signed-off-by: Alex N

[PATCH 1/2] Tools: hv: fix snprintf warning in kvp_daemon

2017-08-10 Thread kys
From: Olaf Hering Increase buffer size so that "_{-INT_MAX}" will fit. Spotted by the gcc7 snprintf checker. Signed-off-by: Olaf Hering Signed-off-by: K. Y. Srinivasan --- tools/hv/hv_kvp_daemon.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/tools/hv/hv_kvp_daemon

[PATCH 0/2] Tools: hv: Miscellaneous adjustments

2017-08-10 Thread kys
From: K. Y. Srinivasan Miscellaneous adjustments. Olaf Hering (2): Tools: hv: fix snprintf warning in kvp_daemon Tools: hv: update buffer handling in hv_fcopy_daemon tools/hv/hv_fcopy_daemon.c | 32 +--- tools/hv/hv_kvp_daemon.c |2 +- 2 files changed, 1

[PATCH 2/2] Tools: hv: update buffer handling in hv_fcopy_daemon

2017-08-10 Thread kys
From: Olaf Hering Currently this warning is triggered when compiling hv_fcopy_daemon: hv_fcopy_daemon.c:216:4: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] kernel_modver = *(__u32 *)buffer; Convert the send/receive buffer to a union and pas

[PATCH 1/1] Drivers: hv: vmbus: Fix rescind handling issues

2017-08-11 Thread kys
From: K. Y. Srinivasan This patch handles the following issues that were observed when we are handling racing channel offer message and rescind message for the same offer: 1. Since the host does not respond to messages on a rescinded channel, in the current code, we could be indefinitely blocked

[PATCH 1/1] x86/hyper-V: Allocate the IDT entry early in boot

2017-09-08 Thread kys
From: "K. Y. Srinivasan" Allocate the hypervisor callback IDT entry early in the boot sequence. Signed-off-by: K. Y. Srinivasan --- arch/x86/kernel/cpu/mshyperv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/kernel/cpu/mshyperv.c b/arch/x86/kernel/cpu/mshype

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

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

2017-09-09 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 cpu

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

2017-09-09 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 --- Documentation/ABI/stable/sysf

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

2017-09-09 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 slight

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

2017-09-09 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() -> vmbus_dev

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

2017-09-09 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 re

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

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

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

[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 --- drivers/hv/

[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 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 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(+) d

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

[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 +++ b/d

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

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

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

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

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

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

<    1   2   3   4   5   >