]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/3.10.42/drivers-hv-vmbus-negotiate-version-3.0-when-running-on.patch
drop queue-4.14/mips-make-sure-dt-memory-regions-are-valid.patch
[thirdparty/kernel/stable-queue.git] / releases / 3.10.42 / drivers-hv-vmbus-negotiate-version-3.0-when-running-on.patch
CommitLineData
dfa622bb
GKH
1From 03367ef5ea811475187a0732aada068919e14d61 Mon Sep 17 00:00:00 2001
2From: "K. Y. Srinivasan" <kys@microsoft.com>
3Date: Thu, 3 Apr 2014 18:02:45 -0700
4Subject: Drivers: hv: vmbus: Negotiate version 3.0 when running on
5 ws2012r2 hosts
6
7From: "K. Y. Srinivasan" <kys@microsoft.com>
8
9commit 03367ef5ea811475187a0732aada068919e14d61 upstream.
10
11Only ws2012r2 hosts support the ability to reconnect to the host on VMBUS. This functionality
12is needed by kexec in Linux. To use this functionality we need to negotiate version 3.0 of the
13VMBUS protocol.
14
15Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
16Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
17
18
19---
20 drivers/hv/connection.c | 6 ++++++
21 include/linux/hyperv.h | 7 +++++--
22 2 files changed, 11 insertions(+), 2 deletions(-)
23
24--- a/drivers/hv/connection.c
25+++ b/drivers/hv/connection.c
26@@ -55,6 +55,9 @@ static __u32 vmbus_get_next_version(__u3
27 case (VERSION_WIN8):
28 return VERSION_WIN7;
29
30+ case (VERSION_WIN8_1):
31+ return VERSION_WIN8;
32+
33 case (VERSION_WS2008):
34 default:
35 return VERSION_INVAL;
36@@ -80,6 +83,9 @@ static int vmbus_negotiate_version(struc
37 (void *)((unsigned long)vmbus_connection.monitor_pages +
38 PAGE_SIZE));
39
40+ if (version == VERSION_WIN8_1)
41+ msg->target_vcpu = hv_context.vp_index[smp_processor_id()];
42+
43 /*
44 * Add to list before we send the request since we may
45 * receive the response before returning from this routine
46--- a/include/linux/hyperv.h
47+++ b/include/linux/hyperv.h
48@@ -483,15 +483,18 @@ hv_get_ringbuffer_availbytes(struct hv_r
49 * 0 . 13 (Windows Server 2008)
50 * 1 . 1 (Windows 7)
51 * 2 . 4 (Windows 8)
52+ * 3 . 0 (Windows 8 R2)
53 */
54
55 #define VERSION_WS2008 ((0 << 16) | (13))
56 #define VERSION_WIN7 ((1 << 16) | (1))
57 #define VERSION_WIN8 ((2 << 16) | (4))
58+#define VERSION_WIN8_1 ((3 << 16) | (0))
59+
60
61 #define VERSION_INVAL -1
62
63-#define VERSION_CURRENT VERSION_WIN8
64+#define VERSION_CURRENT VERSION_WIN8_1
65
66 /* Make maximum size of pipe payload of 16K */
67 #define MAX_PIPE_DATA_PAYLOAD (sizeof(u8) * 16384)
68@@ -894,7 +897,7 @@ struct vmbus_channel_relid_released {
69 struct vmbus_channel_initiate_contact {
70 struct vmbus_channel_message_header header;
71 u32 vmbus_version_requested;
72- u32 padding2;
73+ u32 target_vcpu; /* The VCPU the host should respond to */
74 u64 interrupt_page;
75 u64 monitor_page1;
76 u64 monitor_page2;