diff --git a/kernel/patches-4.11.x/0001-tools-build-Add-test-for-sched_getcpu.patch b/kernel/patches-4.11.x/0001-tools-build-Add-test-for-sched_getcpu.patch new file mode 100644 index 000000000..9103c601a --- /dev/null +++ b/kernel/patches-4.11.x/0001-tools-build-Add-test-for-sched_getcpu.patch @@ -0,0 +1,149 @@ +From 500dc604f95708446c0a074d84716dfa5d3c55d8 Mon Sep 17 00:00:00 2001 +From: Arnaldo Carvalho de Melo +Date: Thu, 2 Mar 2017 12:55:49 -0300 +Subject: [PATCH 01/14] tools build: Add test for sched_getcpu() + +Instead of trying to go on adding more ifdef conditions, do a feature +test and define HAVE_SCHED_GETCPU_SUPPORT instead, then use it to +provide the prototype. No need to change the stub, as it is already a +__weak symbol. + +Cc: Adrian Hunter +Cc: David Ahern +Cc: Jiri Olsa +Cc: Namhyung Kim +Cc: Wang Nan +Link: http://lkml.kernel.org/n/tip-yge89er9g90sc0v6k0a0r5tr@git.kernel.org +Signed-off-by: Arnaldo Carvalho de Melo +(cherry picked from commit 120010cb1eea151d38a3e66f5ffc79a0c3110292) +--- + tools/build/Makefile.feature | 1 + + tools/build/feature/Makefile | 6 +++++- + tools/build/feature/test-all.c | 5 +++++ + tools/build/feature/test-sched_getcpu.c | 7 +++++++ + tools/perf/Makefile.config | 4 ++++ + tools/perf/util/cloexec.h | 6 ------ + tools/perf/util/util.h | 4 ++-- + 7 files changed, 24 insertions(+), 9 deletions(-) + create mode 100644 tools/build/feature/test-sched_getcpu.c + +diff --git a/tools/build/Makefile.feature b/tools/build/Makefile.feature +index e3fb5ecbdcb6..523911f316ce 100644 +--- a/tools/build/Makefile.feature ++++ b/tools/build/Makefile.feature +@@ -63,6 +63,7 @@ FEATURE_TESTS_BASIC := \ + lzma \ + get_cpuid \ + bpf \ ++ sched_getcpu \ + sdt + + # FEATURE_TESTS_BASIC + FEATURE_TESTS_EXTRA is the complete list +diff --git a/tools/build/feature/Makefile b/tools/build/feature/Makefile +index b564a2eea039..ab1e2bbc2e96 100644 +--- a/tools/build/feature/Makefile ++++ b/tools/build/feature/Makefile +@@ -48,7 +48,8 @@ FILES= \ + test-get_cpuid.bin \ + test-sdt.bin \ + test-cxx.bin \ +- test-jvmti.bin ++ test-jvmti.bin \ ++ test-sched_getcpu.bin + + FILES := $(addprefix $(OUTPUT),$(FILES)) + +@@ -91,6 +92,9 @@ $(OUTPUT)test-libelf.bin: + $(OUTPUT)test-glibc.bin: + $(BUILD) + ++$(OUTPUT)test-sched_getcpu.bin: ++ $(BUILD) ++ + DWARFLIBS := -ldw + ifeq ($(findstring -static,${LDFLAGS}),-static) + DWARFLIBS += -lelf -lebl -lz -llzma -lbz2 +diff --git a/tools/build/feature/test-all.c b/tools/build/feature/test-all.c +index 699e43627397..cc6c7c01f4ca 100644 +--- a/tools/build/feature/test-all.c ++++ b/tools/build/feature/test-all.c +@@ -117,6 +117,10 @@ + # include "test-pthread-attr-setaffinity-np.c" + #undef main + ++#define main main_test_sched_getcpu ++# include "test-sched_getcpu.c" ++#undef main ++ + # if 0 + /* + * Disable libbabeltrace check for test-all, because the requested +@@ -182,6 +186,7 @@ int main(int argc, char *argv[]) + main_test_get_cpuid(); + main_test_bpf(); + main_test_libcrypto(); ++ main_test_sched_getcpu(); + main_test_sdt(); + + return 0; +diff --git a/tools/build/feature/test-sched_getcpu.c b/tools/build/feature/test-sched_getcpu.c +new file mode 100644 +index 000000000000..c4a148dd7104 +--- /dev/null ++++ b/tools/build/feature/test-sched_getcpu.c +@@ -0,0 +1,7 @@ ++#define _GNU_SOURCE ++#include ++ ++int main(void) ++{ ++ return sched_getcpu(); ++} +diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config +index 27c9fbca7bd9..2b656de99495 100644 +--- a/tools/perf/Makefile.config ++++ b/tools/perf/Makefile.config +@@ -317,6 +317,10 @@ ifdef NO_DWARF + NO_LIBDW_DWARF_UNWIND := 1 + endif + ++ifeq ($(feature-sched_getcpu), 1) ++ CFLAGS += -DHAVE_SCHED_GETCPU_SUPPORT ++endif ++ + ifndef NO_LIBELF + CFLAGS += -DHAVE_LIBELF_SUPPORT + EXTLIBS += -lelf +diff --git a/tools/perf/util/cloexec.h b/tools/perf/util/cloexec.h +index d0d465953d36..94a5a7d829d5 100644 +--- a/tools/perf/util/cloexec.h ++++ b/tools/perf/util/cloexec.h +@@ -3,10 +3,4 @@ + + unsigned long perf_event_open_cloexec_flag(void); + +-#ifdef __GLIBC_PREREQ +-#if !__GLIBC_PREREQ(2, 6) && !defined(__UCLIBC__) +-int sched_getcpu(void) __THROW; +-#endif +-#endif +- + #endif /* __PERF_CLOEXEC_H */ +diff --git a/tools/perf/util/util.h b/tools/perf/util/util.h +index c74708da8571..b2cfa47990dc 100644 +--- a/tools/perf/util/util.h ++++ b/tools/perf/util/util.h +@@ -355,8 +355,8 @@ void print_binary(unsigned char *data, size_t len, + size_t bytes_per_line, print_binary_t printer, + void *extra); + +-#if !defined(__GLIBC__) && !defined(__ANDROID__) +-extern int sched_getcpu(void); ++#ifndef HAVE_SCHED_GETCPU_SUPPORT ++int sched_getcpu(void); + #endif + + int is_printable_array(char *p, unsigned int len); +-- +2.13.0 + diff --git a/kernel/patches-4.11.x/0001-vmbus-introduce-in-place-packet-iterator.patch b/kernel/patches-4.11.x/0002-vmbus-introduce-in-place-packet-iterator.patch similarity index 98% rename from kernel/patches-4.11.x/0001-vmbus-introduce-in-place-packet-iterator.patch rename to kernel/patches-4.11.x/0002-vmbus-introduce-in-place-packet-iterator.patch index f0055476c..ce93fcd18 100644 --- a/kernel/patches-4.11.x/0001-vmbus-introduce-in-place-packet-iterator.patch +++ b/kernel/patches-4.11.x/0002-vmbus-introduce-in-place-packet-iterator.patch @@ -1,7 +1,7 @@ -From f1d0fa353d3a960377c30c02583cae0ab4d2a065 Mon Sep 17 00:00:00 2001 +From 7fc081c8a985556a4bef220fc6fd8fd20639f226 Mon Sep 17 00:00:00 2001 From: stephen hemminger Date: Mon, 27 Feb 2017 10:26:48 -0800 -Subject: [PATCH 1/9] vmbus: introduce in-place packet iterator +Subject: [PATCH 02/14] vmbus: introduce in-place packet iterator This is mostly just a refactoring of previous functions (get_pkt_next_raw, put_pkt_raw and commit_rd_index) to make it easier @@ -365,5 +365,5 @@ index 970771a5f739..0c170a3f0d8b 100644 #endif /* _HYPERV_H */ -- -2.11.1 +2.13.0 diff --git a/kernel/patches-4.11.x/0002-vmbus-vmbus_open-reset-onchannel_callback-on-error.patch b/kernel/patches-4.11.x/0003-vmbus-vmbus_open-reset-onchannel_callback-on-error.patch similarity index 86% rename from kernel/patches-4.11.x/0002-vmbus-vmbus_open-reset-onchannel_callback-on-error.patch rename to kernel/patches-4.11.x/0003-vmbus-vmbus_open-reset-onchannel_callback-on-error.patch index dee51b6f6..064228f04 100644 --- a/kernel/patches-4.11.x/0002-vmbus-vmbus_open-reset-onchannel_callback-on-error.patch +++ b/kernel/patches-4.11.x/0003-vmbus-vmbus_open-reset-onchannel_callback-on-error.patch @@ -1,7 +1,7 @@ -From 9559fa150a71ecea0cd2583e46c66accf90e0616 Mon Sep 17 00:00:00 2001 +From 1d63d56461390883f4818f701c374a54379d7d21 Mon Sep 17 00:00:00 2001 From: Dexuan Cui Date: Fri, 5 May 2017 16:57:12 -0600 -Subject: [PATCH 2/9] vmbus: vmbus_open(): reset onchannel_callback on error +Subject: [PATCH 03/14] vmbus: vmbus_open(): reset onchannel_callback on error No real issue is observed without the patch, but let's add this just in case. @@ -10,7 +10,7 @@ Signed-off-by: Dexuan Cui Cc: K. Y. Srinivasan Cc: Haiyang Zhang Cc: Stephen Hemminger -Origin: https://github.com/dcui/linux/commits/decui/hv_sock/v4.11/20170511 +Origin: https://github.com/dcui/linux/commits/decui/hv_sock/v4.11/20170511-debug-0605 (cherry picked from commit c248b14174e1337c1461f9b13a573ad90a136e1c) --- drivers/hv/channel.c | 2 ++ @@ -30,5 +30,5 @@ index 321b8833fa6f..628d6fde1887 100644 } EXPORT_SYMBOL_GPL(vmbus_open); -- -2.11.1 +2.13.0 diff --git a/kernel/patches-4.11.x/0003-vmbus-add-the-matching-tasklet_enable-in-vmbus_close.patch b/kernel/patches-4.11.x/0004-vmbus-add-the-matching-tasklet_enable-in-vmbus_close.patch similarity index 89% rename from kernel/patches-4.11.x/0003-vmbus-add-the-matching-tasklet_enable-in-vmbus_close.patch rename to kernel/patches-4.11.x/0004-vmbus-add-the-matching-tasklet_enable-in-vmbus_close.patch index 60b86307c..d4fbb98ba 100644 --- a/kernel/patches-4.11.x/0003-vmbus-add-the-matching-tasklet_enable-in-vmbus_close.patch +++ b/kernel/patches-4.11.x/0004-vmbus-add-the-matching-tasklet_enable-in-vmbus_close.patch @@ -1,7 +1,7 @@ -From 3d3836f4b41e3932cbee6a8f8ac40536d6c4f320 Mon Sep 17 00:00:00 2001 +From f5f0b3c2685ff47d3e7a019801819a20dd04f971 Mon Sep 17 00:00:00 2001 From: Dexuan Cui Date: Fri, 5 May 2017 16:57:15 -0600 -Subject: [PATCH 3/9] vmbus: add the matching tasklet_enable() in +Subject: [PATCH 04/14] vmbus: add the matching tasklet_enable() in vmbus_close_internal() If we disable a tasklet that is scheduled but hasn't started to run, @@ -19,7 +19,7 @@ Signed-off-by: Dexuan Cui Cc: K. Y. Srinivasan Cc: Haiyang Zhang Cc: Stephen Hemminger -Origin: https://github.com/dcui/linux/commits/decui/hv_sock/v4.11/20170511 +Origin: https://github.com/dcui/linux/commits/decui/hv_sock/v4.11/20170511-debug-0605 (cherry picked from commit 008d8d8bc0c86473a8549a365bee9a479243e412) --- drivers/hv/channel.c | 1 + @@ -38,5 +38,5 @@ index 628d6fde1887..7cd2bd9fd1f1 100644 } -- -2.11.1 +2.13.0 diff --git a/kernel/patches-4.11.x/0004-vmbus-remove-goto-error_clean_msglist-in-vmbus_open.patch b/kernel/patches-4.11.x/0005-vmbus-remove-goto-error_clean_msglist-in-vmbus_open.patch similarity index 92% rename from kernel/patches-4.11.x/0004-vmbus-remove-goto-error_clean_msglist-in-vmbus_open.patch rename to kernel/patches-4.11.x/0005-vmbus-remove-goto-error_clean_msglist-in-vmbus_open.patch index bea52d423..93e06120a 100644 --- a/kernel/patches-4.11.x/0004-vmbus-remove-goto-error_clean_msglist-in-vmbus_open.patch +++ b/kernel/patches-4.11.x/0005-vmbus-remove-goto-error_clean_msglist-in-vmbus_open.patch @@ -1,7 +1,8 @@ -From 0dd911a6752477245598e32b63dc341b4efa7460 Mon Sep 17 00:00:00 2001 +From ecf3df3b127a9537d155f8542adba266c3c71aae Mon Sep 17 00:00:00 2001 From: Dexuan Cui Date: Fri, 5 May 2017 16:57:20 -0600 -Subject: [PATCH 4/9] vmbus: remove "goto error_clean_msglist" in vmbus_open() +Subject: [PATCH 05/14] vmbus: remove "goto error_clean_msglist" in + vmbus_open() This is just a cleanup patch to simplify the code a little. No semantic change. @@ -10,7 +11,7 @@ Signed-off-by: Dexuan Cui Cc: K. Y. Srinivasan Cc: Haiyang Zhang Cc: Stephen Hemminger -Origin: https://github.com/dcui/linux/commits/decui/hv_sock/v4.11/20170511 +Origin: https://github.com/dcui/linux/commits/decui/hv_sock/v4.11/20170511-debug-0605 (cherry picked from commit 4713066c11b2396eafd2873cbed7bdd72d1571eb) --- drivers/hv/channel.c | 18 +++++++----------- @@ -58,5 +59,5 @@ index 7cd2bd9fd1f1..db5e6f8730d2 100644 vmbus_teardown_gpadl(newchannel, newchannel->ringbuffer_gpadlhandle); kfree(open_info); -- -2.11.1 +2.13.0 diff --git a/kernel/patches-4.11.x/0005-vmbus-dynamically-enqueue-dequeue-a-channel-on-vmbus.patch b/kernel/patches-4.11.x/0006-vmbus-dynamically-enqueue-dequeue-a-channel-on-vmbus.patch similarity index 97% rename from kernel/patches-4.11.x/0005-vmbus-dynamically-enqueue-dequeue-a-channel-on-vmbus.patch rename to kernel/patches-4.11.x/0006-vmbus-dynamically-enqueue-dequeue-a-channel-on-vmbus.patch index 3a9773349..69ec89b03 100644 --- a/kernel/patches-4.11.x/0005-vmbus-dynamically-enqueue-dequeue-a-channel-on-vmbus.patch +++ b/kernel/patches-4.11.x/0006-vmbus-dynamically-enqueue-dequeue-a-channel-on-vmbus.patch @@ -1,7 +1,7 @@ -From 10daf5dad0b5b282c8070f3e828e03b2fa6622d4 Mon Sep 17 00:00:00 2001 +From 60a7f882c6ba48ee48c91d79d85eb14365444348 Mon Sep 17 00:00:00 2001 From: Dexuan Cui Date: Fri, 5 May 2017 16:57:23 -0600 -Subject: [PATCH 5/9] vmbus: dynamically enqueue/dequeue a channel on +Subject: [PATCH 06/14] vmbus: dynamically enqueue/dequeue a channel on vmbus_open/close MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -22,7 +22,7 @@ Tested-by: Rolf Neugebauer Cc: K. Y. Srinivasan Cc: Haiyang Zhang Cc: Stephen Hemminger -Origin: https://github.com/dcui/linux/commits/decui/hv_sock/v4.11/20170511 +Origin: https://github.com/dcui/linux/commits/decui/hv_sock/v4.11/20170511-debug-0605 (cherry picked from commit 1df677b35ff010d0def33f5420773015815cf843) --- drivers/hv/channel.c | 12 +++++++++--- @@ -185,5 +185,5 @@ index 0c170a3f0d8b..ba93b7e4a972 100644 void vmbus_setevent(struct vmbus_channel *channel); -- -2.11.1 +2.13.0 diff --git a/kernel/patches-4.11.x/0006-hv_sock-implements-Hyper-V-transport-for-Virtual-Soc.patch b/kernel/patches-4.11.x/0007-hv_sock-implements-Hyper-V-transport-for-Virtual-Soc.patch similarity index 99% rename from kernel/patches-4.11.x/0006-hv_sock-implements-Hyper-V-transport-for-Virtual-Soc.patch rename to kernel/patches-4.11.x/0007-hv_sock-implements-Hyper-V-transport-for-Virtual-Soc.patch index aee309fb4..b7a1cb25b 100644 --- a/kernel/patches-4.11.x/0006-hv_sock-implements-Hyper-V-transport-for-Virtual-Soc.patch +++ b/kernel/patches-4.11.x/0007-hv_sock-implements-Hyper-V-transport-for-Virtual-Soc.patch @@ -1,8 +1,8 @@ -From 8eb0473cb513e25b2379c5e700f6fb6df80d287d Mon Sep 17 00:00:00 2001 +From 00887e3d98575897e80881f462a2a4d56157135e Mon Sep 17 00:00:00 2001 From: Dexuan Cui Date: Fri, 5 May 2017 16:57:26 -0600 -Subject: [PATCH 6/9] hv_sock: implements Hyper-V transport for Virtual Sockets - (AF_VSOCK) +Subject: [PATCH 07/14] hv_sock: implements Hyper-V transport for Virtual + Sockets (AF_VSOCK) Hyper-V Sockets (hv_sock) supplies a byte-stream based communication mechanism between the host and the guest. It uses VMBus ringbuffer as the @@ -34,7 +34,7 @@ Cc: Stefan Hajnoczi Cc: Vitaly Kuznetsov Cc: Cathy Avery Cc: Rolf Neugebauer -Origin: https://github.com/dcui/linux/commits/decui/hv_sock/v4.11/20170511 +Origin: https://github.com/dcui/linux/commits/decui/hv_sock/v4.11/20170511-debug-0605 (cherry picked from commit 3476be340d2ff777609fca3e763da0292acbfc45) --- MAINTAINERS | 1 + @@ -930,5 +930,5 @@ index 000000000000..fd89bf357617 +MODULE_VERSION("1.0.0"); +MODULE_LICENSE("GPL"); -- -2.11.1 +2.13.0 diff --git a/kernel/patches-4.11.x/0007-VMCI-only-try-to-load-on-VMware-hypervisor.patch b/kernel/patches-4.11.x/0008-VMCI-only-try-to-load-on-VMware-hypervisor.patch similarity index 93% rename from kernel/patches-4.11.x/0007-VMCI-only-try-to-load-on-VMware-hypervisor.patch rename to kernel/patches-4.11.x/0008-VMCI-only-try-to-load-on-VMware-hypervisor.patch index decc7d75f..a732b78b3 100644 --- a/kernel/patches-4.11.x/0007-VMCI-only-try-to-load-on-VMware-hypervisor.patch +++ b/kernel/patches-4.11.x/0008-VMCI-only-try-to-load-on-VMware-hypervisor.patch @@ -1,7 +1,7 @@ -From 4a4ecfc0c7bd062dcba1e4dbc487e27ebcf0f8ba Mon Sep 17 00:00:00 2001 +From e4ad24e6481887b2419306ddea61298645f14e2f Mon Sep 17 00:00:00 2001 From: Dexuan Cui Date: Fri, 5 May 2017 16:57:29 -0600 -Subject: [PATCH 7/9] VMCI: only try to load on VMware hypervisor +Subject: [PATCH 08/14] VMCI: only try to load on VMware hypervisor Without the patch, vmw_vsock_vmci_transport.ko and vmw_vmci.ko can automatically load when an application creates an AF_VSOCK socket. @@ -27,7 +27,7 @@ Cc: Jorgen Hansen Cc: K. Y. Srinivasan Cc: Haiyang Zhang Cc: Stephen Hemminger -Origin: https://github.com/dcui/linux/commits/decui/hv_sock/v4.11/20170511 +Origin: https://github.com/dcui/linux/commits/decui/hv_sock/v4.11/20170511-debug-0605 (cherry picked from commit b5566b1b6e5cb19b381590587f841f950caabe4d) --- drivers/misc/vmw_vmci/vmci_driver.c | 8 ++++++++ @@ -60,5 +60,5 @@ index d7eaf1eb11e7..1789ea71ff5d 100644 if (vmci_err < VMCI_SUCCESS) { pr_err("Failed to initialize VMCIEvent (result=%d)\n", -- -2.11.1 +2.13.0 diff --git a/kernel/patches-4.11.x/0008-hv_sock-add-the-support-of-auto-loading.patch b/kernel/patches-4.11.x/0009-hv_sock-add-the-support-of-auto-loading.patch similarity index 85% rename from kernel/patches-4.11.x/0008-hv_sock-add-the-support-of-auto-loading.patch rename to kernel/patches-4.11.x/0009-hv_sock-add-the-support-of-auto-loading.patch index 698f83edb..4667dd65d 100644 --- a/kernel/patches-4.11.x/0008-hv_sock-add-the-support-of-auto-loading.patch +++ b/kernel/patches-4.11.x/0009-hv_sock-add-the-support-of-auto-loading.patch @@ -1,7 +1,7 @@ -From cf272990facec39bd5f42ef82a65f1a00c37ab73 Mon Sep 17 00:00:00 2001 +From 2782da00ad2d3f24b9ba4c5418ebd50dff0fa00c Mon Sep 17 00:00:00 2001 From: Dexuan Cui Date: Fri, 5 May 2017 16:57:35 -0600 -Subject: [PATCH 8/9] hv_sock: add the support of auto-loading +Subject: [PATCH 09/14] hv_sock: add the support of auto-loading After we disable VMWare virtual sockets driver's auto-loading on Hyper-V, we can enable hv_sock's auto-loading now. @@ -10,7 +10,7 @@ Signed-off-by: Dexuan Cui Cc: K. Y. Srinivasan Cc: Haiyang Zhang Cc: Stephen Hemminger -Origin: https://github.com/dcui/linux/commits/decui/hv_sock/v4.11/20170511 +Origin: https://github.com/dcui/linux/commits/decui/hv_sock/v4.11/20170511-debug-0605 (cherry picked from commit 6f1aa69011356ff95ed6c57400095e5f2d9eb900) --- net/vmw_vsock/hyperv_transport.c | 1 + @@ -26,5 +26,5 @@ index fd89bf357617..f465b0b662df 100644 MODULE_LICENSE("GPL"); +MODULE_ALIAS_NETPROTO(PF_VSOCK); -- -2.11.1 +2.13.0 diff --git a/kernel/patches-4.11.x/0009-hvsock-fix-a-race-in-hvs_stream_dequeue.patch b/kernel/patches-4.11.x/0010-hvsock-fix-a-race-in-hvs_stream_dequeue.patch similarity index 95% rename from kernel/patches-4.11.x/0009-hvsock-fix-a-race-in-hvs_stream_dequeue.patch rename to kernel/patches-4.11.x/0010-hvsock-fix-a-race-in-hvs_stream_dequeue.patch index 9a6c803a1..57dcc7cf4 100644 --- a/kernel/patches-4.11.x/0009-hvsock-fix-a-race-in-hvs_stream_dequeue.patch +++ b/kernel/patches-4.11.x/0010-hvsock-fix-a-race-in-hvs_stream_dequeue.patch @@ -1,7 +1,7 @@ -From b9bf375c542c1d2eec22f599dc1cc897ba0b3d66 Mon Sep 17 00:00:00 2001 +From a1fb69445672e790cb4c1b9c105af09eec69cd64 Mon Sep 17 00:00:00 2001 From: Dexuan Cui Date: Tue, 16 May 2017 22:14:03 +0800 -Subject: [PATCH 9/9] hvsock: fix a race in hvs_stream_dequeue() +Subject: [PATCH 10/14] hvsock: fix a race in hvs_stream_dequeue() If hv_pkt_iter_next() returns a non-NULL pointer, we must update the recv_data_len/data_off info, otherwise the received data will @@ -11,7 +11,7 @@ Thank Rolf for finding this! Reported-by: Rolf Neugebauer Signed-off-by: Dexuan Cui -Origin: https://github.com/dcui/linux/commits/decui/hv_sock/v4.11/20170511 +Origin: https://github.com/dcui/linux/commits/decui/hv_sock/v4.11/20170511-debug-0605 (cherry picked from commit 83c8635b893bbc0b5b329c632cea0382d5479763) --- net/vmw_vsock/hyperv_transport.c | 50 +++++++++++++++++++++++++++++----------- @@ -109,5 +109,5 @@ index f465b0b662df..30154836acd0 100644 case 1: ret = 1; -- -2.11.1 +2.13.0 diff --git a/kernel/patches-4.11.x/0011-hvsock-fix-vsock_dequeue-enqueue_accept-race.patch b/kernel/patches-4.11.x/0011-hvsock-fix-vsock_dequeue-enqueue_accept-race.patch new file mode 100644 index 000000000..7a83ba0b6 --- /dev/null +++ b/kernel/patches-4.11.x/0011-hvsock-fix-vsock_dequeue-enqueue_accept-race.patch @@ -0,0 +1,48 @@ +From 80782b837e261c1b8c56c919a8a2f9e750ea4a03 Mon Sep 17 00:00:00 2001 +From: Dexuan Cui +Date: Fri, 19 May 2017 21:49:59 +0800 +Subject: [PATCH 11/14] hvsock: fix vsock_dequeue/enqueue_accept race + +Origin: https://github.com/dcui/linux/commits/decui/hv_sock/v4.11/20170511-debug-0605 +(cherry picked from commit 29e6c6204845176c78c7840377a72389d188563c) +--- + net/vmw_vsock/af_vsock.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/net/vmw_vsock/af_vsock.c b/net/vmw_vsock/af_vsock.c +index 6f7f6757ceef..717db396f59e 100644 +--- a/net/vmw_vsock/af_vsock.c ++++ b/net/vmw_vsock/af_vsock.c +@@ -126,6 +126,7 @@ static struct proto vsock_proto = { + + static const struct vsock_transport *transport; + static DEFINE_MUTEX(vsock_register_mutex); ++static DEFINE_SPINLOCK(vsock_accept_queue_lock); + + /**** EXPORTS ****/ + +@@ -406,7 +407,10 @@ void vsock_enqueue_accept(struct sock *listener, struct sock *connected) + + sock_hold(connected); + sock_hold(listener); ++ ++ spin_lock(&vsock_accept_queue_lock); + list_add_tail(&vconnected->accept_queue, &vlistener->accept_queue); ++ spin_unlock(&vsock_accept_queue_lock); + } + EXPORT_SYMBOL_GPL(vsock_enqueue_accept); + +@@ -423,7 +427,10 @@ static struct sock *vsock_dequeue_accept(struct sock *listener) + vconnected = list_entry(vlistener->accept_queue.next, + struct vsock_sock, accept_queue); + ++ spin_lock(&vsock_accept_queue_lock); + list_del_init(&vconnected->accept_queue); ++ spin_unlock(&vsock_accept_queue_lock); ++ + sock_put(listener); + /* The caller will need a reference on the connected socket so we let + * it call sock_put(). +-- +2.13.0 + diff --git a/kernel/patches-4.11.x/0012-Drivers-hv-vmbus-Fix-rescind-handling.patch b/kernel/patches-4.11.x/0012-Drivers-hv-vmbus-Fix-rescind-handling.patch new file mode 100644 index 000000000..f83dcd21b --- /dev/null +++ b/kernel/patches-4.11.x/0012-Drivers-hv-vmbus-Fix-rescind-handling.patch @@ -0,0 +1,290 @@ +From 50fe52376c8d8bd905b45697fc7fe91f5da9c34e Mon Sep 17 00:00:00 2001 +From: "K. Y. Srinivasan" +Date: Sun, 30 Apr 2017 16:21:18 -0700 +Subject: [PATCH 12/14] Drivers: hv: vmbus: Fix rescind handling + +Fix the rescind handling. This patch addresses the following rescind +scenario that is currently not handled correctly: + +If a rescind were to be received while the offer is still being +peocessed, we will be blocked indefinitely since the rescind message +is handled on the same work element as the offer message. Fix this +issue. + +I would like to thank Dexuan Cui and +Long Li for working with me on this patch. + +Signed-off-by: K. Y. Srinivasan +Signed-off-by: Greg Kroah-Hartman +Origin: https://github.com/dcui/linux/commits/decui/hv_sock/v4.11/20170511-debug-0605 +(cherry picked from commit 6172aa1bbfb66a9e0b0da0f162f0e91c129e3c94) +--- + drivers/hv/channel.c | 8 ++++-- + drivers/hv/channel_mgmt.c | 69 ++++++++++++++++++++++++++++++++++++----------- + drivers/hv/connection.c | 7 +++-- + drivers/hv/hyperv_vmbus.h | 7 +++++ + drivers/hv/vmbus_drv.c | 29 +++++++++++++++++++- + 5 files changed, 99 insertions(+), 21 deletions(-) + +diff --git a/drivers/hv/channel.c b/drivers/hv/channel.c +index f288e506fba0..2dab00019933 100644 +--- a/drivers/hv/channel.c ++++ b/drivers/hv/channel.c +@@ -635,9 +635,13 @@ void vmbus_close(struct vmbus_channel *channel) + */ + list_for_each_safe(cur, tmp, &channel->sc_list) { + cur_channel = list_entry(cur, struct vmbus_channel, sc_list); +- if (cur_channel->state != CHANNEL_OPENED_STATE) +- continue; + vmbus_close_internal(cur_channel); ++ if (cur_channel->rescind) { ++ mutex_lock(&vmbus_connection.channel_mutex); ++ hv_process_channel_removal(cur_channel, ++ cur_channel->offermsg.child_relid); ++ mutex_unlock(&vmbus_connection.channel_mutex); ++ } + } + /* + * Now close the primary. +diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c +index c5a01a4d589e..292717d922e0 100644 +--- a/drivers/hv/channel_mgmt.c ++++ b/drivers/hv/channel_mgmt.c +@@ -441,7 +441,6 @@ void vmbus_free_channels(void) + { + struct vmbus_channel *channel, *tmp; + +- mutex_lock(&vmbus_connection.channel_mutex); + list_for_each_entry_safe(channel, tmp, &vmbus_connection.chn_list, + listentry) { + /* hv_process_channel_removal() needs this */ +@@ -449,7 +448,6 @@ void vmbus_free_channels(void) + + vmbus_device_unregister(channel->device_obj); + } +- mutex_unlock(&vmbus_connection.channel_mutex); + } + + /* +@@ -496,8 +494,10 @@ static void vmbus_process_offer(struct vmbus_channel *newchannel) + list_add_tail(&newchannel->sc_list, &channel->sc_list); + channel->num_sc++; + spin_unlock_irqrestore(&channel->lock, flags); +- } else ++ } else { ++ atomic_dec(&vmbus_connection.offer_in_progress); + goto err_free_chan; ++ } + } + + dev_type = hv_get_dev_type(newchannel); +@@ -514,6 +514,7 @@ static void vmbus_process_offer(struct vmbus_channel *newchannel) + if (!fnew) { + if (channel->sc_creation_callback != NULL) + channel->sc_creation_callback(newchannel); ++ atomic_dec(&vmbus_connection.offer_in_progress); + return; + } + +@@ -535,9 +536,7 @@ static void vmbus_process_offer(struct vmbus_channel *newchannel) + * binding which eventually invokes the device driver's AddDevice() + * method. + */ +- mutex_lock(&vmbus_connection.channel_mutex); + ret = vmbus_device_register(newchannel->device_obj); +- mutex_unlock(&vmbus_connection.channel_mutex); + + if (ret != 0) { + pr_err("unable to add child device object (relid %d)\n", +@@ -545,6 +544,8 @@ static void vmbus_process_offer(struct vmbus_channel *newchannel) + kfree(newchannel->device_obj); + goto err_deq_chan; + } ++ ++ atomic_dec(&vmbus_connection.offer_in_progress); + return; + + err_deq_chan: +@@ -791,6 +792,7 @@ static void vmbus_onoffer(struct vmbus_channel_message_header *hdr) + newchannel = alloc_channel(); + if (!newchannel) { + vmbus_release_relid(offer->child_relid); ++ atomic_dec(&vmbus_connection.offer_in_progress); + pr_err("Unable to allocate channel object\n"); + return; + } +@@ -837,16 +839,38 @@ static void vmbus_onoffer_rescind(struct vmbus_channel_message_header *hdr) + + rescind = (struct vmbus_channel_rescind_offer *)hdr; + ++ /* ++ * The offer msg and the corresponding rescind msg ++ * from the host are guranteed to be ordered - ++ * offer comes in first and then the rescind. ++ * Since we process these events in work elements, ++ * and with preemption, we may end up processing ++ * the events out of order. Given that we handle these ++ * work elements on the same CPU, this is possible only ++ * in the case of preemption. In any case wait here ++ * until the offer processing has moved beyond the ++ * point where the channel is discoverable. ++ */ ++ ++ while (atomic_read(&vmbus_connection.offer_in_progress) != 0) { ++ /* ++ * We wait here until any channel offer is currently ++ * being processed. ++ */ ++ msleep(1); ++ } ++ + mutex_lock(&vmbus_connection.channel_mutex); + channel = relid2channel(rescind->child_relid); ++ mutex_unlock(&vmbus_connection.channel_mutex); + + if (channel == NULL) { + /* +- * This is very impossible, because in +- * vmbus_process_offer(), we have already invoked +- * vmbus_release_relid() on error. ++ * We failed in processing the offer message; ++ * we would have cleaned up the relid in that ++ * failure path. + */ +- goto out; ++ return; + } + + spin_lock_irqsave(&channel->lock, flags); +@@ -858,7 +882,7 @@ 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); +- goto out; ++ return; + } + /* + * We will have to unregister this device from the +@@ -869,13 +893,26 @@ static void vmbus_onoffer_rescind(struct vmbus_channel_message_header *hdr) + vmbus_device_unregister(channel->device_obj); + put_device(dev); + } +- } else { +- hv_process_channel_removal(channel, +- channel->offermsg.child_relid); + } +- +-out: +- mutex_unlock(&vmbus_connection.channel_mutex); ++ if (channel->primary_channel != NULL) { ++ /* ++ * Sub-channel is being rescinded. Following is the channel ++ * close sequence when initiated from the driveri (refer to ++ * vmbus_close() for details): ++ * 1. Close all sub-channels first ++ * 2. Then close the primary channel. ++ */ ++ if (channel->state == CHANNEL_OPEN_STATE) { ++ /* ++ * The channel is currently not open; ++ * it is safe for us to cleanup the channel. ++ */ ++ mutex_lock(&vmbus_connection.channel_mutex); ++ hv_process_channel_removal(channel, ++ channel->offermsg.child_relid); ++ mutex_unlock(&vmbus_connection.channel_mutex); ++ } ++ } + } + + void vmbus_hvsock_device_unregister(struct vmbus_channel *channel) +diff --git a/drivers/hv/connection.c b/drivers/hv/connection.c +index a8366fec1458..13e2e148067b 100644 +--- a/drivers/hv/connection.c ++++ b/drivers/hv/connection.c +@@ -93,10 +93,13 @@ static int vmbus_negotiate_version(struct vmbus_channel_msginfo *msginfo, + * all the CPUs. This is needed for kexec to work correctly where + * the CPU attempting to connect may not be CPU 0. + */ +- if (version >= VERSION_WIN8_1) ++ if (version >= VERSION_WIN8_1) { + msg->target_vcpu = hv_context.vp_index[smp_processor_id()]; +- else ++ vmbus_connection.connect_cpu = smp_processor_id(); ++ } else { + msg->target_vcpu = 0; ++ vmbus_connection.connect_cpu = 0; ++ } + + /* + * Add to list before we send the request since we may +diff --git a/drivers/hv/hyperv_vmbus.h b/drivers/hv/hyperv_vmbus.h +index 884f83bba1ab..f37921517650 100644 +--- a/drivers/hv/hyperv_vmbus.h ++++ b/drivers/hv/hyperv_vmbus.h +@@ -314,6 +314,13 @@ enum vmbus_connect_state { + #define MAX_SIZE_CHANNEL_MESSAGE HV_MESSAGE_PAYLOAD_BYTE_COUNT + + struct vmbus_connection { ++ /* ++ * CPU on which the initial host contact was made. ++ */ ++ int connect_cpu; ++ ++ atomic_t offer_in_progress; ++ + enum vmbus_connect_state conn_state; + + atomic_t next_gpadl_handle; +diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c +index 8370b9dc6037..1024000af956 100644 +--- a/drivers/hv/vmbus_drv.c ++++ b/drivers/hv/vmbus_drv.c +@@ -800,8 +800,10 @@ static void vmbus_device_release(struct device *device) + struct hv_device *hv_dev = device_to_hv_device(device); + struct vmbus_channel *channel = hv_dev->channel; + ++ mutex_lock(&vmbus_connection.channel_mutex); + hv_process_channel_removal(channel, + channel->offermsg.child_relid); ++ mutex_unlock(&vmbus_connection.channel_mutex); + kfree(hv_dev); + + } +@@ -879,7 +881,32 @@ void vmbus_on_msg_dpc(unsigned long data) + INIT_WORK(&ctx->work, vmbus_onmessage_work); + memcpy(&ctx->msg, msg, sizeof(*msg)); + +- queue_work(vmbus_connection.work_queue, &ctx->work); ++ /* ++ * The host can generate a rescind message while we ++ * may still be handling the original offer. We deal with ++ * this condition by ensuring the processing is done on the ++ * same CPU. ++ */ ++ switch (hdr->msgtype) { ++ case CHANNELMSG_RESCIND_CHANNELOFFER: ++ /* ++ * If we are handling the rescind message; ++ * schedule the work on the global work queue. ++ */ ++ schedule_work_on(vmbus_connection.connect_cpu, ++ &ctx->work); ++ break; ++ ++ case CHANNELMSG_OFFERCHANNEL: ++ atomic_inc(&vmbus_connection.offer_in_progress); ++ queue_work_on(vmbus_connection.connect_cpu, ++ vmbus_connection.work_queue, ++ &ctx->work); ++ break; ++ ++ default: ++ queue_work(vmbus_connection.work_queue, &ctx->work); ++ } + } else + entry->message_handler(hdr); + +-- +2.13.0 + diff --git a/kernel/patches-4.11.x/0013-vmbus-fix-hv_percpu_channel_deq-enq-race.patch b/kernel/patches-4.11.x/0013-vmbus-fix-hv_percpu_channel_deq-enq-race.patch new file mode 100644 index 000000000..c5da5ec39 --- /dev/null +++ b/kernel/patches-4.11.x/0013-vmbus-fix-hv_percpu_channel_deq-enq-race.patch @@ -0,0 +1,246 @@ +From 30cda9241fff7666faf2e0f0427df2c5fba2019d Mon Sep 17 00:00:00 2001 +From: Dexuan Cui +Date: Mon, 5 Jun 2017 16:13:18 +0800 +Subject: [PATCH 13/14] vmbus: fix hv_percpu_channel_deq/enq race + +Signed-off-by: Dexuan Cui +Origin: https://github.com/dcui/linux/commits/decui/hv_sock/v4.11/20170511-debug-0605 +(cherry picked from commit 24ff598cdf98290b25805219eff78336bc08e5ab) +--- + drivers/hv/channel_mgmt.c | 32 +++++++++++++++++++++---- + drivers/hv/connection.c | 11 +++++++++ + drivers/hv/hyperv_vmbus.h | 1 + + drivers/hv/vmbus_drv.c | 59 ++++++++++++++++++++++++++++++++++++++++++++--- + 4 files changed, 95 insertions(+), 8 deletions(-) + +diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c +index 292717d922e0..b9a5a15370c9 100644 +--- a/drivers/hv/channel_mgmt.c ++++ b/drivers/hv/channel_mgmt.c +@@ -365,11 +365,16 @@ static void percpu_channel_enq(void *arg) + + void hv_percpu_channel_enq(struct vmbus_channel *channel) + { ++ unsigned long flags; ++ + if (channel->target_cpu != get_cpu()) + smp_call_function_single(channel->target_cpu, + percpu_channel_enq, channel, true); +- else ++ else { ++ local_irq_save(flags); + percpu_channel_enq(channel); ++ local_irq_restore(flags); ++ } + + put_cpu(); + } +@@ -383,11 +388,16 @@ static void percpu_channel_deq(void *arg) + + void hv_percpu_channel_deq(struct vmbus_channel *channel) + { ++ unsigned long flags; ++ + if (channel->target_cpu != get_cpu()) + smp_call_function_single(channel->target_cpu, + percpu_channel_deq, channel, true); +- else ++ else { ++ local_irq_save(flags); + percpu_channel_deq(channel); ++ local_irq_restore(flags); ++ } + + put_cpu(); + } +@@ -495,7 +505,6 @@ static void vmbus_process_offer(struct vmbus_channel *newchannel) + channel->num_sc++; + spin_unlock_irqrestore(&channel->lock, flags); + } else { +- atomic_dec(&vmbus_connection.offer_in_progress); + goto err_free_chan; + } + } +@@ -549,6 +558,7 @@ static void vmbus_process_offer(struct vmbus_channel *newchannel) + return; + + err_deq_chan: ++ atomic_dec(&vmbus_connection.offer_in_progress); + mutex_lock(&vmbus_connection.channel_mutex); + list_del(&newchannel->listentry); + mutex_unlock(&vmbus_connection.channel_mutex); +@@ -915,16 +925,28 @@ 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) + { +- mutex_lock(&vmbus_connection.channel_mutex); ++ 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); ++ + channel->rescind = true; + vmbus_device_unregister(channel->device_obj); + +- mutex_unlock(&vmbus_connection.channel_mutex); ++ /* Unblock the rescind handling */ ++ atomic_dec(&vmbus_connection.offer_in_progress); + } + EXPORT_SYMBOL_GPL(vmbus_hvsock_device_unregister); + +diff --git a/drivers/hv/connection.c b/drivers/hv/connection.c +index 13e2e148067b..9e4a3d099836 100644 +--- a/drivers/hv/connection.c ++++ b/drivers/hv/connection.c +@@ -156,6 +156,12 @@ int vmbus_connect(void) + goto cleanup; + } + ++ vmbus_connection.work_queue_rescind = create_workqueue("hv_vmbus_rsd"); ++ if (!vmbus_connection.work_queue_rescind) { ++ ret = -ENOMEM; ++ goto cleanup; ++ } ++ + INIT_LIST_HEAD(&vmbus_connection.chn_msg_list); + spin_lock_init(&vmbus_connection.channelmsg_lock); + +@@ -246,6 +252,11 @@ void vmbus_disconnect(void) + */ + vmbus_initiate_unload(false); + ++ if (vmbus_connection.work_queue_rescind) { ++ drain_workqueue(vmbus_connection.work_queue_rescind); ++ destroy_workqueue(vmbus_connection.work_queue_rescind); ++ } ++ + if (vmbus_connection.work_queue) { + drain_workqueue(vmbus_connection.work_queue); + destroy_workqueue(vmbus_connection.work_queue); +diff --git a/drivers/hv/hyperv_vmbus.h b/drivers/hv/hyperv_vmbus.h +index f37921517650..23b2bcbd174a 100644 +--- a/drivers/hv/hyperv_vmbus.h ++++ b/drivers/hv/hyperv_vmbus.h +@@ -350,6 +350,7 @@ struct vmbus_connection { + struct mutex channel_mutex; + + struct workqueue_struct *work_queue; ++ struct workqueue_struct *work_queue_rescind; + }; + + +diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c +index 1024000af956..be43e22ecd66 100644 +--- a/drivers/hv/vmbus_drv.c ++++ b/drivers/hv/vmbus_drv.c +@@ -839,6 +839,52 @@ static void vmbus_onmessage_work(struct work_struct *work) + kfree(ctx); + } + ++static void vmbus_dispatch_msg_work(struct work_struct *work) ++{ ++ struct vmbus_channel_message_header *hdr; ++ struct onmessage_work_context *ctx, *context; ++ ++ ctx = container_of(work, struct onmessage_work_context, work); ++ hdr = (struct vmbus_channel_message_header *)ctx->msg.u.payload; ++ ++ context = kmalloc(sizeof(*context), GFP_KERNEL | __GFP_NOFAIL); ++ INIT_WORK(&context->work, vmbus_onmessage_work); ++ memcpy(&context->msg, &ctx->msg, sizeof(struct hv_message)); ++ ++ /* ++ * The host can generate a rescind message while we ++ * may still be handling the original offer. We deal with ++ * this condition by ensuring the processing is done on the ++ * same CPU. ++ */ ++ switch (hdr->msgtype) { ++ case CHANNELMSG_RESCIND_CHANNELOFFER: ++ /* ++ * If we are handling the rescind message; ++ * schedule the work on the global work queue. ++ */ ++ queue_work_on(vmbus_connection.connect_cpu, ++ vmbus_connection.work_queue_rescind, ++ &context->work); ++ break; ++ ++ case CHANNELMSG_OFFERCHANNEL: ++ /* XXX */ ++ flush_workqueue(vmbus_connection.work_queue_rescind); ++ ++ atomic_inc(&vmbus_connection.offer_in_progress); ++ queue_work_on(vmbus_connection.connect_cpu, ++ vmbus_connection.work_queue, ++ &context->work); ++ break; ++ ++ default: ++ queue_work(vmbus_connection.work_queue, &context->work); ++ } ++ ++ kfree(ctx); ++} ++ + static void hv_process_timer_expiration(struct hv_message *msg, + struct hv_per_cpu_context *hv_cpu) + { +@@ -878,9 +924,10 @@ void vmbus_on_msg_dpc(unsigned long data) + if (ctx == NULL) + return; + +- INIT_WORK(&ctx->work, vmbus_onmessage_work); ++ INIT_WORK(&ctx->work, vmbus_dispatch_msg_work); + memcpy(&ctx->msg, msg, sizeof(*msg)); + ++#if 0 + /* + * The host can generate a rescind message while we + * may still be handling the original offer. We deal with +@@ -893,8 +940,9 @@ void vmbus_on_msg_dpc(unsigned long data) + * If we are handling the rescind message; + * schedule the work on the global work queue. + */ +- schedule_work_on(vmbus_connection.connect_cpu, +- &ctx->work); ++ queue_work_on(vmbus_connection.connect_cpu, ++ vmbus_connection.work_queue_rescind, ++ &ctx->work); + break; + + case CHANNELMSG_OFFERCHANNEL: +@@ -907,6 +955,9 @@ void vmbus_on_msg_dpc(unsigned long data) + default: + queue_work(vmbus_connection.work_queue, &ctx->work); + } ++#else ++ schedule_work(&ctx->work); ++#endif + } else + entry->message_handler(hdr); + +@@ -1204,6 +1255,8 @@ int vmbus_device_register(struct hv_device *child_device_obj) + child_device_obj->device.parent = &hv_acpi_dev->dev; + child_device_obj->device.release = vmbus_device_release; + ++ if (is_hvsock_channel(child_device_obj->channel)) ++ dev_set_uevent_suppress(&child_device_obj->device, 1); + /* + * Register with the LDM. This will kick off the driver/device + * binding...which will eventually call vmbus_match() and vmbus_probe() +-- +2.13.0 + diff --git a/kernel/patches-4.11.x/0014-vmbus-add-vmbus-onoffer-onoffer_rescind-sync.patch b/kernel/patches-4.11.x/0014-vmbus-add-vmbus-onoffer-onoffer_rescind-sync.patch new file mode 100644 index 000000000..8fe4112f8 --- /dev/null +++ b/kernel/patches-4.11.x/0014-vmbus-add-vmbus-onoffer-onoffer_rescind-sync.patch @@ -0,0 +1,119 @@ +From a51f61d1b7a12097545cb23508faef7d3a4384f2 Mon Sep 17 00:00:00 2001 +From: Dexuan Cui +Date: Mon, 5 Jun 2017 21:32:00 +0800 +Subject: [PATCH 14/14] vmbus: add vmbus onoffer/onoffer_rescind sync. + +Signed-off-by: Dexuan Cui +Origin: https://github.com/dcui/linux/commits/decui/hv_sock/v4.11/20170511-debug-0605 +(cherry picked from commit 9a00fd7c4ad9c5d1da39c3c44328145fe063ceed) +--- + drivers/hv/channel_mgmt.c | 25 +++++++++++++++++++------ + drivers/hv/hyperv_vmbus.h | 1 + + drivers/hv/vmbus_drv.c | 1 + + 3 files changed, 21 insertions(+), 6 deletions(-) + +diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c +index b9a5a15370c9..52c7e811738f 100644 +--- a/drivers/hv/channel_mgmt.c ++++ b/drivers/hv/channel_mgmt.c +@@ -467,6 +467,7 @@ void vmbus_free_channels(void) + static void vmbus_process_offer(struct vmbus_channel *newchannel) + { + struct vmbus_channel *channel; ++ struct hv_device *device_obj; + bool fnew = true; + unsigned long flags; + u16 dev_type; +@@ -524,6 +525,7 @@ static void vmbus_process_offer(struct vmbus_channel *newchannel) + if (channel->sc_creation_callback != NULL) + channel->sc_creation_callback(newchannel); + atomic_dec(&vmbus_connection.offer_in_progress); ++ atomic_dec(&vmbus_connection.register_in_progress); + return; + } + +@@ -532,33 +534,36 @@ static void vmbus_process_offer(struct vmbus_channel *newchannel) + * We need to set the DeviceObject field before calling + * vmbus_child_dev_add() + */ +- newchannel->device_obj = vmbus_device_create( ++ device_obj = vmbus_device_create( + &newchannel->offermsg.offer.if_type, + &newchannel->offermsg.offer.if_instance, + newchannel); +- if (!newchannel->device_obj) ++ if (!device_obj) + goto err_deq_chan; + +- newchannel->device_obj->device_id = dev_type; ++ device_obj->device_id = dev_type; + /* + * Add the new device to the bus. This will kick off device-driver + * binding which eventually invokes the device driver's AddDevice() + * method. + */ +- ret = vmbus_device_register(newchannel->device_obj); ++ atomic_dec(&vmbus_connection.offer_in_progress); ++ ret = vmbus_device_register(device_obj); + + if (ret != 0) { + pr_err("unable to add child device object (relid %d)\n", + newchannel->offermsg.child_relid); +- kfree(newchannel->device_obj); ++ kfree(device_obj); + goto err_deq_chan; + } ++ newchannel->device_obj = device_obj; ++ atomic_dec(&vmbus_connection.register_in_progress); + +- atomic_dec(&vmbus_connection.offer_in_progress); + return; + + err_deq_chan: + atomic_dec(&vmbus_connection.offer_in_progress); ++ atomic_dec(&vmbus_connection.register_in_progress); + mutex_lock(&vmbus_connection.channel_mutex); + list_del(&newchannel->listentry); + mutex_unlock(&vmbus_connection.channel_mutex); +@@ -889,6 +894,14 @@ static void vmbus_onoffer_rescind(struct vmbus_channel_message_header *hdr) + + vmbus_rescind_cleanup(channel); + ++ while (atomic_read(&vmbus_connection.register_in_progress) != 0) { ++ /* ++ * We wait here until any channel offer is currently ++ * being processed. ++ */ ++ msleep(1); ++ } ++ + if (channel->device_obj) { + if (channel->chn_rescind_callback) { + channel->chn_rescind_callback(channel); +diff --git a/drivers/hv/hyperv_vmbus.h b/drivers/hv/hyperv_vmbus.h +index 23b2bcbd174a..0d22b842a469 100644 +--- a/drivers/hv/hyperv_vmbus.h ++++ b/drivers/hv/hyperv_vmbus.h +@@ -320,6 +320,7 @@ struct vmbus_connection { + int connect_cpu; + + atomic_t offer_in_progress; ++ atomic_t register_in_progress; + + enum vmbus_connect_state conn_state; + +diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c +index be43e22ecd66..822daa0936c2 100644 +--- a/drivers/hv/vmbus_drv.c ++++ b/drivers/hv/vmbus_drv.c +@@ -873,6 +873,7 @@ static void vmbus_dispatch_msg_work(struct work_struct *work) + flush_workqueue(vmbus_connection.work_queue_rescind); + + atomic_inc(&vmbus_connection.offer_in_progress); ++ atomic_inc(&vmbus_connection.register_in_progress); + queue_work_on(vmbus_connection.connect_cpu, + vmbus_connection.work_queue, + &context->work); +-- +2.13.0 + diff --git a/kernel/patches-4.9.x/0001-tools-build-Add-test-for-sched_getcpu.patch b/kernel/patches-4.9.x/0001-tools-build-Add-test-for-sched_getcpu.patch new file mode 100644 index 000000000..061f2a074 --- /dev/null +++ b/kernel/patches-4.9.x/0001-tools-build-Add-test-for-sched_getcpu.patch @@ -0,0 +1,150 @@ +From f362cabb29dbdba34de667cf1bcbc011fed7e784 Mon Sep 17 00:00:00 2001 +From: Arnaldo Carvalho de Melo +Date: Thu, 2 Mar 2017 12:55:49 -0300 +Subject: [PATCH 01/12] tools build: Add test for sched_getcpu() + +Instead of trying to go on adding more ifdef conditions, do a feature +test and define HAVE_SCHED_GETCPU_SUPPORT instead, then use it to +provide the prototype. No need to change the stub, as it is already a +__weak symbol. + +Cc: Adrian Hunter +Cc: David Ahern +Cc: Jiri Olsa +Cc: Namhyung Kim +Cc: Wang Nan +Link: http://lkml.kernel.org/n/tip-yge89er9g90sc0v6k0a0r5tr@git.kernel.org +Signed-off-by: Arnaldo Carvalho de Melo +(cherry picked from commit 120010cb1eea151d38a3e66f5ffc79a0c3110292) +Signed-off-by: Rolf Neugebauer +--- + tools/build/Makefile.feature | 1 + + tools/build/feature/Makefile | 6 +++++- + tools/build/feature/test-all.c | 5 +++++ + tools/build/feature/test-sched_getcpu.c | 7 +++++++ + tools/perf/Makefile.config | 4 ++++ + tools/perf/util/cloexec.h | 6 ------ + tools/perf/util/util.h | 4 ++-- + 7 files changed, 24 insertions(+), 9 deletions(-) + create mode 100644 tools/build/feature/test-sched_getcpu.c + +diff --git a/tools/build/Makefile.feature b/tools/build/Makefile.feature +index ae52e029dd22..ea0a46b4f65f 100644 +--- a/tools/build/Makefile.feature ++++ b/tools/build/Makefile.feature +@@ -63,6 +63,7 @@ FEATURE_TESTS_BASIC := \ + lzma \ + get_cpuid \ + bpf \ ++ sched_getcpu \ + sdt + + # FEATURE_TESTS_BASIC + FEATURE_TESTS_EXTRA is the complete list +diff --git a/tools/build/feature/Makefile b/tools/build/feature/Makefile +index ac9c477a2a48..5d5f093b85a1 100644 +--- a/tools/build/feature/Makefile ++++ b/tools/build/feature/Makefile +@@ -47,7 +47,8 @@ FILES= \ + test-bpf.bin \ + test-get_cpuid.bin \ + test-sdt.bin \ +- test-cxx.bin ++ test-cxx.bin \ ++ test-sched_getcpu.bin + + FILES := $(addprefix $(OUTPUT),$(FILES)) + +@@ -89,6 +90,9 @@ $(OUTPUT)test-libelf.bin: + $(OUTPUT)test-glibc.bin: + $(BUILD) + ++$(OUTPUT)test-sched_getcpu.bin: ++ $(BUILD) ++ + DWARFLIBS := -ldw + ifeq ($(findstring -static,${LDFLAGS}),-static) + DWARFLIBS += -lelf -lebl -lz -llzma -lbz2 +diff --git a/tools/build/feature/test-all.c b/tools/build/feature/test-all.c +index 699e43627397..cc6c7c01f4ca 100644 +--- a/tools/build/feature/test-all.c ++++ b/tools/build/feature/test-all.c +@@ -117,6 +117,10 @@ + # include "test-pthread-attr-setaffinity-np.c" + #undef main + ++#define main main_test_sched_getcpu ++# include "test-sched_getcpu.c" ++#undef main ++ + # if 0 + /* + * Disable libbabeltrace check for test-all, because the requested +@@ -182,6 +186,7 @@ int main(int argc, char *argv[]) + main_test_get_cpuid(); + main_test_bpf(); + main_test_libcrypto(); ++ main_test_sched_getcpu(); + main_test_sdt(); + + return 0; +diff --git a/tools/build/feature/test-sched_getcpu.c b/tools/build/feature/test-sched_getcpu.c +new file mode 100644 +index 000000000000..c4a148dd7104 +--- /dev/null ++++ b/tools/build/feature/test-sched_getcpu.c +@@ -0,0 +1,7 @@ ++#define _GNU_SOURCE ++#include ++ ++int main(void) ++{ ++ return sched_getcpu(); ++} +diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config +index cffdd9cf3ebf..a33f737329ae 100644 +--- a/tools/perf/Makefile.config ++++ b/tools/perf/Makefile.config +@@ -296,6 +296,10 @@ ifdef NO_DWARF + NO_LIBDW_DWARF_UNWIND := 1 + endif + ++ifeq ($(feature-sched_getcpu), 1) ++ CFLAGS += -DHAVE_SCHED_GETCPU_SUPPORT ++endif ++ + ifndef NO_LIBELF + CFLAGS += -DHAVE_LIBELF_SUPPORT + EXTLIBS += -lelf +diff --git a/tools/perf/util/cloexec.h b/tools/perf/util/cloexec.h +index d0d465953d36..94a5a7d829d5 100644 +--- a/tools/perf/util/cloexec.h ++++ b/tools/perf/util/cloexec.h +@@ -3,10 +3,4 @@ + + unsigned long perf_event_open_cloexec_flag(void); + +-#ifdef __GLIBC_PREREQ +-#if !__GLIBC_PREREQ(2, 6) && !defined(__UCLIBC__) +-int sched_getcpu(void) __THROW; +-#endif +-#endif +- + #endif /* __PERF_CLOEXEC_H */ +diff --git a/tools/perf/util/util.h b/tools/perf/util/util.h +index 43899e0d6fa1..c3b180254f91 100644 +--- a/tools/perf/util/util.h ++++ b/tools/perf/util/util.h +@@ -356,8 +356,8 @@ void print_binary(unsigned char *data, size_t len, + size_t bytes_per_line, print_binary_t printer, + void *extra); + +-#if !defined(__GLIBC__) && !defined(__ANDROID__) +-extern int sched_getcpu(void); ++#ifndef HAVE_SCHED_GETCPU_SUPPORT ++int sched_getcpu(void); + #endif + + int is_printable_array(char *p, unsigned int len); +-- +2.13.0 + diff --git a/kernel/patches-4.9.x/0002-perf-jit-Avoid-returning-garbage-for-a-ret-variable.patch b/kernel/patches-4.9.x/0002-perf-jit-Avoid-returning-garbage-for-a-ret-variable.patch new file mode 100644 index 000000000..e0265d95b --- /dev/null +++ b/kernel/patches-4.9.x/0002-perf-jit-Avoid-returning-garbage-for-a-ret-variable.patch @@ -0,0 +1,70 @@ +From 20a8ecb884aaae0e43d2ce631d799b73f7825828 Mon Sep 17 00:00:00 2001 +From: Arnaldo Carvalho de Melo +Date: Thu, 13 Oct 2016 17:12:35 -0300 +Subject: [PATCH 02/12] perf jit: Avoid returning garbage for a ret variable + +When the loop body isn't executed at all, then the 'ret' local variable, +that is uninitialized will be used as the return value. + +This triggers this error on Alpine Linux: + + CC /tmp/build/perf/util/demangle-java.o + CC /tmp/build/perf/util/demangle-rust.o + CC /tmp/build/perf/util/jitdump.o + CC /tmp/build/perf/util/genelf.o + util/jitdump.c: In function 'jit_process': + util/jitdump.c:622:3: error: 'ret' may be used uninitialized in this function [-Werror=maybe-uninitialized] + fprintf(stderr, "injected: %s (%d)\n", path, ret); + ^ + util/jitdump.c:584:6: note: 'ret' was declared here + int ret; + ^ + FLEX /tmp/build/perf/util/parse-events-flex.c + + / $ gcc -v + Using built-in specs. + COLLECT_GCC=gcc + COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-alpine-linux-musl/5.3.0/lto-wrapper + Target: x86_64-alpine-linux-musl + Configured with: /home/buildozer/aports/main/gcc/src/gcc-5.3.0/configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info + +--build=x86_64-alpine-linux-musl --host=x86_64-alpine-linux-musl --target=x86_64-alpine-linux-musl --with-pkgversion='Alpine 5.3.0' --enable-checking=release + +--disable-fixed-point --disable-libstdcxx-pch --disable-multilib --disable-nls --disable-werror --disable-symvers --enable-__cxa_atexit --enable-esp + +--enable-cloog-backend --enable-languages=c,c++,objc,java,fortran,ada --disable-libssp --disable-libmudflap --disable-libsanitizer --enable-shared + +--enable-threads --enable-tls --with-system-zlib + Thread model: posix + gcc version 5.3.0 (Alpine 5.3.0) + +But this so far got under the radar, not causing any build problem, till the +"perf jit: enable jitdump support without dwarf" gets applied, when the above +problem takes place, some combination of inlining or whatever, the problem +is real, so fix it by initializing the variable to zero. + +Cc: Anton Blanchard +Cc: Jiri Olsa +Cc: Maciej Debski +Cc: Namhyung Kim +Cc: Peter Zijlstra +Cc: Stephane Eranian +Link: https://lkml.kernel.org/r/20161013200437.GA12815@kernel.org +Signed-off-by: Arnaldo Carvalho de Melo +(cherry picked from commit ef2c3e76d98dfb69a46d870b47656e8e5bac6e2b) +--- + tools/perf/util/jitdump.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tools/perf/util/jitdump.c b/tools/perf/util/jitdump.c +index 95f0884aae02..f3ed3c963c71 100644 +--- a/tools/perf/util/jitdump.c ++++ b/tools/perf/util/jitdump.c +@@ -581,7 +581,7 @@ static int + jit_process_dump(struct jit_buf_desc *jd) + { + union jr_entry *jr; +- int ret; ++ int ret = 0; + + while ((jr = jit_get_next_entry(jd))) { + switch(jr->prefix.id) { +-- +2.13.0 + diff --git a/kernel/patches-4.9.x/0001-hv_sock-introduce-Hyper-V-Sockets.patch b/kernel/patches-4.9.x/0003-hv_sock-introduce-Hyper-V-Sockets.patch similarity index 99% rename from kernel/patches-4.9.x/0001-hv_sock-introduce-Hyper-V-Sockets.patch rename to kernel/patches-4.9.x/0003-hv_sock-introduce-Hyper-V-Sockets.patch index bc94e9752..2492fc7c1 100644 --- a/kernel/patches-4.9.x/0001-hv_sock-introduce-Hyper-V-Sockets.patch +++ b/kernel/patches-4.9.x/0003-hv_sock-introduce-Hyper-V-Sockets.patch @@ -1,7 +1,7 @@ -From b3ab7614ecd7602494567af7443aaba1332558db Mon Sep 17 00:00:00 2001 +From 345e0d8b616922b8c7efb9bf3132f6d706d9c050 Mon Sep 17 00:00:00 2001 From: Dexuan Cui Date: Sat, 23 Jul 2016 01:35:51 +0000 -Subject: [PATCH 01/10] hv_sock: introduce Hyper-V Sockets +Subject: [PATCH 03/12] hv_sock: introduce Hyper-V Sockets Hyper-V Sockets (hv_sock) supplies a byte-stream based communication mechanism between the host and the guest. It's somewhat like TCP over @@ -1787,5 +1787,5 @@ index 000000000000..331d3759f5cb +MODULE_DESCRIPTION("Hyper-V Sockets"); +MODULE_LICENSE("Dual BSD/GPL"); -- -2.11.1 +2.13.0 diff --git a/kernel/patches-4.9.x/0002-vmbus-Don-t-spam-the-logs-with-unknown-GUIDs.patch b/kernel/patches-4.9.x/0004-vmbus-Don-t-spam-the-logs-with-unknown-GUIDs.patch similarity index 86% rename from kernel/patches-4.9.x/0002-vmbus-Don-t-spam-the-logs-with-unknown-GUIDs.patch rename to kernel/patches-4.9.x/0004-vmbus-Don-t-spam-the-logs-with-unknown-GUIDs.patch index 131ca71b9..0d67733fc 100644 --- a/kernel/patches-4.9.x/0002-vmbus-Don-t-spam-the-logs-with-unknown-GUIDs.patch +++ b/kernel/patches-4.9.x/0004-vmbus-Don-t-spam-the-logs-with-unknown-GUIDs.patch @@ -1,7 +1,7 @@ -From 012f922a413f62dd3714e7a5267c5054c5925783 Mon Sep 17 00:00:00 2001 +From 70d9b4de7ab8d510f1370b81901a29e51485bb17 Mon Sep 17 00:00:00 2001 From: Rolf Neugebauer Date: Mon, 23 May 2016 18:55:45 +0100 -Subject: [PATCH 02/10] vmbus: Don't spam the logs with unknown GUIDs +Subject: [PATCH 04/12] vmbus: Don't spam the logs with unknown GUIDs With Hyper-V sockets device types are introduced on the fly. The pr_info() then prints a message on every connection, which is way too verbose. Since @@ -26,5 +26,5 @@ index d8bc4b910192..8df02f3ca0b2 100644 } -- -2.11.1 +2.13.0 diff --git a/kernel/patches-4.9.x/0003-Drivers-hv-utils-Fix-the-mapping-between-host-versio.patch b/kernel/patches-4.9.x/0005-Drivers-hv-utils-Fix-the-mapping-between-host-versio.patch similarity index 91% rename from kernel/patches-4.9.x/0003-Drivers-hv-utils-Fix-the-mapping-between-host-versio.patch rename to kernel/patches-4.9.x/0005-Drivers-hv-utils-Fix-the-mapping-between-host-versio.patch index e0b3bbbbf..5a82e2207 100644 --- a/kernel/patches-4.9.x/0003-Drivers-hv-utils-Fix-the-mapping-between-host-versio.patch +++ b/kernel/patches-4.9.x/0005-Drivers-hv-utils-Fix-the-mapping-between-host-versio.patch @@ -1,7 +1,7 @@ -From c04811a761d6df8dc7be550a646c16c2125bad38 Mon Sep 17 00:00:00 2001 +From dbd801cfa0ca1bd8a218b63547e755fd93b10303 Mon Sep 17 00:00:00 2001 From: Alex Ng Date: Sun, 6 Nov 2016 13:14:07 -0800 -Subject: [PATCH 03/10] Drivers: hv: utils: Fix the mapping between host +Subject: [PATCH 05/12] Drivers: hv: utils: Fix the mapping between host version and protocol to use We should intentionally declare the protocols to use for every known host @@ -44,5 +44,5 @@ index bcd06306f3e8..e7707747f56d 100644 } -- -2.11.1 +2.13.0 diff --git a/kernel/patches-4.9.x/0004-Drivers-hv-vss-Improve-log-messages.patch b/kernel/patches-4.9.x/0006-Drivers-hv-vss-Improve-log-messages.patch similarity index 96% rename from kernel/patches-4.9.x/0004-Drivers-hv-vss-Improve-log-messages.patch rename to kernel/patches-4.9.x/0006-Drivers-hv-vss-Improve-log-messages.patch index fc66c1b6e..de4844fa1 100644 --- a/kernel/patches-4.9.x/0004-Drivers-hv-vss-Improve-log-messages.patch +++ b/kernel/patches-4.9.x/0006-Drivers-hv-vss-Improve-log-messages.patch @@ -1,7 +1,7 @@ -From 854ddd4b4fdaefc292b09d4f4b250a5fee889114 Mon Sep 17 00:00:00 2001 +From b005bf4a7605ae77dbb6547be58a2a00c1a204ed Mon Sep 17 00:00:00 2001 From: Alex Ng Date: Sun, 6 Nov 2016 13:14:10 -0800 -Subject: [PATCH 04/10] Drivers: hv: vss: Improve log messages. +Subject: [PATCH 06/12] Drivers: hv: vss: Improve log messages. Adding log messages to help troubleshoot error cases and transaction handling. @@ -101,5 +101,5 @@ index a76e3db0d01f..b1446d51ef45 100644 return 0; } -- -2.11.1 +2.13.0 diff --git a/kernel/patches-4.9.x/0005-Drivers-hv-vss-Operation-timeouts-should-match-host-.patch b/kernel/patches-4.9.x/0007-Drivers-hv-vss-Operation-timeouts-should-match-host-.patch similarity index 92% rename from kernel/patches-4.9.x/0005-Drivers-hv-vss-Operation-timeouts-should-match-host-.patch rename to kernel/patches-4.9.x/0007-Drivers-hv-vss-Operation-timeouts-should-match-host-.patch index 79569e03f..c8ad59e40 100644 --- a/kernel/patches-4.9.x/0005-Drivers-hv-vss-Operation-timeouts-should-match-host-.patch +++ b/kernel/patches-4.9.x/0007-Drivers-hv-vss-Operation-timeouts-should-match-host-.patch @@ -1,7 +1,7 @@ -From 2174dbb9313a539f86857a8919225b5409022dba Mon Sep 17 00:00:00 2001 +From e90c65ae67af6caf6dcdc6737b7fedcbefba1f5e Mon Sep 17 00:00:00 2001 From: Alex Ng Date: Sun, 6 Nov 2016 13:14:11 -0800 -Subject: [PATCH 05/10] Drivers: hv: vss: Operation timeouts should match host +Subject: [PATCH 07/12] Drivers: hv: vss: Operation timeouts should match host expectation Increase the timeout of backup operations. When system is under I/O load, @@ -44,5 +44,5 @@ index b1446d51ef45..4e543dbb731a 100644 rc = hvutil_transport_send(hvt, vss_msg, sizeof(*vss_msg), NULL); if (rc) { -- -2.11.1 +2.13.0 diff --git a/kernel/patches-4.9.x/0006-Drivers-hv-vmbus-Use-all-supported-IC-versions-to-ne.patch b/kernel/patches-4.9.x/0008-Drivers-hv-vmbus-Use-all-supported-IC-versions-to-ne.patch similarity index 99% rename from kernel/patches-4.9.x/0006-Drivers-hv-vmbus-Use-all-supported-IC-versions-to-ne.patch rename to kernel/patches-4.9.x/0008-Drivers-hv-vmbus-Use-all-supported-IC-versions-to-ne.patch index 92bc67361..e8f9b90b2 100644 --- a/kernel/patches-4.9.x/0006-Drivers-hv-vmbus-Use-all-supported-IC-versions-to-ne.patch +++ b/kernel/patches-4.9.x/0008-Drivers-hv-vmbus-Use-all-supported-IC-versions-to-ne.patch @@ -1,7 +1,7 @@ -From 97e7a019f9f4bafcabb1689ad33b27fb60c3606c Mon Sep 17 00:00:00 2001 +From c3effb92348cc1e120705f16ad134ce059c2a2d2 Mon Sep 17 00:00:00 2001 From: Alex Ng Date: Sat, 28 Jan 2017 12:37:17 -0700 -Subject: [PATCH 06/10] Drivers: hv: vmbus: Use all supported IC versions to +Subject: [PATCH 08/12] Drivers: hv: vmbus: Use all supported IC versions to negotiate Previously, we were assuming that each IC protocol version was tied to a @@ -488,5 +488,5 @@ index 489ad74c1e6e..956acfc93487 100644 void hv_event_tasklet_disable(struct vmbus_channel *channel); void hv_event_tasklet_enable(struct vmbus_channel *channel); -- -2.11.1 +2.13.0 diff --git a/kernel/patches-4.9.x/0007-Drivers-hv-Log-the-negotiated-IC-versions.patch b/kernel/patches-4.9.x/0009-Drivers-hv-Log-the-negotiated-IC-versions.patch similarity index 96% rename from kernel/patches-4.9.x/0007-Drivers-hv-Log-the-negotiated-IC-versions.patch rename to kernel/patches-4.9.x/0009-Drivers-hv-Log-the-negotiated-IC-versions.patch index c9c8c849a..f6b848a35 100644 --- a/kernel/patches-4.9.x/0007-Drivers-hv-Log-the-negotiated-IC-versions.patch +++ b/kernel/patches-4.9.x/0009-Drivers-hv-Log-the-negotiated-IC-versions.patch @@ -1,7 +1,7 @@ -From 869354ebd5dc2ad10446b7bd041715ddd181e82b Mon Sep 17 00:00:00 2001 +From b140005685c86b44df788ade32cc887c2954a180 Mon Sep 17 00:00:00 2001 From: Alex Ng Date: Sat, 28 Jan 2017 12:37:18 -0700 -Subject: [PATCH 07/10] Drivers: hv: Log the negotiated IC versions. +Subject: [PATCH 09/12] Drivers: hv: Log the negotiated IC versions. Log the negotiated IC versions. @@ -114,5 +114,5 @@ index f3797c07be10..89440c2eb346 100644 hb_srv_version & 0xFFFF); } -- -2.11.1 +2.13.0 diff --git a/kernel/patches-4.9.x/0008-vmbus-fix-missed-ring-events-on-boot.patch b/kernel/patches-4.9.x/0010-vmbus-fix-missed-ring-events-on-boot.patch similarity index 93% rename from kernel/patches-4.9.x/0008-vmbus-fix-missed-ring-events-on-boot.patch rename to kernel/patches-4.9.x/0010-vmbus-fix-missed-ring-events-on-boot.patch index fb18f3023..8fb6fd717 100644 --- a/kernel/patches-4.9.x/0008-vmbus-fix-missed-ring-events-on-boot.patch +++ b/kernel/patches-4.9.x/0010-vmbus-fix-missed-ring-events-on-boot.patch @@ -1,7 +1,7 @@ -From c6d35f59897111836c99ac496fc19185ad5b2d14 Mon Sep 17 00:00:00 2001 +From 6d6402672f5f6ff6940653f0d0e1534ed44648d2 Mon Sep 17 00:00:00 2001 From: Dexuan Cui Date: Sun, 26 Mar 2017 16:42:20 +0800 -Subject: [PATCH 08/10] vmbus: fix missed ring events on boot +Subject: [PATCH 10/12] vmbus: fix missed ring events on boot During initialization, the channel initialization code schedules the tasklet to scan the VMBUS receive event page (i.e. simulates an @@ -52,5 +52,5 @@ index e7949b64bfbc..2fe024e86209 100644 void hv_process_channel_removal(struct vmbus_channel *channel, u32 relid) -- -2.11.1 +2.13.0 diff --git a/kernel/patches-4.9.x/0009-vmbus-remove-goto-error_clean_msglist-in-vmbus_open.patch b/kernel/patches-4.9.x/0011-vmbus-remove-goto-error_clean_msglist-in-vmbus_open.patch similarity index 92% rename from kernel/patches-4.9.x/0009-vmbus-remove-goto-error_clean_msglist-in-vmbus_open.patch rename to kernel/patches-4.9.x/0011-vmbus-remove-goto-error_clean_msglist-in-vmbus_open.patch index 5ec62cd9b..3a62ad53d 100644 --- a/kernel/patches-4.9.x/0009-vmbus-remove-goto-error_clean_msglist-in-vmbus_open.patch +++ b/kernel/patches-4.9.x/0011-vmbus-remove-goto-error_clean_msglist-in-vmbus_open.patch @@ -1,7 +1,7 @@ -From 84ebcb68437336010f9ca728cf127f949d534054 Mon Sep 17 00:00:00 2001 +From bd98313228b6ec9018c83f02586fa7a07fafac36 Mon Sep 17 00:00:00 2001 From: Dexuan Cui Date: Wed, 29 Mar 2017 18:37:10 +0800 -Subject: [PATCH 09/10] vmbus: remove "goto error_clean_msglist" in +Subject: [PATCH 11/12] vmbus: remove "goto error_clean_msglist" in vmbus_open() This is just a cleanup patch to simplify the code a little. @@ -56,5 +56,5 @@ index 1606e7f08f4b..1caed01954f6 100644 vmbus_teardown_gpadl(newchannel, newchannel->ringbuffer_gpadlhandle); kfree(open_info); -- -2.11.1 +2.13.0 diff --git a/kernel/patches-4.9.x/0010-vmbus-dynamically-enqueue-dequeue-the-channel-on-vmb.patch b/kernel/patches-4.9.x/0012-vmbus-dynamically-enqueue-dequeue-the-channel-on-vmb.patch similarity index 97% rename from kernel/patches-4.9.x/0010-vmbus-dynamically-enqueue-dequeue-the-channel-on-vmb.patch rename to kernel/patches-4.9.x/0012-vmbus-dynamically-enqueue-dequeue-the-channel-on-vmb.patch index c74c1306d..67ead0ac5 100644 --- a/kernel/patches-4.9.x/0010-vmbus-dynamically-enqueue-dequeue-the-channel-on-vmb.patch +++ b/kernel/patches-4.9.x/0012-vmbus-dynamically-enqueue-dequeue-the-channel-on-vmb.patch @@ -1,7 +1,7 @@ -From 4ca791e8f598c5bab9cbc2c2d7f35d8c3c6328a3 Mon Sep 17 00:00:00 2001 +From 0656da868b410cfd818b9551411c40ac9c8c42ef Mon Sep 17 00:00:00 2001 From: Dexuan Cui Date: Fri, 24 Mar 2017 20:53:18 +0800 -Subject: [PATCH 10/10] vmbus: dynamically enqueue/dequeue the channel on +Subject: [PATCH 12/12] vmbus: dynamically enqueue/dequeue the channel on vmbus_open/close Signed-off-by: Dexuan Cui @@ -173,5 +173,5 @@ index 956acfc93487..9ee292b28e41 100644 void vmbus_setevent(struct vmbus_channel *channel); -- -2.11.1 +2.13.0