Merge pull request #2536 from rn/lcow-kern

Update kernel and LCOW
This commit is contained in:
Rolf Neugebauer 2017-09-25 15:27:15 +01:00 committed by GitHub
commit 5c37a154da
6 changed files with 97 additions and 56 deletions

View File

@ -1,10 +1,14 @@
kernel:
image: linuxkit/kernel:4.12.14
# XXX Use the content hash as there are several 4.12.14 images on hub
image: linuxkit/kernel:4.12.14-c4d19a4de21def5a5134a6f70ef7212c31104bf1
cmdline: "console=ttyS0"
tar: none
init:
- linuxkit/init-lcow:b5d156bfc1318a1c7b94320c87d634e5fd0da091
- linuxkit/init-lcow:877bfca958c836f7e0ba9a6157088905611a08f9
- linuxkit/runc:a1b564248a0d0b118c11e61db9f84ecf41dd2d2a
files:
- path: etc/linuxkit.yml
metadata: yaml
trust:
org:
- linuxkit

View File

@ -1,49 +0,0 @@
From 9c999c9259ee29bbd2ed49c81465ea460ff4ea3a Mon Sep 17 00:00:00 2001
From: Dexuan Cui <decui@microsoft.com>
Date: Tue, 29 Aug 2017 14:23:39 -0700
Subject: [PATCH 16/18] vmbus: destroy a hv_sock device only after the
RESCIND_OFFER is received
It looks the host/guest interactive protocol for hv_sock has been changed
since Windows Server TP5, and now Linux VM should only destroy the channel
after the host agrees: the host always sends a RESCIND_OFFER message to the
VM for this).
Without the patch, the host's recv() can return -1 when Linux closes a
hv_sock connection, and as a result, the host app can potentially lose the
last portion of the data transferred through the hv_sock connection.
Signed-off-by: Dexuan Cui <decui@microsoft.com>
Origin: git@github.com:dcui/linux.git
(cherry picked from commit d6f7158fdbac10f9935a506451e3d54d2d50a7c7)
---
drivers/hv/channel_mgmt.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c
index a12b1eabc15e..83d4292e4351 100644
--- a/drivers/hv/channel_mgmt.c
+++ b/drivers/hv/channel_mgmt.c
@@ -905,6 +905,9 @@ static void vmbus_onoffer_rescind(struct vmbus_channel_message_header *hdr)
if (channel->device_obj) {
if (channel->chn_rescind_callback) {
channel->chn_rescind_callback(channel);
+
+ vmbus_device_unregister(channel->device_obj);
+
return;
}
/*
@@ -955,9 +958,6 @@ void vmbus_hvsock_device_unregister(struct vmbus_channel *channel)
vmbus_connection.work_queue_rescind, &work);
flush_work(&work);
- channel->rescind = true;
- vmbus_device_unregister(channel->device_obj);
-
/* Unblock the rescind handling */
atomic_dec(&vmbus_connection.offer_in_progress);
}
--
2.14.1

View File

