2015-11-25 17:20:50 |
Joshua R. Poulson |
bug |
|
|
added bug |
2015-11-25 17:21:24 |
Joshua R. Poulson |
summary |
[Hyper- |
[Hyper-V] hv: vmbus: Fix a host signaling bug |
|
2015-11-25 17:22:34 |
Joshua R. Poulson |
description |
Currently we have two policies for deciding when to signal the host:
One based on the ring buffer state and the other based on what the VMBUS client driver wants to do. Consider the case when the client wants to explicitly control when to signal the host. In this case, if the client were to defer signaling, we will not be able to signal the host subsequently when the client does want to signal since the ring buffer state will prevent the signaling. Implement logic to have only one signaling policy in force for a given channel.
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com>
Tested-by: Haiyang Zhang <haiyangz@microsoft.com>
Cc: <stable@vger.kernel.org> # v4.2+
---
drivers/hv/channel.c | 18 ++++++++++++++++++
include/linux/hyperv.h | 12 ++++++++++++
2 files changed, 30 insertions(+), 0 deletions(-)
diff --git a/drivers/hv/channel.c b/drivers/hv/channel.c index 77d2579..c6278c7 100644
--- a/drivers/hv/channel.c
+++ b/drivers/hv/channel.c
@@ -653,10 +653,19 @@ int vmbus_sendpacket_ctl(struct vmbus_channel *channel, void *buffer,
* on the ring. We will not signal if more data is
* to be placed.
*
+ * Based on the channel signal state, we will decide
+ * which signaling policy will be applied.
+ *
* If we cannot write to the ring-buffer; signal the host
* even if we may not have written anything. This is a rare
* enough condition that it should not matter.
*/
+
+ if (channel->signal_state)
+ signal = true;
+ else
+ kick_q = true;
+
if (((ret == 0) && kick_q && signal) || (ret))
vmbus_setevent(channel);
@@ -756,10 +765,19 @@ int vmbus_sendpacket_pagebuffer_ctl(struct vmbus_channel *channel,
* on the ring. We will not signal if more data is
* to be placed.
*
+ * Based on the channel signal state, we will decide
+ * which signaling policy will be applied.
+ *
* If we cannot write to the ring-buffer; signal the host
* even if we may not have written anything. This is a rare
* enough condition that it should not matter.
*/
+
+ if (channel->signal_state)
+ signal = true;
+ else
+ kick_q = true;
+
if (((ret == 0) && kick_q && signal) || (ret))
vmbus_setevent(channel);
diff --git a/include/linux/hyperv.h b/include/linux/hyperv.h index 437c9c8..7b1af52 100644
--- a/include/linux/hyperv.h
+++ b/include/linux/hyperv.h
@@ -756,8 +756,20 @@ struct vmbus_channel {
* link up channels based on their CPU affinity.
*/
struct list_head percpu_list;
+ /*
+ * Host signaling policy: The default policy will be
+ * based on the ring buffer state. We will also support
+ * a policy where the client driver can have explicit
+ * signaling control.
+ */
+ bool signal_state;
};
+static inline void set_channel_signal_state(struct vmbus_channel *c,
+bool state) {
+ c->signal_state = state;
+}
+
static inline void set_channel_read_state(struct vmbus_channel *c, bool state) {
c->batched_reading = state;
--
1.7.4.1 |
The following fix has been submitted upstream, but has high enough severity that we would like early inclusion into the Ubuntu kernel. Please consider for wily, vivid, and trusty (and the HWE kernels for the same).
Patch follows:
Currently we have two policies for deciding when to signal the host:
One based on the ring buffer state and the other based on what the VMBUS client driver wants to do. Consider the case when the client wants to explicitly control when to signal the host. In this case, if the client were to defer signaling, we will not be able to signal the host subsequently when the client does want to signal since the ring buffer state will prevent the signaling. Implement logic to have only one signaling policy in force for a given channel.
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com>
Tested-by: Haiyang Zhang <haiyangz@microsoft.com>
Cc: <stable@vger.kernel.org> # v4.2+
---
drivers/hv/channel.c | 18 ++++++++++++++++++
include/linux/hyperv.h | 12 ++++++++++++
2 files changed, 30 insertions(+), 0 deletions(-)
diff --git a/drivers/hv/channel.c b/drivers/hv/channel.c index 77d2579..c6278c7 100644
--- a/drivers/hv/channel.c
+++ b/drivers/hv/channel.c
@@ -653,10 +653,19 @@ int vmbus_sendpacket_ctl(struct vmbus_channel *channel, void *buffer,
* on the ring. We will not signal if more data is
* to be placed.
*
+ * Based on the channel signal state, we will decide
+ * which signaling policy will be applied.
+ *
* If we cannot write to the ring-buffer; signal the host
* even if we may not have written anything. This is a rare
* enough condition that it should not matter.
*/
+
+ if (channel->signal_state)
+ signal = true;
+ else
+ kick_q = true;
+
if (((ret == 0) && kick_q && signal) || (ret))
vmbus_setevent(channel);
@@ -756,10 +765,19 @@ int vmbus_sendpacket_pagebuffer_ctl(struct vmbus_channel *channel,
* on the ring. We will not signal if more data is
* to be placed.
*
+ * Based on the channel signal state, we will decide
+ * which signaling policy will be applied.
+ *
* If we cannot write to the ring-buffer; signal the host
* even if we may not have written anything. This is a rare
* enough condition that it should not matter.
*/
+
+ if (channel->signal_state)
+ signal = true;
+ else
+ kick_q = true;
+
if (((ret == 0) && kick_q && signal) || (ret))
vmbus_setevent(channel);
diff --git a/include/linux/hyperv.h b/include/linux/hyperv.h index 437c9c8..7b1af52 100644
--- a/include/linux/hyperv.h
+++ b/include/linux/hyperv.h
@@ -756,8 +756,20 @@ struct vmbus_channel {
* link up channels based on their CPU affinity.
*/
struct list_head percpu_list;
+ /*
+ * Host signaling policy: The default policy will be
+ * based on the ring buffer state. We will also support
+ * a policy where the client driver can have explicit
+ * signaling control.
+ */
+ bool signal_state;
};
+static inline void set_channel_signal_state(struct vmbus_channel *c,
+bool state) {
+ c->signal_state = state;
+}
+
static inline void set_channel_read_state(struct vmbus_channel *c, bool state) {
c->batched_reading = state;
--
1.7.4.1 |
|
2015-11-25 17:30:06 |
Brad Figg |
linux (Ubuntu): status |
New |
Incomplete |
|
2015-11-25 18:20:58 |
Joshua R. Poulson |
linux (Ubuntu): status |
Incomplete |
Confirmed |
|
2015-11-25 18:48:56 |
Joseph Salisbury |
linux (Ubuntu): importance |
Undecided |
High |
|
2015-11-25 18:49:07 |
Joseph Salisbury |
nominated for series |
|
Ubuntu Trusty |
|
2015-11-25 18:49:07 |
Joseph Salisbury |
bug task added |
|
linux (Ubuntu Trusty) |
|
2015-11-25 18:49:07 |
Joseph Salisbury |
nominated for series |
|
Ubuntu Wily |
|
2015-11-25 18:49:07 |
Joseph Salisbury |
bug task added |
|
linux (Ubuntu Wily) |
|
2015-11-25 18:49:07 |
Joseph Salisbury |
nominated for series |
|
Ubuntu Xenial |
|
2015-11-25 18:49:07 |
Joseph Salisbury |
bug task added |
|
linux (Ubuntu Xenial) |
|
2015-11-25 18:49:07 |
Joseph Salisbury |
nominated for series |
|
Ubuntu Vivid |
|
2015-11-25 18:49:07 |
Joseph Salisbury |
bug task added |
|
linux (Ubuntu Vivid) |
|
2015-11-25 18:49:14 |
Joseph Salisbury |
linux (Ubuntu Xenial): status |
Confirmed |
Triaged |
|
2015-11-25 18:49:17 |
Joseph Salisbury |
linux (Ubuntu Wily): status |
New |
Triaged |
|
2015-11-25 18:49:24 |
Joseph Salisbury |
linux (Ubuntu Vivid): status |
New |
Triaged |
|
2015-11-25 18:49:27 |
Joseph Salisbury |
linux (Ubuntu Trusty): status |
New |
Triaged |
|
2015-11-25 18:49:29 |
Joseph Salisbury |
linux (Ubuntu Wily): importance |
Undecided |
High |
|
2015-11-25 18:49:31 |
Joseph Salisbury |
linux (Ubuntu Vivid): importance |
Undecided |
High |
|
2015-11-25 18:49:33 |
Joseph Salisbury |
linux (Ubuntu Trusty): importance |
Undecided |
High |
|
2015-11-25 18:49:35 |
Joseph Salisbury |
linux (Ubuntu Trusty): assignee |
|
Joseph Salisbury (jsalisbury) |
|
2015-11-25 18:49:37 |
Joseph Salisbury |
linux (Ubuntu Vivid): assignee |
|
Joseph Salisbury (jsalisbury) |
|
2015-11-25 18:49:40 |
Joseph Salisbury |
linux (Ubuntu Wily): assignee |
|
Joseph Salisbury (jsalisbury) |
|
2015-11-25 18:49:42 |
Joseph Salisbury |
linux (Ubuntu Xenial): assignee |
|
Joseph Salisbury (jsalisbury) |
|
2015-11-25 18:50:39 |
Joseph Salisbury |
tags |
|
kernel-hyper-v trusty vivid wily xenial |
|
2015-12-11 19:49:24 |
Joseph Salisbury |
linux (Ubuntu Xenial): status |
Triaged |
In Progress |
|
2015-12-11 19:49:26 |
Joseph Salisbury |
linux (Ubuntu Wily): status |
Triaged |
In Progress |
|
2015-12-11 22:08:29 |
Joseph Salisbury |
linux (Ubuntu Vivid): status |
Triaged |
Fix Released |
|
2016-01-20 14:40:50 |
Joseph Salisbury |
bug task added |
|
linux-lts-trusty (Ubuntu) |
|
2016-01-20 14:41:01 |
Joseph Salisbury |
bug task deleted |
linux-lts-trusty (Ubuntu Vivid) |
|
|
2016-01-20 14:41:09 |
Joseph Salisbury |
bug task deleted |
linux-lts-trusty (Ubuntu Wily) |
|
|
2016-01-20 14:41:15 |
Joseph Salisbury |
bug task deleted |
linux-lts-trusty (Ubuntu Xenial) |
|
|
2016-01-20 14:49:20 |
Joseph Salisbury |
linux-lts-trusty (Ubuntu Trusty): status |
New |
In Progress |
|
2016-01-20 14:49:23 |
Joseph Salisbury |
linux-lts-trusty (Ubuntu): status |
New |
In Progress |
|
2016-01-20 14:49:26 |
Joseph Salisbury |
linux-lts-trusty (Ubuntu): importance |
Undecided |
High |
|
2016-01-20 14:49:28 |
Joseph Salisbury |
linux-lts-trusty (Ubuntu Trusty): importance |
Undecided |
High |
|
2016-01-20 14:49:30 |
Joseph Salisbury |
linux-lts-trusty (Ubuntu): assignee |
|
Joseph Salisbury (jsalisbury) |
|
2016-01-20 14:49:32 |
Joseph Salisbury |
linux-lts-trusty (Ubuntu Trusty): assignee |
|
Joseph Salisbury (jsalisbury) |
|
2016-01-20 16:00:07 |
Joseph Salisbury |
linux (Ubuntu Trusty): status |
Triaged |
In Progress |
|
2016-01-22 15:35:45 |
Joseph Salisbury |
bug task deleted |
linux (Ubuntu Vivid) |
|
|
2016-01-25 16:19:41 |
Brad Figg |
linux (Ubuntu Trusty): status |
In Progress |
Fix Committed |
|
2016-02-05 17:55:13 |
Brad Figg |
tags |
kernel-hyper-v trusty vivid wily xenial |
kernel-hyper-v trusty verification-needed-trusty vivid wily xenial |
|
2016-02-06 23:09:43 |
Chris Valean |
bug |
|
|
added subscriber Chris Valean |
2016-02-11 15:21:35 |
Brad Figg |
linux (Ubuntu Wily): status |
In Progress |
Fix Committed |
|
2016-02-11 15:21:39 |
Brad Figg |
linux (Ubuntu Xenial): status |
In Progress |
Fix Committed |
|
2016-02-15 09:45:47 |
Chris Valean |
tags |
kernel-hyper-v trusty verification-needed-trusty vivid wily xenial |
kernel-hyper-v trusty verification-done-wily verification-needed-trusty vivid wily xenial |
|
2016-02-22 18:36:52 |
Launchpad Janitor |
linux (Ubuntu Trusty): status |
Fix Committed |
Fix Released |
|
2016-02-22 18:36:52 |
Launchpad Janitor |
cve linked |
|
2016-1575 |
|
2016-02-22 18:36:52 |
Launchpad Janitor |
cve linked |
|
2016-1576 |
|
2016-02-22 18:38:30 |
Launchpad Janitor |
linux-lts-trusty (Ubuntu): status |
In Progress |
Fix Released |
|
2016-02-22 18:38:31 |
Launchpad Janitor |
linux-lts-trusty (Ubuntu): status |
In Progress |
Fix Released |
|
2016-03-02 18:24:37 |
Brad Figg |
linux-lts-trusty (Ubuntu Trusty): status |
In Progress |
Fix Released |
|
2016-03-02 20:09:59 |
Brad Figg |
linux (Ubuntu Xenial): status |
Fix Committed |
Fix Released |
|
2016-03-02 20:10:01 |
Brad Figg |
linux (Ubuntu Wily): status |
Fix Committed |
Fix Released |
|