mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-19 17:26:28 +00:00
kernel: Add initial support for 4.10.x kernels
Note, this also removes the LTS4.4 build options and replaces it with a KERNEL= build option to select the kernel to build. Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
This commit is contained in:
parent
dc7d738356
commit
e671d4664f
54
kernel/Dockerfile.4.10
Normal file
54
kernel/Dockerfile.4.10
Normal file
@ -0,0 +1,54 @@
|
||||
FROM mobylinux/alpine-build-kernel:0e893fbf6fa7638d2f23354de03ea11017bb8065@sha256:3ef3f9d11f0802b759dbd9c43a7706cf0ec37263c99ae90e2b10c29ea85739fa
|
||||
|
||||
ARG KERNEL_VERSION
|
||||
ARG DEBUG=0
|
||||
|
||||
ENV KERNEL_SOURCE=https://www.kernel.org/pub/linux/kernel/v4.x/linux-${KERNEL_VERSION}.tar.xz
|
||||
|
||||
RUN curl -fsSL -o linux-${KERNEL_VERSION}.tar.xz ${KERNEL_SOURCE}
|
||||
|
||||
RUN cat linux-${KERNEL_VERSION}.tar.xz | tar --absolute-names -xJ && mv /linux-${KERNEL_VERSION} /linux
|
||||
|
||||
# NOTE: This currently re-uses the 4.9 kernel config
|
||||
COPY kernel_config /linux/arch/x86/configs/x86_64_defconfig
|
||||
COPY kernel_config.debug /linux/debug_config
|
||||
|
||||
RUN if [ $DEBUG -ne "0" ]; then \
|
||||
sed -i 's/CONFIG_PANIC_ON_OOPS=y/# CONFIG_PANIC_ON_OOPS is not set/' /linux/arch/x86/configs/x86_64_defconfig; \
|
||||
cat /linux/debug_config >> /linux/arch/x86/configs/x86_64_defconfig; \
|
||||
fi
|
||||
|
||||
# Apply local patches
|
||||
COPY patches-4.10 /patches
|
||||
RUN cd /linux && \
|
||||
set -e && for patch in /patches/*.patch; do \
|
||||
echo "Applying $patch"; \
|
||||
patch -p1 < "$patch"; \
|
||||
done
|
||||
|
||||
RUN cd /linux && \
|
||||
make defconfig && \
|
||||
make oldconfig && \
|
||||
make -j "$(getconf _NPROCESSORS_ONLN)" KCFLAGS="-fno-pie"
|
||||
RUN cd /linux && \
|
||||
make INSTALL_MOD_PATH=/tmp/kernel-modules modules_install && \
|
||||
( DVER=$(basename $(find /tmp/kernel-modules/lib/modules/ -mindepth 1 -maxdepth 1)) && \
|
||||
cd /tmp/kernel-modules/lib/modules/$DVER && \
|
||||
rm build source && \
|
||||
ln -s /usr/src/linux-headers-$DVER build ) && \
|
||||
mkdir -p /tmp/kernel-headers/usr && \
|
||||
make INSTALL_HDR_PATH=/tmp/kernel-headers/usr headers_install && \
|
||||
( cd /tmp/kernel-headers && tar cf /kernel-headers.tar usr ) && \
|
||||
( cd /tmp/kernel-modules && tar cf /kernel-modules.tar lib ) && \
|
||||
cp vmlinux arch/x86_64/boot/bzImage /
|
||||
|
||||
RUN DVER=$(basename $(find /tmp/kernel-modules/lib/modules/ -mindepth 1 -maxdepth 1)) && \
|
||||
dir=/tmp/usr/src/linux-headers-$DVER && \
|
||||
mkdir -p $dir && \
|
||||
cp /linux/.config $dir && \
|
||||
cd /linux && \
|
||||
cp -a include "$dir" && \
|
||||
mkdir -p "$dir"/arch/x86 && cp -a arch/x86/include "$dir"/arch/x86/ && \
|
||||
( cd /tmp && tar cf /kernel-dev.tar usr/src )
|
||||
|
||||
RUN printf "KERNEL_SOURCE=${KERNEL_SOURCE}\n" > /kernel-source-info
|
@ -18,17 +18,24 @@ all: bzImage tag
|
||||
# frequently.
|
||||
#
|
||||
# IMAGE_VERSION is used to determine if a new image should be pushed to hub.
|
||||
ifdef LTS4.4
|
||||
ifeq ($(KERNEL),v4.4)
|
||||
KERNEL_VERSION=4.4.55
|
||||
IMAGE_VERSION=$(KERNEL_VERSION)-0
|
||||
IMAGE_VERSION=$(KERNEL_VERSION)-1
|
||||
IMAGE_MAJOR_VERSION=4.4.x
|
||||
DEPS=Dockerfile.4.4 Makefile kernel_config kernel_config.debug kernel_config.4.4 patches-4.4
|
||||
else
|
||||
KERNEL_VERSION=4.9.16
|
||||
ifeq ($(KERNEL),v4.10)
|
||||
KERNEL_VERSION=4.10.4
|
||||
IMAGE_VERSION=$(KERNEL_VERSION)-0
|
||||
IMAGE_MAJOR_VERSION=4.10.x
|
||||
DEPS=Dockerfile.4.10 Makefile kernel_config kernel_config.debug patches-4.10
|
||||
else
|
||||
KERNEL_VERSION=4.9.16
|
||||
IMAGE_VERSION=$(KERNEL_VERSION)-1
|
||||
IMAGE_MAJOR_VERSION=4.9.x
|
||||
DEPS=Dockerfile Makefile kernel_config kernel_config.debug patches-4.9
|
||||
endif
|
||||
endif
|
||||
|
||||
kernel.tag: $(DEPS)
|
||||
BUILD=$$( tar cf - $^ | docker build -f $< --build-arg DEBUG=$(DEBUG) --build-arg KERNEL_VERSION=$(KERNEL_VERSION) -q - ) && [ -n "$$BUILD" ] && echo "Built $$BUILD" && echo "$$BUILD" > $@
|
||||
|
1790
kernel/patches-4.10/0001-hv_sock-introduce-Hyper-V-Sockets.patch
Normal file
1790
kernel/patches-4.10/0001-hv_sock-introduce-Hyper-V-Sockets.patch
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,491 @@
|
||||
From d4e5be67dc204637a5fc1cf96e8ab0135253e979 Mon Sep 17 00:00:00 2001
|
||||
From: Alex Ng <alexng@messages.microsoft.com>
|
||||
Date: Sat, 28 Jan 2017 12:37:17 -0700
|
||||
Subject: [PATCH 2/3] Drivers: hv: vmbus: Use all supported IC versions to
|
||||
negotiate
|
||||
|
||||
Previously, we were assuming that each IC protocol version was tied to a
|
||||
specific host version. For example, some Windows 10 preview hosts only
|
||||
support v3 TimeSync even though driver assumes v4 is supported by all
|
||||
Windows 10 hosts.
|
||||
|
||||
The guest will stop trying to negotiate even though older supported
|
||||
versions may still be offered by the host.
|
||||
|
||||
Make IC version negotiation more robust by going through all versions
|
||||
that are supported by the guest.
|
||||
|
||||
Fixes: 3da0401b4d0e ("Drivers: hv: utils: Fix the mapping between host
|
||||
version and protocol to use")
|
||||
|
||||
Reported-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
|
||||
Signed-off-by: Alex Ng <alexng@messages.microsoft.com>
|
||||
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
|
||||
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
||||
(cherry picked from commit a1656454131880980bc3a5313c8bf66ef5990c91)
|
||||
---
|
||||
drivers/hv/channel_mgmt.c | 80 +++++++++++++++++++++++++++-------------
|
||||
drivers/hv/hv_fcopy.c | 20 +++++++---
|
||||
drivers/hv/hv_kvp.c | 41 +++++++++------------
|
||||
drivers/hv/hv_snapshot.c | 18 +++++++--
|
||||
drivers/hv/hv_util.c | 94 +++++++++++++++++++++++++----------------------
|
||||
include/linux/hyperv.h | 7 ++--
|
||||
6 files changed, 154 insertions(+), 106 deletions(-)
|
||||
|
||||
diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c
|
||||
index 0af7e39006c8..b42d69c05ebb 100644
|
||||
--- a/drivers/hv/channel_mgmt.c
|
||||
+++ b/drivers/hv/channel_mgmt.c
|
||||
@@ -203,33 +203,34 @@ static u16 hv_get_dev_type(const struct vmbus_channel *channel)
|
||||
* @buf: Raw buffer channel data
|
||||
*
|
||||
* @icmsghdrp is of type &struct icmsg_hdr.
|
||||
- * @negop is of type &struct icmsg_negotiate.
|
||||
* Set up and fill in default negotiate response message.
|
||||
*
|
||||
- * The fw_version specifies the framework version that
|
||||
- * we can support and srv_version specifies the service
|
||||
- * version we can support.
|
||||
+ * The fw_version and fw_vercnt specifies the framework version that
|
||||
+ * we can support.
|
||||
+ *
|
||||
+ * The srv_version and srv_vercnt specifies the service
|
||||
+ * versions we can support.
|
||||
+ *
|
||||
+ * Versions are given in decreasing order.
|
||||
+ *
|
||||
+ * nego_fw_version and nego_srv_version store the selected protocol versions.
|
||||
*
|
||||
* Mainly used by Hyper-V drivers.
|
||||
*/
|
||||
bool vmbus_prep_negotiate_resp(struct icmsg_hdr *icmsghdrp,
|
||||
- struct icmsg_negotiate *negop, u8 *buf,
|
||||
- int fw_version, int srv_version)
|
||||
+ u8 *buf, const int *fw_version, int fw_vercnt,
|
||||
+ const int *srv_version, int srv_vercnt,
|
||||
+ int *nego_fw_version, int *nego_srv_version)
|
||||
{
|
||||
int icframe_major, icframe_minor;
|
||||
int icmsg_major, icmsg_minor;
|
||||
int fw_major, fw_minor;
|
||||
int srv_major, srv_minor;
|
||||
- int i;
|
||||
+ int i, j;
|
||||
bool found_match = false;
|
||||
+ struct icmsg_negotiate *negop;
|
||||
|
||||
icmsghdrp->icmsgsize = 0x10;
|
||||
- fw_major = (fw_version >> 16);
|
||||
- fw_minor = (fw_version & 0xFFFF);
|
||||
-
|
||||
- srv_major = (srv_version >> 16);
|
||||
- srv_minor = (srv_version & 0xFFFF);
|
||||
-
|
||||
negop = (struct icmsg_negotiate *)&buf[
|
||||
sizeof(struct vmbuspipe_hdr) +
|
||||
sizeof(struct icmsg_hdr)];
|
||||
@@ -245,13 +246,22 @@ bool vmbus_prep_negotiate_resp(struct icmsg_hdr *icmsghdrp,
|
||||
* support.
|
||||
*/
|
||||
|
||||
- for (i = 0; i < negop->icframe_vercnt; i++) {
|
||||
- if ((negop->icversion_data[i].major == fw_major) &&
|
||||
- (negop->icversion_data[i].minor == fw_minor)) {
|
||||
- icframe_major = negop->icversion_data[i].major;
|
||||
- icframe_minor = negop->icversion_data[i].minor;
|
||||
- found_match = true;
|
||||
+ for (i = 0; i < fw_vercnt; i++) {
|
||||
+ fw_major = (fw_version[i] >> 16);
|
||||
+ fw_minor = (fw_version[i] & 0xFFFF);
|
||||
+
|
||||
+ for (j = 0; j < negop->icframe_vercnt; j++) {
|
||||
+ if ((negop->icversion_data[j].major == fw_major) &&
|
||||
+ (negop->icversion_data[j].minor == fw_minor)) {
|
||||
+ icframe_major = negop->icversion_data[j].major;
|
||||
+ icframe_minor = negop->icversion_data[j].minor;
|
||||
+ found_match = true;
|
||||
+ break;
|
||||
+ }
|
||||
}
|
||||
+
|
||||
+ if (found_match)
|
||||
+ break;
|
||||
}
|
||||
|
||||
if (!found_match)
|
||||
@@ -259,14 +269,26 @@ bool vmbus_prep_negotiate_resp(struct icmsg_hdr *icmsghdrp,
|
||||
|
||||
found_match = false;
|
||||
|
||||
- for (i = negop->icframe_vercnt;
|
||||
- (i < negop->icframe_vercnt + negop->icmsg_vercnt); i++) {
|
||||
- if ((negop->icversion_data[i].major == srv_major) &&
|
||||
- (negop->icversion_data[i].minor == srv_minor)) {
|
||||
- icmsg_major = negop->icversion_data[i].major;
|
||||
- icmsg_minor = negop->icversion_data[i].minor;
|
||||
- found_match = true;
|
||||
+ for (i = 0; i < srv_vercnt; i++) {
|
||||
+ srv_major = (srv_version[i] >> 16);
|
||||
+ srv_minor = (srv_version[i] & 0xFFFF);
|
||||
+
|
||||
+ for (j = negop->icframe_vercnt;
|
||||
+ (j < negop->icframe_vercnt + negop->icmsg_vercnt);
|
||||
+ j++) {
|
||||
+
|
||||
+ if ((negop->icversion_data[j].major == srv_major) &&
|
||||
+ (negop->icversion_data[j].minor == srv_minor)) {
|
||||
+
|
||||
+ icmsg_major = negop->icversion_data[j].major;
|
||||
+ icmsg_minor = negop->icversion_data[j].minor;
|
||||
+ found_match = true;
|
||||
+ break;
|
||||
+ }
|
||||
}
|
||||
+
|
||||
+ if (found_match)
|
||||
+ break;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -283,6 +305,12 @@ bool vmbus_prep_negotiate_resp(struct icmsg_hdr *icmsghdrp,
|
||||
negop->icmsg_vercnt = 1;
|
||||
}
|
||||
|
||||
+ if (nego_fw_version)
|
||||
+ *nego_fw_version = (icframe_major << 16) | icframe_minor;
|
||||
+
|
||||
+ if (nego_srv_version)
|
||||
+ *nego_srv_version = (icmsg_major << 16) | icmsg_minor;
|
||||
+
|
||||
negop->icversion_data[0].major = icframe_major;
|
||||
negop->icversion_data[0].minor = icframe_minor;
|
||||
negop->icversion_data[1].major = icmsg_major;
|
||||
diff --git a/drivers/hv/hv_fcopy.c b/drivers/hv/hv_fcopy.c
|
||||
index e47d8c9db03a..0a315e6aa589 100644
|
||||
--- a/drivers/hv/hv_fcopy.c
|
||||
+++ b/drivers/hv/hv_fcopy.c
|
||||
@@ -31,6 +31,16 @@
|
||||
#define WIN8_SRV_MINOR 1
|
||||
#define WIN8_SRV_VERSION (WIN8_SRV_MAJOR << 16 | WIN8_SRV_MINOR)
|
||||
|
||||
+#define FCOPY_VER_COUNT 1
|
||||
+static const int fcopy_versions[] = {
|
||||
+ WIN8_SRV_VERSION
|
||||
+};
|
||||
+
|
||||
+#define FW_VER_COUNT 1
|
||||
+static const int fw_versions[] = {
|
||||
+ UTIL_FW_VERSION
|
||||
+};
|
||||
+
|
||||
/*
|
||||
* Global state maintained for transaction that is being processed.
|
||||
* For a class of integration services, including the "file copy service",
|
||||
@@ -228,8 +238,6 @@ void hv_fcopy_onchannelcallback(void *context)
|
||||
u64 requestid;
|
||||
struct hv_fcopy_hdr *fcopy_msg;
|
||||
struct icmsg_hdr *icmsghdr;
|
||||
- struct icmsg_negotiate *negop = NULL;
|
||||
- int util_fw_version;
|
||||
int fcopy_srv_version;
|
||||
|
||||
if (fcopy_transaction.state > HVUTIL_READY)
|
||||
@@ -243,10 +251,10 @@ void hv_fcopy_onchannelcallback(void *context)
|
||||
icmsghdr = (struct icmsg_hdr *)&recv_buffer[
|
||||
sizeof(struct vmbuspipe_hdr)];
|
||||
if (icmsghdr->icmsgtype == ICMSGTYPE_NEGOTIATE) {
|
||||
- util_fw_version = UTIL_FW_VERSION;
|
||||
- fcopy_srv_version = WIN8_SRV_VERSION;
|
||||
- vmbus_prep_negotiate_resp(icmsghdr, negop, recv_buffer,
|
||||
- util_fw_version, fcopy_srv_version);
|
||||
+ vmbus_prep_negotiate_resp(icmsghdr, recv_buffer,
|
||||
+ fw_versions, FW_VER_COUNT,
|
||||
+ fcopy_versions, FCOPY_VER_COUNT,
|
||||
+ NULL, &fcopy_srv_version);
|
||||
} else {
|
||||
fcopy_msg = (struct hv_fcopy_hdr *)&recv_buffer[
|
||||
sizeof(struct vmbuspipe_hdr) +
|
||||
diff --git a/drivers/hv/hv_kvp.c b/drivers/hv/hv_kvp.c
|
||||
index 3abfc5983c97..2cc670442f6c 100644
|
||||
--- a/drivers/hv/hv_kvp.c
|
||||
+++ b/drivers/hv/hv_kvp.c
|
||||
@@ -46,6 +46,19 @@
|
||||
#define WIN8_SRV_MINOR 0
|
||||
#define WIN8_SRV_VERSION (WIN8_SRV_MAJOR << 16 | WIN8_SRV_MINOR)
|
||||
|
||||
+#define KVP_VER_COUNT 3
|
||||
+static const int kvp_versions[] = {
|
||||
+ WIN8_SRV_VERSION,
|
||||
+ WIN7_SRV_VERSION,
|
||||
+ WS2008_SRV_VERSION
|
||||
+};
|
||||
+
|
||||
+#define FW_VER_COUNT 2
|
||||
+static const int fw_versions[] = {
|
||||
+ UTIL_FW_VERSION,
|
||||
+ UTIL_WS2K8_FW_VERSION
|
||||
+};
|
||||
+
|
||||
/*
|
||||
* Global state maintained for transaction that is being processed. For a class
|
||||
* of integration services, including the "KVP service", the specified protocol
|
||||
@@ -610,8 +623,6 @@ void hv_kvp_onchannelcallback(void *context)
|
||||
struct hv_kvp_msg *kvp_msg;
|
||||
|
||||
struct icmsg_hdr *icmsghdrp;
|
||||
- struct icmsg_negotiate *negop = NULL;
|
||||
- int util_fw_version;
|
||||
int kvp_srv_version;
|
||||
static enum {NEGO_NOT_STARTED,
|
||||
NEGO_IN_PROGRESS,
|
||||
@@ -640,28 +651,10 @@ void hv_kvp_onchannelcallback(void *context)
|
||||
sizeof(struct vmbuspipe_hdr)];
|
||||
|
||||
if (icmsghdrp->icmsgtype == ICMSGTYPE_NEGOTIATE) {
|
||||
- /*
|
||||
- * Based on the host, select appropriate
|
||||
- * framework and service versions we will
|
||||
- * negotiate.
|
||||
- */
|
||||
- switch (vmbus_proto_version) {
|
||||
- case (VERSION_WS2008):
|
||||
- util_fw_version = UTIL_WS2K8_FW_VERSION;
|
||||
- kvp_srv_version = WS2008_SRV_VERSION;
|
||||
- break;
|
||||
- case (VERSION_WIN7):
|
||||
- util_fw_version = UTIL_FW_VERSION;
|
||||
- kvp_srv_version = WIN7_SRV_VERSION;
|
||||
- break;
|
||||
- default:
|
||||
- util_fw_version = UTIL_FW_VERSION;
|
||||
- kvp_srv_version = WIN8_SRV_VERSION;
|
||||
- }
|
||||
- vmbus_prep_negotiate_resp(icmsghdrp, negop,
|
||||
- recv_buffer, util_fw_version,
|
||||
- kvp_srv_version);
|
||||
-
|
||||
+ vmbus_prep_negotiate_resp(icmsghdrp,
|
||||
+ recv_buffer, fw_versions, FW_VER_COUNT,
|
||||
+ kvp_versions, KVP_VER_COUNT,
|
||||
+ NULL, &kvp_srv_version);
|
||||
} else {
|
||||
kvp_msg = (struct hv_kvp_msg *)&recv_buffer[
|
||||
sizeof(struct vmbuspipe_hdr) +
|
||||
diff --git a/drivers/hv/hv_snapshot.c b/drivers/hv/hv_snapshot.c
|
||||
index 4e543dbb731a..d14f10b924a0 100644
|
||||
--- a/drivers/hv/hv_snapshot.c
|
||||
+++ b/drivers/hv/hv_snapshot.c
|
||||
@@ -31,6 +31,16 @@
|
||||
#define VSS_MINOR 0
|
||||
#define VSS_VERSION (VSS_MAJOR << 16 | VSS_MINOR)
|
||||
|
||||
+#define VSS_VER_COUNT 1
|
||||
+static const int vss_versions[] = {
|
||||
+ VSS_VERSION
|
||||
+};
|
||||
+
|
||||
+#define FW_VER_COUNT 1
|
||||
+static const int fw_versions[] = {
|
||||
+ UTIL_FW_VERSION
|
||||
+};
|
||||
+
|
||||
/*
|
||||
* Timeout values are based on expecations from host
|
||||
*/
|
||||
@@ -297,7 +307,6 @@ void hv_vss_onchannelcallback(void *context)
|
||||
|
||||
|
||||
struct icmsg_hdr *icmsghdrp;
|
||||
- struct icmsg_negotiate *negop = NULL;
|
||||
|
||||
if (vss_transaction.state > HVUTIL_READY)
|
||||
return;
|
||||
@@ -310,9 +319,10 @@ void hv_vss_onchannelcallback(void *context)
|
||||
sizeof(struct vmbuspipe_hdr)];
|
||||
|
||||
if (icmsghdrp->icmsgtype == ICMSGTYPE_NEGOTIATE) {
|
||||
- vmbus_prep_negotiate_resp(icmsghdrp, negop,
|
||||
- recv_buffer, UTIL_FW_VERSION,
|
||||
- VSS_VERSION);
|
||||
+ vmbus_prep_negotiate_resp(icmsghdrp,
|
||||
+ recv_buffer, fw_versions, FW_VER_COUNT,
|
||||
+ vss_versions, VSS_VER_COUNT,
|
||||
+ NULL, NULL);
|
||||
} else {
|
||||
vss_msg = (struct hv_vss_msg *)&recv_buffer[
|
||||
sizeof(struct vmbuspipe_hdr) +
|
||||
diff --git a/drivers/hv/hv_util.c b/drivers/hv/hv_util.c
|
||||
index e7707747f56d..f3797c07be10 100644
|
||||
--- a/drivers/hv/hv_util.c
|
||||
+++ b/drivers/hv/hv_util.c
|
||||
@@ -57,7 +57,31 @@
|
||||
static int sd_srv_version;
|
||||
static int ts_srv_version;
|
||||
static int hb_srv_version;
|
||||
-static int util_fw_version;
|
||||
+
|
||||
+#define SD_VER_COUNT 2
|
||||
+static const int sd_versions[] = {
|
||||
+ SD_VERSION,
|
||||
+ SD_VERSION_1
|
||||
+};
|
||||
+
|
||||
+#define TS_VER_COUNT 3
|
||||
+static const int ts_versions[] = {
|
||||
+ TS_VERSION,
|
||||
+ TS_VERSION_3,
|
||||
+ TS_VERSION_1
|
||||
+};
|
||||
+
|
||||
+#define HB_VER_COUNT 2
|
||||
+static const int hb_versions[] = {
|
||||
+ HB_VERSION,
|
||||
+ HB_VERSION_1
|
||||
+};
|
||||
+
|
||||
+#define FW_VER_COUNT 2
|
||||
+static const int fw_versions[] = {
|
||||
+ UTIL_FW_VERSION,
|
||||
+ UTIL_WS2K8_FW_VERSION
|
||||
+};
|
||||
|
||||
static void shutdown_onchannelcallback(void *context);
|
||||
static struct hv_util_service util_shutdown = {
|
||||
@@ -118,7 +142,6 @@ static void shutdown_onchannelcallback(void *context)
|
||||
struct shutdown_msg_data *shutdown_msg;
|
||||
|
||||
struct icmsg_hdr *icmsghdrp;
|
||||
- struct icmsg_negotiate *negop = NULL;
|
||||
|
||||
vmbus_recvpacket(channel, shut_txf_buf,
|
||||
PAGE_SIZE, &recvlen, &requestid);
|
||||
@@ -128,9 +151,14 @@ static void shutdown_onchannelcallback(void *context)
|
||||
sizeof(struct vmbuspipe_hdr)];
|
||||
|
||||
if (icmsghdrp->icmsgtype == ICMSGTYPE_NEGOTIATE) {
|
||||
- vmbus_prep_negotiate_resp(icmsghdrp, negop,
|
||||
- shut_txf_buf, util_fw_version,
|
||||
- sd_srv_version);
|
||||
+ if (vmbus_prep_negotiate_resp(icmsghdrp, shut_txf_buf,
|
||||
+ fw_versions, FW_VER_COUNT,
|
||||
+ sd_versions, SD_VER_COUNT,
|
||||
+ NULL, &sd_srv_version)) {
|
||||
+ pr_info("Shutdown IC version %d.%d\n",
|
||||
+ sd_srv_version >> 16,
|
||||
+ sd_srv_version & 0xFFFF);
|
||||
+ }
|
||||
} else {
|
||||
shutdown_msg =
|
||||
(struct shutdown_msg_data *)&shut_txf_buf[
|
||||
@@ -253,7 +281,6 @@ static void timesync_onchannelcallback(void *context)
|
||||
struct ictimesync_data *timedatap;
|
||||
struct ictimesync_ref_data *refdata;
|
||||
u8 *time_txf_buf = util_timesynch.recv_buffer;
|
||||
- struct icmsg_negotiate *negop = NULL;
|
||||
|
||||
vmbus_recvpacket(channel, time_txf_buf,
|
||||
PAGE_SIZE, &recvlen, &requestid);
|
||||
@@ -263,12 +290,14 @@ static void timesync_onchannelcallback(void *context)
|
||||
sizeof(struct vmbuspipe_hdr)];
|
||||
|
||||
if (icmsghdrp->icmsgtype == ICMSGTYPE_NEGOTIATE) {
|
||||
- vmbus_prep_negotiate_resp(icmsghdrp, negop,
|
||||
- time_txf_buf,
|
||||
- util_fw_version,
|
||||
- ts_srv_version);
|
||||
- pr_info("Using TimeSync version %d.%d\n",
|
||||
- ts_srv_version >> 16, ts_srv_version & 0xFFFF);
|
||||
+ if (vmbus_prep_negotiate_resp(icmsghdrp, time_txf_buf,
|
||||
+ fw_versions, FW_VER_COUNT,
|
||||
+ ts_versions, TS_VER_COUNT,
|
||||
+ NULL, &ts_srv_version)) {
|
||||
+ pr_info("TimeSync version %d.%d\n",
|
||||
+ ts_srv_version >> 16,
|
||||
+ ts_srv_version & 0xFFFF);
|
||||
+ }
|
||||
} else {
|
||||
if (ts_srv_version > TS_VERSION_3) {
|
||||
refdata = (struct ictimesync_ref_data *)
|
||||
@@ -312,7 +341,6 @@ static void heartbeat_onchannelcallback(void *context)
|
||||
struct icmsg_hdr *icmsghdrp;
|
||||
struct heartbeat_msg_data *heartbeat_msg;
|
||||
u8 *hbeat_txf_buf = util_heartbeat.recv_buffer;
|
||||
- struct icmsg_negotiate *negop = NULL;
|
||||
|
||||
while (1) {
|
||||
|
||||
@@ -326,9 +354,16 @@ static void heartbeat_onchannelcallback(void *context)
|
||||
sizeof(struct vmbuspipe_hdr)];
|
||||
|
||||
if (icmsghdrp->icmsgtype == ICMSGTYPE_NEGOTIATE) {
|
||||
- vmbus_prep_negotiate_resp(icmsghdrp, negop,
|
||||
- hbeat_txf_buf, util_fw_version,
|
||||
- hb_srv_version);
|
||||
+ if (vmbus_prep_negotiate_resp(icmsghdrp,
|
||||
+ hbeat_txf_buf,
|
||||
+ fw_versions, FW_VER_COUNT,
|
||||
+ hb_versions, HB_VER_COUNT,
|
||||
+ NULL, &hb_srv_version)) {
|
||||
+
|
||||
+ pr_info("Heartbeat version %d.%d\n",
|
||||
+ hb_srv_version >> 16,
|
||||
+ hb_srv_version & 0xFFFF);
|
||||
+ }
|
||||
} else {
|
||||
heartbeat_msg =
|
||||
(struct heartbeat_msg_data *)&hbeat_txf_buf[
|
||||
@@ -378,33 +413,6 @@ static int util_probe(struct hv_device *dev,
|
||||
|
||||
hv_set_drvdata(dev, srv);
|
||||
|
||||
- /*
|
||||
- * Based on the host; initialize the framework and
|
||||
- * service version numbers we will negotiate.
|
||||
- */
|
||||
- switch (vmbus_proto_version) {
|
||||
- case (VERSION_WS2008):
|
||||
- util_fw_version = UTIL_WS2K8_FW_VERSION;
|
||||
- sd_srv_version = SD_VERSION_1;
|
||||
- ts_srv_version = TS_VERSION_1;
|
||||
- hb_srv_version = HB_VERSION_1;
|
||||
- break;
|
||||
- case VERSION_WIN7:
|
||||
- case VERSION_WIN8:
|
||||
- case VERSION_WIN8_1:
|
||||
- util_fw_version = UTIL_FW_VERSION;
|
||||
- sd_srv_version = SD_VERSION;
|
||||
- ts_srv_version = TS_VERSION_3;
|
||||
- hb_srv_version = HB_VERSION;
|
||||
- break;
|
||||
- case VERSION_WIN10:
|
||||
- default:
|
||||
- util_fw_version = UTIL_FW_VERSION;
|
||||
- sd_srv_version = SD_VERSION;
|
||||
- ts_srv_version = TS_VERSION;
|
||||
- hb_srv_version = HB_VERSION;
|
||||
- }
|
||||
-
|
||||
ret = vmbus_open(dev->channel, 4 * PAGE_SIZE, 4 * PAGE_SIZE, NULL, 0,
|
||||
srv->util_cb, dev->channel);
|
||||
if (ret)
|
||||
diff --git a/include/linux/hyperv.h b/include/linux/hyperv.h
|
||||
index ca26335de49a..41e5ed87f833 100644
|
||||
--- a/include/linux/hyperv.h
|
||||
+++ b/include/linux/hyperv.h
|
||||
@@ -1459,9 +1459,10 @@ struct hyperv_service_callback {
|
||||
};
|
||||
|
||||
#define MAX_SRV_VER 0x7ffffff
|
||||
-extern bool vmbus_prep_negotiate_resp(struct icmsg_hdr *,
|
||||
- struct icmsg_negotiate *, u8 *, int,
|
||||
- int);
|
||||
+extern bool vmbus_prep_negotiate_resp(struct icmsg_hdr *icmsghdrp, u8 *buf,
|
||||
+ const int *fw_version, int fw_vercnt,
|
||||
+ const int *srv_version, int srv_vercnt,
|
||||
+ int *nego_fw_version, int *nego_srv_version);
|
||||
|
||||
void hv_event_tasklet_disable(struct vmbus_channel *channel);
|
||||
void hv_event_tasklet_enable(struct vmbus_channel *channel);
|
||||
--
|
||||
2.11.0
|
||||
|
@ -0,0 +1,117 @@
|
||||
From 632449112ef8796bbc874a19648ca537bfec11e9 Mon Sep 17 00:00:00 2001
|
||||
From: Alex Ng <alexng@messages.microsoft.com>
|
||||
Date: Sat, 28 Jan 2017 12:37:18 -0700
|
||||
Subject: [PATCH 3/3] Drivers: hv: Log the negotiated IC versions.
|
||||
|
||||
Log the negotiated IC versions.
|
||||
|
||||
Signed-off-by: Alex Ng <alexng@messages.microsoft.com>
|
||||
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
|
||||
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
||||
(cherry picked from commit 1274a690f6b2bd2b37447c47e3062afa8aa43f93)
|
||||
---
|
||||
drivers/hv/hv_fcopy.c | 9 +++++++--
|
||||
drivers/hv/hv_kvp.c | 8 ++++++--
|
||||
drivers/hv/hv_snapshot.c | 11 ++++++++---
|
||||
drivers/hv/hv_util.c | 4 ++--
|
||||
4 files changed, 23 insertions(+), 9 deletions(-)
|
||||
|
||||
diff --git a/drivers/hv/hv_fcopy.c b/drivers/hv/hv_fcopy.c
|
||||
index 0a315e6aa589..9aee6014339d 100644
|
||||
--- a/drivers/hv/hv_fcopy.c
|
||||
+++ b/drivers/hv/hv_fcopy.c
|
||||
@@ -251,10 +251,15 @@ void hv_fcopy_onchannelcallback(void *context)
|
||||
icmsghdr = (struct icmsg_hdr *)&recv_buffer[
|
||||
sizeof(struct vmbuspipe_hdr)];
|
||||
if (icmsghdr->icmsgtype == ICMSGTYPE_NEGOTIATE) {
|
||||
- vmbus_prep_negotiate_resp(icmsghdr, recv_buffer,
|
||||
+ if (vmbus_prep_negotiate_resp(icmsghdr, recv_buffer,
|
||||
fw_versions, FW_VER_COUNT,
|
||||
fcopy_versions, FCOPY_VER_COUNT,
|
||||
- NULL, &fcopy_srv_version);
|
||||
+ NULL, &fcopy_srv_version)) {
|
||||
+
|
||||
+ pr_info("FCopy IC version %d.%d\n",
|
||||
+ fcopy_srv_version >> 16,
|
||||
+ fcopy_srv_version & 0xFFFF);
|
||||
+ }
|
||||
} else {
|
||||
fcopy_msg = (struct hv_fcopy_hdr *)&recv_buffer[
|
||||
sizeof(struct vmbuspipe_hdr) +
|
||||
diff --git a/drivers/hv/hv_kvp.c b/drivers/hv/hv_kvp.c
|
||||
index 2cc670442f6c..de263712e247 100644
|
||||
--- a/drivers/hv/hv_kvp.c
|
||||
+++ b/drivers/hv/hv_kvp.c
|
||||
@@ -651,10 +651,14 @@ void hv_kvp_onchannelcallback(void *context)
|
||||
sizeof(struct vmbuspipe_hdr)];
|
||||
|
||||
if (icmsghdrp->icmsgtype == ICMSGTYPE_NEGOTIATE) {
|
||||
- vmbus_prep_negotiate_resp(icmsghdrp,
|
||||
+ if (vmbus_prep_negotiate_resp(icmsghdrp,
|
||||
recv_buffer, fw_versions, FW_VER_COUNT,
|
||||
kvp_versions, KVP_VER_COUNT,
|
||||
- NULL, &kvp_srv_version);
|
||||
+ NULL, &kvp_srv_version)) {
|
||||
+ pr_info("KVP IC version %d.%d\n",
|
||||
+ kvp_srv_version >> 16,
|
||||
+ kvp_srv_version & 0xFFFF);
|
||||
+ }
|
||||
} else {
|
||||
kvp_msg = (struct hv_kvp_msg *)&recv_buffer[
|
||||
sizeof(struct vmbuspipe_hdr) +
|
||||
diff --git a/drivers/hv/hv_snapshot.c b/drivers/hv/hv_snapshot.c
|
||||
index d14f10b924a0..bcc03f0748d6 100644
|
||||
--- a/drivers/hv/hv_snapshot.c
|
||||
+++ b/drivers/hv/hv_snapshot.c
|
||||
@@ -304,7 +304,7 @@ void hv_vss_onchannelcallback(void *context)
|
||||
u32 recvlen;
|
||||
u64 requestid;
|
||||
struct hv_vss_msg *vss_msg;
|
||||
-
|
||||
+ int vss_srv_version;
|
||||
|
||||
struct icmsg_hdr *icmsghdrp;
|
||||
|
||||
@@ -319,10 +319,15 @@ void hv_vss_onchannelcallback(void *context)
|
||||
sizeof(struct vmbuspipe_hdr)];
|
||||
|
||||
if (icmsghdrp->icmsgtype == ICMSGTYPE_NEGOTIATE) {
|
||||
- vmbus_prep_negotiate_resp(icmsghdrp,
|
||||
+ if (vmbus_prep_negotiate_resp(icmsghdrp,
|
||||
recv_buffer, fw_versions, FW_VER_COUNT,
|
||||
vss_versions, VSS_VER_COUNT,
|
||||
- NULL, NULL);
|
||||
+ NULL, &vss_srv_version)) {
|
||||
+
|
||||
+ pr_info("VSS IC version %d.%d\n",
|
||||
+ vss_srv_version >> 16,
|
||||
+ vss_srv_version & 0xFFFF);
|
||||
+ }
|
||||
} else {
|
||||
vss_msg = (struct hv_vss_msg *)&recv_buffer[
|
||||
sizeof(struct vmbuspipe_hdr) +
|
||||
diff --git a/drivers/hv/hv_util.c b/drivers/hv/hv_util.c
|
||||
index f3797c07be10..89440c2eb346 100644
|
||||
--- a/drivers/hv/hv_util.c
|
||||
+++ b/drivers/hv/hv_util.c
|
||||
@@ -294,7 +294,7 @@ static void timesync_onchannelcallback(void *context)
|
||||
fw_versions, FW_VER_COUNT,
|
||||
ts_versions, TS_VER_COUNT,
|
||||
NULL, &ts_srv_version)) {
|
||||
- pr_info("TimeSync version %d.%d\n",
|
||||
+ pr_info("TimeSync IC version %d.%d\n",
|
||||
ts_srv_version >> 16,
|
||||
ts_srv_version & 0xFFFF);
|
||||
}
|
||||
@@ -360,7 +360,7 @@ static void heartbeat_onchannelcallback(void *context)
|
||||
hb_versions, HB_VER_COUNT,
|
||||
NULL, &hb_srv_version)) {
|
||||
|
||||
- pr_info("Heartbeat version %d.%d\n",
|
||||
+ pr_info("Heartbeat IC version %d.%d\n",
|
||||
hb_srv_version >> 16,
|
||||
hb_srv_version & 0xFFFF);
|
||||
}
|
||||
--
|
||||
2.11.0
|
||||
|
Loading…
Reference in New Issue
Block a user