android_kernel_oneplus_msm8998/drivers/hv
Long Li e34c69f209 HV: properly delay KVP packets when negotiation is in progress
commit a3ade8cc474d848676278660e65f5af1e9e094d9 upstream.

The host may send multiple negotiation packets
(due to timeout) before the KVP user-mode daemon
is connected. KVP user-mode daemon is connected.
We need to defer processing those packets
until the daemon is negotiated and connected.
It's okay for guest to respond
to all negotiation packets.

In addition, the host may send multiple staged
KVP requests as soon as negotiation is done.
We need to properly process those packets using one
tasklet for exclusive access to ring buffer.

This patch is based on the work of
Nick Meier <Nick.Meier@microsoft.com>.

The above is the original changelog of
a3ade8cc474d ("HV: properly delay KVP packets when negotiation is in progress"

Here I re-worked the original patch because the mainline version
can't work for the linux-4.4.y branch, on which channel->callback_event
doesn't exist yet. In the mainline, channel->callback_event was added by:
631e63a9f346 ("vmbus: change to per channel tasklet"). Here we don't want
to backport it to v4.4, as it requires extra supporting changes and fixes,
which are unnecessary as to the KVP bug we're trying to resolve.

NOTE: before this patch is used, we should cherry-pick the other related
3 patches from the mainline first:

The background of this backport request is that: recently Wang Jian reported
some KVP issues: https://github.com/LIS/lis-next/issues/593:
e.g. the /var/lib/hyperv/.kvp_pool_* files can not be updated, and sometimes
if the hv_kvp_daemon doesn't timely start, the host may not be able to query
the VM's IP address via KVP.

Reported-by: Wang Jian <jianjian.wang1@gmail.com>
Tested-by: Wang Jian <jianjian.wang1@gmail.com>
Signed-off-by: Dexuan Cui <decui@microsoft.com>
Signed-off-by: Long Li <longli@microsoft.com>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-10-20 09:52:38 +02:00
..
channel.c Drivers: hv: get rid of timeout in vmbus_open() 2017-04-27 09:09:32 +02:00
channel_mgmt.c Drivers: hv: vmbus: avoid scheduling in interrupt context in vmbus_initiate_unload() 2016-09-15 08:27:46 +02:00
connection.c Drivers: hv: vmbus: Reduce the delay between retries in vmbus_post_msg() 2017-04-27 09:09:32 +02:00
hv.c Drivers: hv: vmbus: fix build warning 2018-02-25 11:03:46 +01:00
hv_balloon.c Drivers: hv: balloon: account for gaps in hot add regions 2017-04-27 09:09:34 +02:00
hv_fcopy.c Drivers: hv: util: Pass the channel information during the init call 2018-10-20 09:52:38 +02:00
hv_kvp.c HV: properly delay KVP packets when negotiation is in progress 2018-10-20 09:52:38 +02:00
hv_snapshot.c Drivers: hv: util: Pass the channel information during the init call 2018-10-20 09:52:38 +02:00
hv_util.c Drivers: hv: util: Pass the channel information during the init call 2018-10-20 09:52:38 +02:00
hv_utils_transport.c Drivers: hv: util: catch allocation errors 2016-09-15 08:27:40 +02:00
hv_utils_transport.h Drivers: hv: util: introduce hv_utils_transport abstraction 2015-05-24 12:17:41 -07:00
hyperv_vmbus.h Drivers: hv: kvp: fix IP Failover 2018-10-20 09:52:38 +02:00
Kconfig x86: Make Linux guest support optional 2013-03-04 13:14:25 -08:00
Makefile Drivers: hv: util: introduce hv_utils_transport abstraction 2015-05-24 12:17:41 -07:00
ring_buffer.c Drivers: hv_vmbus: Fix signal to host condition 2015-08-05 11:44:29 -07:00
vmbus_drv.c Drivers: hv: avoid vfree() on crash 2017-03-26 12:13:18 +02:00