@ -0,0 +1,86 @@
From 5dc143f0f2a3cc5f4d9f2d3a9b89e190dcdb7230 Mon Sep 17 00:00:00 2001
From: Dexuan Cui <decui@microsoft.com>
Date: Tue, 19 Sep 2017 20:05:31 -0700
Subject: [PATCH 16/18] vmbus: hvsock: add proper sync for
vmbus_hvsock_device_unregister()
Without the patch, vmbus_hvsock_device_unregister() can destroy the device
prematurely.
Signed-off-by: Dexuan Cui <decui@microsoft.com>
Origin: git@github.com:dcui/linux.git
(cherry picked from commit b6ffb4393fb266711b37ed056487665d8650f31a)
---
drivers/hv/channel_mgmt.c | 20 ++++++--------------
include/linux/hyperv.h | 2 ++
2 files changed, 8 insertions(+), 14 deletions(-)
diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c
index a12b1eabc15e..1c20d6afae59 100644
--- a/drivers/hv/channel_mgmt.c
+++ b/drivers/hv/channel_mgmt.c
@@ -559,6 +559,8 @@ static void vmbus_process_offer(struct vmbus_channel *newchannel)
newchannel->device_obj = device_obj;
atomic_dec(&vmbus_connection.register_in_progress);
+ newchannel->probe_done = true;
+
return;
err_deq_chan:
@@ -905,6 +907,8 @@ static void vmbus_onoffer_rescind(struct vmbus_channel_message_header *hdr)
if (channel->device_obj) {
if (channel->chn_rescind_callback) {
channel->chn_rescind_callback(channel);
+ channel->rescind_done = true;
+
return;
}
/*
@@ -938,28 +942,16 @@ static void vmbus_onoffer_rescind(struct vmbus_channel_message_header *hdr)
}
}
-static void vmbus_stop_rescind_handling_work(struct work_struct *work)
-{
- atomic_inc(&vmbus_connection.offer_in_progress);
-}
-
void vmbus_hvsock_device_unregister(struct vmbus_channel *channel)
{
struct work_struct work;
BUG_ON(!is_hvsock_channel(channel));
- /* Prevent chn_rescind_callback from running in the rescind path */
- INIT_WORK(&work, vmbus_stop_rescind_handling_work);
- queue_work_on(vmbus_connection.connect_cpu,
- vmbus_connection.work_queue_rescind, &work);
- flush_work(&work);
+ while (!READ_ONCE(channel->probe_done) || !READ_ONCE(channel->rescind_done))
+ msleep(1);
- channel->rescind = true;
vmbus_device_unregister(channel->device_obj);
-
- /* Unblock the rescind handling */
- atomic_dec(&vmbus_connection.offer_in_progress);
}
EXPORT_SYMBOL_GPL(vmbus_hvsock_device_unregister);
diff --git a/include/linux/hyperv.h b/include/linux/hyperv.h
index 511d47e3ee9d..5676f2a16531 100644
--- a/include/linux/hyperv.h
+++ b/include/linux/hyperv.h
@@ -896,6 +896,8 @@ struct vmbus_channel {
*/
enum hv_numa_policy affinity_policy;
+ bool probe_done;
+ bool rescind_done;
};
static inline bool is_hvsock_channel(const struct vmbus_channel *c)
--
2.14.1

View File

@ -1,4 +1,4 @@
From 40e4b5cacba06f888591fe81faac1dd4b3b4413c Mon Sep 17 00:00:00 2001
From 33f5b46c4e0e21b17a41dcfd181c95d9997b4436 Mon Sep 17 00:00:00 2001
From: Randy Dodgen <dodgen@google.com>
Date: Thu, 24 Aug 2017 15:26:01 -0400
Subject: [PATCH 17/18] ext4: fix fault handling when mounted with -o dax,ro

View File

@ -1,4 +1,4 @@
From e4e680592a9006069ae93b8d11b281d652152995 Mon Sep 17 00:00:00 2001
From 00c4be87968d1009795872f1fed2f854deabbeff Mon Sep 17 00:00:00 2001
From: Cheng-mean Liu <soccerl@microsoft.com>
Date: Tue, 11 Jul 2017 16:58:26 -0700
Subject: [PATCH 18/18] NVDIMM: reducded ND_MIN_NAMESPACE_SIZE from 4MB to 4KB

View File

@ -1,4 +1,4 @@
FROM linuxkit/alpine:349a817bdd6b293ca623ab97acf5377ccdeac7d2 AS mirror
FROM linuxkit/alpine:77287352db68b442534c0005edd6ff750c8189f3 AS mirror
RUN mkdir -p /out/etc/apk && cp -r /etc/apk/* /out/etc/apk/
RUN apk add --no-cache --initdb -p /out \
alpine-baselayout \
@ -7,9 +7,9 @@ RUN apk add --no-cache --initdb -p /out \
musl
RUN rm -rf /out/etc/apk /out/lib/apk /out/var/cache
FROM linuxkit/alpine:349a817bdd6b293ca623ab97acf5377ccdeac7d2 AS build
FROM linuxkit/alpine:77287352db68b442534c0005edd6ff750c8189f3 AS build
ENV OPENGCS_REPO=https://github.com/Microsoft/opengcs
ENV OPENGCS_COMMIT=de29646b8dfadfc443e1467bd4b493e9068fb582
ENV OPENGCS_COMMIT=48ae4e3ba3d2fea746fb4dc20a72832a46f45466
RUN apk add --no-cache build-base curl git go musl-dev
ENV GOPATH=/go PATH=$PATH:/go/bin
RUN git clone $OPENGCS_REPO /go/src/github.com/Microsoft/opengcs && \