Hyper-V has added VMBus protocol versions 5.1 and 5.2 in recent release versions. Allow Linux guests to negotiate these new protocol versions on versions of Hyper-V that support them. While on this, also allow guests to negotiate the VMBus protocol version 4.1 (which was missing).
Unified · Split
| @@ -44,7 +44,10 @@ EXPORT_SYMBOL_GPL(vmbus_proto_version); · 43 unmodified lines | |||
| 44 | * Table of VMBus versions listed from newest to oldest. | 44 | * Table of VMBus versions listed from newest to oldest. |
| 45 | */ | 45 | */ |
| 46 | static __u32 vmbus_versions[] = { | 46 | static __u32 vmbus_versions[] = { |
| 47 | VERSION_WIN10_V5_2, | ||
| 48 | VERSION_WIN10_V5_1, | ||
| 47 | VERSION_WIN10_V5, | 49 | VERSION_WIN10_V5, |
| 50 | VERSION_WIN10_V4_1, | ||
| 48 | VERSION_WIN10, | 51 | VERSION_WIN10, |
| 49 | VERSION_WIN8_1, | 52 | VERSION_WIN8_1, |
| 50 | VERSION_WIN8, | 53 | VERSION_WIN8, |
| @@ -68,12 +71,12 @@ int vmbus_negotiate_version(struct vmbus_channel_msginfo *msginfo, u32 version) · 17 unmodified lines | |||
| 68 | msg->vmbus_version_requested = version; | 71 | msg->vmbus_version_requested = version; |
| 69 | 72 | ||
| 70 | /* | 73 | /* |
| 71 | * VMBus protocol 5.0 (VERSION_WIN10_V5) requires that we must use | 74 | * VMBus protocol 5.0 (VERSION_WIN10_V5) and higher require that we must |
| 72 | * VMBUS_MESSAGE_CONNECTION_ID_4 for the Initiate Contact Message, | 75 | * use VMBUS_MESSAGE_CONNECTION_ID_4 for the Initiate Contact Message, |
| 73 | * and for subsequent messages, we must use the Message Connection ID | 76 | * and for subsequent messages, we must use the Message Connection ID |
| 74 | * field in the host-returned Version Response Message. And, with | 77 | * field in the host-returned Version Response Message. And, with |
| 75 | * VERSION_WIN10_V5, we don't use msg->interrupt_page, but we tell | 78 | * VERSION_WIN10_V5 and higher, we don't use msg->interrupt_page, but we |
| 76 | * the host explicitly that we still use VMBUS_MESSAGE_SINT(2) for | 79 | * tell the host explicitly that we still use VMBUS_MESSAGE_SINT(2) for |
| 77 | * compatibility. | 80 | * compatibility. |
| 78 | * | 81 | * |
| 79 | * On old hosts, we should always use VMBUS_MESSAGE_CONNECTION_ID (1). | 82 | * On old hosts, we should always use VMBUS_MESSAGE_CONNECTION_ID (1). |
| @@ -399,7 +402,7 @@ int vmbus_post_msg(void *buffer, size_t buflen, bool can_sleep) · 319 unmodified lines | |||
| 399 | case HV_STATUS_INVALID_CONNECTION_ID: | 402 | case HV_STATUS_INVALID_CONNECTION_ID: |
| 400 | /* | 403 | /* |
| 401 | * See vmbus_negotiate_version(): VMBus protocol 5.0 | 404 | * See vmbus_negotiate_version(): VMBus protocol 5.0 |
| 402 | * requires that we must use | 405 | * and higher require that we must use |
| 403 | * VMBUS_MESSAGE_CONNECTION_ID_4 for the Initiate | 406 | * VMBUS_MESSAGE_CONNECTION_ID_4 for the Initiate |
| 404 | * Contact message, but on old hosts that only | 407 | * Contact message, but on old hosts that only |
| 405 | * support VMBus protocol 4.0 or lower, here we get | 408 | * support VMBus protocol 4.0 or lower, here we get |
| @@ -182,15 +182,21 @@ static inline u32 hv_get_avail_to_write_percent( · 181 unmodified lines | |||
| 182 | * 2 . 4 (Windows 8) | 182 | * 2 . 4 (Windows 8) |
| 183 | * 3 . 0 (Windows 8 R2) | 183 | * 3 . 0 (Windows 8 R2) |
| 184 | * 4 . 0 (Windows 10) | 184 | * 4 . 0 (Windows 10) |
| 185 | * 4 . 1 (Windows 10 RS3) | ||
| 185 | * 5 . 0 (Newer Windows 10) | 186 | * 5 . 0 (Newer Windows 10) |
| 187 | * 5 . 1 (Windows 10 RS4) | ||
| 188 | * 5 . 2 (Windows Server 2019, RS5) | ||
| 186 | */ | 189 | */ |
| 187 | 190 | ||
| 188 | #define VERSION_WS2008 ((0 << 16) | (13)) | 191 | #define VERSION_WS2008 ((0 << 16) | (13)) |
| 189 | #define VERSION_WIN7 ((1 << 16) | (1)) | 192 | #define VERSION_WIN7 ((1 << 16) | (1)) |
| 190 | #define VERSION_WIN8 ((2 << 16) | (4)) | 193 | #define VERSION_WIN8 ((2 << 16) | (4)) |
| 191 | #define VERSION_WIN8_1 ((3 << 16) | (0)) | 194 | #define VERSION_WIN8_1 ((3 << 16) | (0)) |
| 192 | #define VERSION_WIN10 ((4 << 16) | (0)) | 195 | #define VERSION_WIN10 ((4 << 16) | (0)) |
| 196 | #define VERSION_WIN10_V4_1 ((4 << 16) | (1)) | ||
| 193 | #define VERSION_WIN10_V5 ((5 << 16) | (0)) | 197 | #define VERSION_WIN10_V5 ((5 << 16) | (0)) |
| 198 | #define VERSION_WIN10_V5_1 ((5 << 16) | (1)) | ||
| 199 | #define VERSION_WIN10_V5_2 ((5 << 16) | (2)) | ||
| 194 | 200 | ||
| 195 | /* Make maximum size of pipe payload of 16K */ | 201 | /* Make maximum size of pipe payload of 16K */ |
| 196 | #define MAX_PIPE_DATA_PAYLOAD (sizeof(u8) * 16384) | 202 | #define MAX_PIPE_DATA_PAYLOAD (sizeof(u8) * 16384) |