]> git.baikalelectronics.ru Git - kernel.git/commit
Drivers: hv: vmbus: Fix ring buffer signaling
authorMichael Kelley <mhkelley@outlook.com>
Mon, 5 Mar 2018 05:24:08 +0000 (22:24 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 6 Mar 2018 17:52:59 +0000 (09:52 -0800)
commit6697a1ddffa306e46f33036c4eafa10778c562af
treeac2051e95a2b49c28134195991230702aa06e666
parent4b7f3cda724036ce118b56470a2e8d51c57d3136
Drivers: hv: vmbus: Fix ring buffer signaling

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)
   *after* pending_send_sz is read in order to avoid a race condition
3. Comparisons with pending_send_sz must treat the "equals" case as
   not-enough-space
4. Don't signal if the pending_send_sz feature is not present. Older
   versions of Hyper-V that don't implement this feature will poll.

Fixes: 7ab69f0248ae ("vmbus: more host signalling avoidance")
Cc: Stable <stable@vger.kernel.org> # 4.14 and above
Signed-off-by: Michael Kelley <mhkelley@outlook.com>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/hv/ring_buffer.c