mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-19 01:06:27 +00:00
commit
9e5179f11c
@ -257,6 +257,7 @@ CONFIG_KPROBES_ON_FTRACE=y
|
||||
CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
|
||||
CONFIG_ARCH_USE_BUILTIN_BSWAP=y
|
||||
CONFIG_KRETPROBES=y
|
||||
CONFIG_USER_RETURN_NOTIFIER=y
|
||||
CONFIG_HAVE_IOREMAP_PROT=y
|
||||
CONFIG_HAVE_KPROBES=y
|
||||
CONFIG_HAVE_KRETPROBES=y
|
||||
@ -350,7 +351,7 @@ CONFIG_BLK_DEV_BSG=y
|
||||
CONFIG_BLK_DEV_INTEGRITY=y
|
||||
# CONFIG_BLK_DEV_ZONED is not set
|
||||
CONFIG_BLK_DEV_THROTTLING=y
|
||||
# CONFIG_BLK_CMDLINE_PARSER is not set
|
||||
CONFIG_BLK_CMDLINE_PARSER=y
|
||||
# CONFIG_BLK_WBT is not set
|
||||
CONFIG_BLK_DEBUG_FS=y
|
||||
# CONFIG_BLK_SED_OPAL is not set
|
||||
@ -370,14 +371,15 @@ CONFIG_MSDOS_PARTITION=y
|
||||
# CONFIG_MINIX_SUBPARTITION is not set
|
||||
# CONFIG_SOLARIS_X86_PARTITION is not set
|
||||
# CONFIG_UNIXWARE_DISKLABEL is not set
|
||||
# CONFIG_LDM_PARTITION is not set
|
||||
CONFIG_LDM_PARTITION=y
|
||||
# CONFIG_LDM_DEBUG is not set
|
||||
# CONFIG_SGI_PARTITION is not set
|
||||
# CONFIG_ULTRIX_PARTITION is not set
|
||||
# CONFIG_SUN_PARTITION is not set
|
||||
# CONFIG_KARMA_PARTITION is not set
|
||||
CONFIG_EFI_PARTITION=y
|
||||
# CONFIG_SYSV68_PARTITION is not set
|
||||
# CONFIG_CMDLINE_PARTITION is not set
|
||||
CONFIG_CMDLINE_PARTITION=y
|
||||
CONFIG_BLOCK_COMPAT=y
|
||||
CONFIG_BLK_MQ_PCI=y
|
||||
CONFIG_BLK_MQ_VIRTIO=y
|
||||
@ -394,6 +396,7 @@ CONFIG_DEFAULT_DEADLINE=y
|
||||
# CONFIG_DEFAULT_NOOP is not set
|
||||
CONFIG_DEFAULT_IOSCHED="deadline"
|
||||
CONFIG_MQ_IOSCHED_DEADLINE=y
|
||||
CONFIG_PREEMPT_NOTIFIERS=y
|
||||
CONFIG_ASN1=y
|
||||
CONFIG_INLINE_SPIN_UNLOCK_IRQ=y
|
||||
CONFIG_INLINE_READ_UNLOCK=y
|
||||
@ -417,7 +420,7 @@ CONFIG_ZONE_DMA=y
|
||||
CONFIG_SMP=y
|
||||
CONFIG_X86_FEATURE_NAMES=y
|
||||
CONFIG_X86_FAST_FEATURE_TESTS=y
|
||||
# CONFIG_X86_X2APIC is not set
|
||||
CONFIG_X86_X2APIC=y
|
||||
CONFIG_X86_MPPARSE=y
|
||||
# CONFIG_GOLDFISH is not set
|
||||
# CONFIG_INTEL_RDT_A is not set
|
||||
@ -550,7 +553,7 @@ CONFIG_GENERIC_EARLY_IOREMAP=y
|
||||
CONFIG_ARCH_SUPPORTS_DEFERRED_STRUCT_PAGE_INIT=y
|
||||
# CONFIG_DEFERRED_STRUCT_PAGE_INIT is not set
|
||||
# CONFIG_IDLE_PAGE_TRACKING is not set
|
||||
# CONFIG_ZONE_DEVICE is not set
|
||||
CONFIG_ZONE_DEVICE=y
|
||||
CONFIG_ARCH_USES_HIGH_VMA_FLAGS=y
|
||||
CONFIG_ARCH_HAS_PKEYS=y
|
||||
# CONFIG_X86_PMEM_LEGACY is not set
|
||||
@ -568,7 +571,7 @@ CONFIG_X86_SMAP=y
|
||||
CONFIG_X86_INTEL_MEMORY_PROTECTION_KEYS=y
|
||||
CONFIG_EFI=y
|
||||
CONFIG_EFI_STUB=y
|
||||
# CONFIG_EFI_MIXED is not set
|
||||
CONFIG_EFI_MIXED=y
|
||||
CONFIG_SECCOMP=y
|
||||
CONFIG_HZ_100=y
|
||||
# CONFIG_HZ_250 is not set
|
||||
@ -648,7 +651,7 @@ CONFIG_ACPI_HED=y
|
||||
# CONFIG_ACPI_CUSTOM_METHOD is not set
|
||||
# CONFIG_ACPI_BGRT is not set
|
||||
# CONFIG_ACPI_REDUCED_HARDWARE_ONLY is not set
|
||||
# CONFIG_ACPI_NFIT is not set
|
||||
CONFIG_ACPI_NFIT=y
|
||||
CONFIG_HAVE_ACPI_APEI=y
|
||||
CONFIG_HAVE_ACPI_APEI_NMI=y
|
||||
CONFIG_ACPI_APEI=y
|
||||
@ -1443,7 +1446,10 @@ CONFIG_BLK_DEV_CRYPTOLOOP=y
|
||||
CONFIG_BLK_DEV_NBD=y
|
||||
# CONFIG_BLK_DEV_SKD is not set
|
||||
# CONFIG_BLK_DEV_SX8 is not set
|
||||
# CONFIG_BLK_DEV_RAM is not set
|
||||
CONFIG_BLK_DEV_RAM=y
|
||||
CONFIG_BLK_DEV_RAM_COUNT=16
|
||||
CONFIG_BLK_DEV_RAM_SIZE=65536
|
||||
CONFIG_BLK_DEV_RAM_DAX=y
|
||||
# CONFIG_CDROM_PKTCDVD is not set
|
||||
CONFIG_ATA_OVER_ETH=m
|
||||
CONFIG_XEN_BLKDEV_FRONTEND=y
|
||||
@ -1454,7 +1460,7 @@ CONFIG_VIRTIO_BLK=y
|
||||
# CONFIG_BLK_DEV_RSXX is not set
|
||||
CONFIG_NVME_CORE=y
|
||||
CONFIG_BLK_DEV_NVME=y
|
||||
# CONFIG_BLK_DEV_NVME_SCSI is not set
|
||||
CONFIG_BLK_DEV_NVME_SCSI=y
|
||||
# CONFIG_NVME_FC is not set
|
||||
|
||||
#
|
||||
@ -1827,11 +1833,13 @@ CONFIG_NET_VENDOR_AQUANTIA=y
|
||||
CONFIG_NET_VENDOR_BROADCOM=y
|
||||
# CONFIG_B44 is not set
|
||||
# CONFIG_BCMGENET is not set
|
||||
# CONFIG_BNX2 is not set
|
||||
# CONFIG_CNIC is not set
|
||||
CONFIG_BNX2=m
|
||||
CONFIG_CNIC=m
|
||||
CONFIG_TIGON3=m
|
||||
# CONFIG_BNX2X is not set
|
||||
# CONFIG_BNXT is not set
|
||||
CONFIG_BNX2X=m
|
||||
CONFIG_BNX2X_SRIOV=y
|
||||
CONFIG_BNXT=m
|
||||
CONFIG_BNXT_SRIOV=y
|
||||
# CONFIG_NET_VENDOR_BROCADE is not set
|
||||
# CONFIG_NET_VENDOR_CAVIUM is not set
|
||||
# CONFIG_NET_VENDOR_CHELSIO is not set
|
||||
@ -1856,16 +1864,18 @@ CONFIG_IXGB=m
|
||||
CONFIG_IXGBE=m
|
||||
CONFIG_IXGBE_HWMON=y
|
||||
CONFIG_IXGBEVF=m
|
||||
# CONFIG_I40E is not set
|
||||
# CONFIG_I40EVF is not set
|
||||
CONFIG_I40E=m
|
||||
CONFIG_I40EVF=m
|
||||
# CONFIG_FM10K is not set
|
||||
# CONFIG_NET_VENDOR_I825XX is not set
|
||||
# CONFIG_JME is not set
|
||||
# CONFIG_NET_VENDOR_MARVELL is not set
|
||||
CONFIG_NET_VENDOR_MELLANOX=y
|
||||
# CONFIG_MLX4_EN is not set
|
||||
# CONFIG_MLX4_CORE is not set
|
||||
# CONFIG_MLX5_CORE is not set
|
||||
CONFIG_MLX4_EN=m
|
||||
CONFIG_MLX4_CORE=m
|
||||
CONFIG_MLX4_DEBUG=y
|
||||
CONFIG_MLX5_CORE=m
|
||||
CONFIG_MLX5_CORE_EN=y
|
||||
# CONFIG_MLXSW_CORE is not set
|
||||
# CONFIG_NET_VENDOR_MICREL is not set
|
||||
# CONFIG_NET_VENDOR_MYRI is not set
|
||||
@ -2934,7 +2944,18 @@ CONFIG_RTC_DRV_CMOS=y
|
||||
#
|
||||
# CONFIG_SYNC_FILE is not set
|
||||
# CONFIG_AUXDISPLAY is not set
|
||||
# CONFIG_UIO is not set
|
||||
CONFIG_UIO=m
|
||||
# CONFIG_UIO_CIF is not set
|
||||
# CONFIG_UIO_PDRV_GENIRQ is not set
|
||||
# CONFIG_UIO_DMEM_GENIRQ is not set
|
||||
# CONFIG_UIO_AEC is not set
|
||||
# CONFIG_UIO_SERCOS3 is not set
|
||||
# CONFIG_UIO_PCI_GENERIC is not set
|
||||
# CONFIG_UIO_NETX is not set
|
||||
# CONFIG_UIO_PRUSS is not set
|
||||
# CONFIG_UIO_MF624 is not set
|
||||
# CONFIG_UIO_HV_GENERIC is not set
|
||||
CONFIG_IRQ_BYPASS_MANAGER=m
|
||||
# CONFIG_VIRT_DRIVERS is not set
|
||||
CONFIG_VIRTIO=y
|
||||
|
||||
@ -3127,9 +3148,19 @@ CONFIG_GENERIC_PHY=y
|
||||
# Android
|
||||
#
|
||||
# CONFIG_ANDROID is not set
|
||||
# CONFIG_LIBNVDIMM is not set
|
||||
# CONFIG_DEV_DAX is not set
|
||||
# CONFIG_NVMEM is not set
|
||||
CONFIG_LIBNVDIMM=y
|
||||
CONFIG_BLK_DEV_PMEM=y
|
||||
CONFIG_ND_BLK=y
|
||||
CONFIG_ND_CLAIM=y
|
||||
CONFIG_ND_BTT=y
|
||||
CONFIG_BTT=y
|
||||
CONFIG_ND_PFN=y
|
||||
CONFIG_NVDIMM_PFN=y
|
||||
CONFIG_NVDIMM_DAX=y
|
||||
CONFIG_DEV_DAX=y
|
||||
CONFIG_DEV_DAX_PMEM=y
|
||||
CONFIG_NR_DEV_DAX=32768
|
||||
CONFIG_NVMEM=y
|
||||
# CONFIG_STM is not set
|
||||
# CONFIG_INTEL_TH is not set
|
||||
|
||||
@ -3210,7 +3241,8 @@ CONFIG_BTRFS_FS_POSIX_ACL=y
|
||||
# CONFIG_BTRFS_ASSERT is not set
|
||||
# CONFIG_NILFS2_FS is not set
|
||||
# CONFIG_F2FS_FS is not set
|
||||
# CONFIG_FS_DAX is not set
|
||||
CONFIG_FS_DAX=y
|
||||
CONFIG_FS_DAX_PMD=y
|
||||
CONFIG_FS_POSIX_ACL=y
|
||||
CONFIG_EXPORTFS=y
|
||||
# CONFIG_EXPORTFS_BLOCK_OPS is not set
|
||||
@ -3287,7 +3319,7 @@ CONFIG_HUGETLBFS=y
|
||||
CONFIG_HUGETLB_PAGE=y
|
||||
CONFIG_ARCH_HAS_GIGANTIC_PAGE=y
|
||||
# CONFIG_CONFIGFS_FS is not set
|
||||
# CONFIG_EFIVAR_FS is not set
|
||||
CONFIG_EFIVAR_FS=y
|
||||
CONFIG_MISC_FILESYSTEMS=y
|
||||
# CONFIG_ORANGEFS_FS is not set
|
||||
# CONFIG_ADFS_FS is not set
|
||||
@ -3906,7 +3938,27 @@ CONFIG_PKCS7_MESSAGE_PARSER=y
|
||||
#
|
||||
# CONFIG_SYSTEM_TRUSTED_KEYRING is not set
|
||||
CONFIG_HAVE_KVM=y
|
||||
# CONFIG_VIRTUALIZATION is not set
|
||||
CONFIG_HAVE_KVM_IRQCHIP=y
|
||||
CONFIG_HAVE_KVM_IRQFD=y
|
||||
CONFIG_HAVE_KVM_IRQ_ROUTING=y
|
||||
CONFIG_HAVE_KVM_EVENTFD=y
|
||||
CONFIG_KVM_MMIO=y
|
||||
CONFIG_KVM_ASYNC_PF=y
|
||||
CONFIG_HAVE_KVM_MSI=y
|
||||
CONFIG_HAVE_KVM_CPU_RELAX_INTERCEPT=y
|
||||
CONFIG_KVM_VFIO=y
|
||||
CONFIG_KVM_GENERIC_DIRTYLOG_READ_PROTECT=y
|
||||
CONFIG_KVM_COMPAT=y
|
||||
CONFIG_HAVE_KVM_IRQ_BYPASS=y
|
||||
CONFIG_VIRTUALIZATION=y
|
||||
CONFIG_KVM=m
|
||||
CONFIG_KVM_INTEL=m
|
||||
CONFIG_KVM_AMD=m
|
||||
# CONFIG_KVM_MMU_AUDIT is not set
|
||||
CONFIG_VHOST_NET=m
|
||||
CONFIG_VHOST_VSOCK=m
|
||||
CONFIG_VHOST=m
|
||||
# CONFIG_VHOST_CROSS_ENDIAN_LEGACY is not set
|
||||
CONFIG_BINARY_PRINTF=y
|
||||
|
||||
#
|
||||
|
@ -253,6 +253,7 @@ CONFIG_UPROBES=y
|
||||
CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
|
||||
CONFIG_ARCH_USE_BUILTIN_BSWAP=y
|
||||
CONFIG_KRETPROBES=y
|
||||
CONFIG_USER_RETURN_NOTIFIER=y
|
||||
CONFIG_HAVE_IOREMAP_PROT=y
|
||||
CONFIG_HAVE_KPROBES=y
|
||||
CONFIG_HAVE_KRETPROBES=y
|
||||
@ -374,6 +375,7 @@ CONFIG_DEFAULT_DEADLINE=y
|
||||
# CONFIG_DEFAULT_CFQ is not set
|
||||
# CONFIG_DEFAULT_NOOP is not set
|
||||
CONFIG_DEFAULT_IOSCHED="deadline"
|
||||
CONFIG_PREEMPT_NOTIFIERS=y
|
||||
CONFIG_ASN1=y
|
||||
CONFIG_INLINE_SPIN_UNLOCK_IRQ=y
|
||||
CONFIG_INLINE_READ_UNLOCK=y
|
||||
@ -397,7 +399,7 @@ CONFIG_ZONE_DMA=y
|
||||
CONFIG_SMP=y
|
||||
CONFIG_X86_FEATURE_NAMES=y
|
||||
CONFIG_X86_FAST_FEATURE_TESTS=y
|
||||
# CONFIG_X86_X2APIC is not set
|
||||
CONFIG_X86_X2APIC=y
|
||||
CONFIG_X86_MPPARSE=y
|
||||
# CONFIG_GOLDFISH is not set
|
||||
# CONFIG_X86_EXTENDED_PLATFORM is not set
|
||||
@ -1777,11 +1779,13 @@ CONFIG_ENA_ETHERNET=m
|
||||
CONFIG_NET_VENDOR_BROADCOM=y
|
||||
# CONFIG_B44 is not set
|
||||
# CONFIG_BCMGENET is not set
|
||||
# CONFIG_BNX2 is not set
|
||||
# CONFIG_CNIC is not set
|
||||
CONFIG_BNX2=m
|
||||
CONFIG_CNIC=m
|
||||
CONFIG_TIGON3=m
|
||||
# CONFIG_BNX2X is not set
|
||||
# CONFIG_BNXT is not set
|
||||
CONFIG_BNX2X=m
|
||||
CONFIG_BNX2X_SRIOV=y
|
||||
CONFIG_BNXT=m
|
||||
CONFIG_BNXT_SRIOV=y
|
||||
# CONFIG_NET_VENDOR_BROCADE is not set
|
||||
# CONFIG_NET_VENDOR_CAVIUM is not set
|
||||
# CONFIG_NET_VENDOR_CHELSIO is not set
|
||||
@ -1806,16 +1810,18 @@ CONFIG_IXGB=m
|
||||
CONFIG_IXGBE=m
|
||||
CONFIG_IXGBE_HWMON=y
|
||||
CONFIG_IXGBEVF=m
|
||||
# CONFIG_I40E is not set
|
||||
# CONFIG_I40EVF is not set
|
||||
CONFIG_I40E=m
|
||||
CONFIG_I40EVF=m
|
||||
# CONFIG_FM10K is not set
|
||||
# CONFIG_NET_VENDOR_I825XX is not set
|
||||
# CONFIG_JME is not set
|
||||
# CONFIG_NET_VENDOR_MARVELL is not set
|
||||
CONFIG_NET_VENDOR_MELLANOX=y
|
||||
# CONFIG_MLX4_EN is not set
|
||||
# CONFIG_MLX4_CORE is not set
|
||||
# CONFIG_MLX5_CORE is not set
|
||||
CONFIG_MLX4_EN=m
|
||||
CONFIG_MLX4_CORE=m
|
||||
CONFIG_MLX4_DEBUG=y
|
||||
CONFIG_MLX5_CORE=m
|
||||
CONFIG_MLX5_CORE_EN=y
|
||||
# CONFIG_MLXSW_CORE is not set
|
||||
# CONFIG_NET_VENDOR_MICREL is not set
|
||||
# CONFIG_NET_VENDOR_MYRI is not set
|
||||
@ -2866,7 +2872,17 @@ CONFIG_RTC_DRV_CMOS=y
|
||||
#
|
||||
# CONFIG_SYNC_FILE is not set
|
||||
# CONFIG_AUXDISPLAY is not set
|
||||
# CONFIG_UIO is not set
|
||||
CONFIG_UIO=m
|
||||
# CONFIG_UIO_CIF is not set
|
||||
# CONFIG_UIO_PDRV_GENIRQ is not set
|
||||
# CONFIG_UIO_DMEM_GENIRQ is not set
|
||||
# CONFIG_UIO_AEC is not set
|
||||
# CONFIG_UIO_SERCOS3 is not set
|
||||
# CONFIG_UIO_PCI_GENERIC is not set
|
||||
# CONFIG_UIO_NETX is not set
|
||||
# CONFIG_UIO_PRUSS is not set
|
||||
# CONFIG_UIO_MF624 is not set
|
||||
CONFIG_IRQ_BYPASS_MANAGER=m
|
||||
# CONFIG_VIRT_DRIVERS is not set
|
||||
CONFIG_VIRTIO=y
|
||||
|
||||
@ -3184,7 +3200,7 @@ CONFIG_HUGETLBFS=y
|
||||
CONFIG_HUGETLB_PAGE=y
|
||||
CONFIG_ARCH_HAS_GIGANTIC_PAGE=y
|
||||
# CONFIG_CONFIGFS_FS is not set
|
||||
# CONFIG_EFIVAR_FS is not set
|
||||
CONFIG_EFIVAR_FS=y
|
||||
CONFIG_MISC_FILESYSTEMS=y
|
||||
# CONFIG_ORANGEFS_FS is not set
|
||||
# CONFIG_ADFS_FS is not set
|
||||
@ -3793,7 +3809,27 @@ CONFIG_PKCS7_MESSAGE_PARSER=y
|
||||
#
|
||||
# CONFIG_SYSTEM_TRUSTED_KEYRING is not set
|
||||
CONFIG_HAVE_KVM=y
|
||||
# CONFIG_VIRTUALIZATION is not set
|
||||
CONFIG_HAVE_KVM_IRQCHIP=y
|
||||
CONFIG_HAVE_KVM_IRQFD=y
|
||||
CONFIG_HAVE_KVM_IRQ_ROUTING=y
|
||||
CONFIG_HAVE_KVM_EVENTFD=y
|
||||
CONFIG_KVM_MMIO=y
|
||||
CONFIG_KVM_ASYNC_PF=y
|
||||
CONFIG_HAVE_KVM_MSI=y
|
||||
CONFIG_HAVE_KVM_CPU_RELAX_INTERCEPT=y
|
||||
CONFIG_KVM_VFIO=y
|
||||
CONFIG_KVM_GENERIC_DIRTYLOG_READ_PROTECT=y
|
||||
CONFIG_KVM_COMPAT=y
|
||||
CONFIG_HAVE_KVM_IRQ_BYPASS=y
|
||||
CONFIG_VIRTUALIZATION=y
|
||||
CONFIG_KVM=m
|
||||
CONFIG_KVM_INTEL=m
|
||||
CONFIG_KVM_AMD=m
|
||||
# CONFIG_KVM_MMU_AUDIT is not set
|
||||
CONFIG_VHOST_NET=m
|
||||
CONFIG_VHOST_VSOCK=m
|
||||
CONFIG_VHOST=m
|
||||
# CONFIG_VHOST_CROSS_ENDIAN_LEGACY is not set
|
||||
CONFIG_BINARY_PRINTF=y
|
||||
|
||||
#
|
||||
|
@ -1,7 +1,7 @@
|
||||
From 0000941078ee46f1f5338719c9c9d3f97f4e1d8b Mon Sep 17 00:00:00 2001
|
||||
From: Arnaldo Carvalho de Melo <acme@redhat.com>
|
||||
Date: Thu, 2 Mar 2017 12:55:49 -0300
|
||||
Subject: [PATCH 01/15] tools build: Add test for sched_getcpu()
|
||||
Subject: [PATCH 01/20] 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
|
||||
|
@ -1,7 +1,7 @@
|
||||
From 1d40c921ce389c72fed07ee180024e8a66f9c1d1 Mon Sep 17 00:00:00 2001
|
||||
From 74179b20aa60d2f7feb6556b121cff15dde79e9b Mon Sep 17 00:00:00 2001
|
||||
From: Dexuan Cui <decui@microsoft.com>
|
||||
Date: Fri, 5 May 2017 16:57:12 -0600
|
||||
Subject: [PATCH 03/15] vmbus: vmbus_open(): reset onchannel_callback on error
|
||||
Subject: [PATCH 02/20] 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 <decui@microsoft.com>
|
||||
Cc: K. Y. Srinivasan <kys@microsoft.com>
|
||||
Cc: Haiyang Zhang <haiyangz@microsoft.com>
|
||||
Cc: Stephen Hemminger <sthemmin@microsoft.com>
|
||||
Origin: https://github.com/dcui/linux/commits/decui/hv_sock/v4.11/20170511-debug-0605
|
||||
Origin: git@github.com:dcui/linux.git
|
||||
(cherry picked from commit c248b14174e1337c1461f9b13a573ad90a136e1c)
|
||||
---
|
||||
drivers/hv/channel.c | 2 ++
|
@ -1,7 +1,7 @@
|
||||
From 450289bfe78b23f55419274b0bf08221b4c918de Mon Sep 17 00:00:00 2001
|
||||
From 59bd8092e0637c1e47baeb8cac83d71ed3ee85fb Mon Sep 17 00:00:00 2001
|
||||
From: Dexuan Cui <decui@microsoft.com>
|
||||
Date: Fri, 5 May 2017 16:57:15 -0600
|
||||
Subject: [PATCH 04/15] vmbus: add the matching tasklet_enable() in
|
||||
Subject: [PATCH 03/20] 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 <decui@microsoft.com>
|
||||
Cc: K. Y. Srinivasan <kys@microsoft.com>
|
||||
Cc: Haiyang Zhang <haiyangz@microsoft.com>
|
||||
Cc: Stephen Hemminger <sthemmin@microsoft.com>
|
||||
Origin: https://github.com/dcui/linux/commits/decui/hv_sock/v4.11/20170511-debug-0605
|
||||
Origin: git@github.com:dcui/linux.git
|
||||
(cherry picked from commit 008d8d8bc0c86473a8549a365bee9a479243e412)
|
||||
---
|
||||
drivers/hv/channel.c | 1 +
|
@ -1,7 +1,7 @@
|
||||
From fa998da5f367c29df8a7590781a2a7bdc9217afe Mon Sep 17 00:00:00 2001
|
||||
From 5bddcbe8e03893267d2674da93894007f5be08b7 Mon Sep 17 00:00:00 2001
|
||||
From: Dexuan Cui <decui@microsoft.com>
|
||||
Date: Fri, 5 May 2017 16:57:20 -0600
|
||||
Subject: [PATCH 05/15] vmbus: remove "goto error_clean_msglist" in
|
||||
Subject: [PATCH 04/20] vmbus: remove "goto error_clean_msglist" in
|
||||
vmbus_open()
|
||||
|
||||
This is just a cleanup patch to simplify the code a little.
|
||||
@ -11,7 +11,7 @@ Signed-off-by: Dexuan Cui <decui@microsoft.com>
|
||||
Cc: K. Y. Srinivasan <kys@microsoft.com>
|
||||
Cc: Haiyang Zhang <haiyangz@microsoft.com>
|
||||
Cc: Stephen Hemminger <sthemmin@microsoft.com>
|
||||
Origin: https://github.com/dcui/linux/commits/decui/hv_sock/v4.11/20170511-debug-0605
|
||||
Origin: git@github.com:dcui/linux.git
|
||||
(cherry picked from commit 4713066c11b2396eafd2873cbed7bdd72d1571eb)
|
||||
---
|
||||
drivers/hv/channel.c | 18 +++++++-----------
|
@ -1,7 +1,7 @@
|
||||
From 18f2c9ce4120584b90e5f8d4c1011dbf8fe1c0ee Mon Sep 17 00:00:00 2001
|
||||
From ab979cc7a97f66073e8e57b42dfb4f87ec7cd0ea Mon Sep 17 00:00:00 2001
|
||||
From: Dexuan Cui <decui@microsoft.com>
|
||||
Date: Fri, 5 May 2017 16:57:23 -0600
|
||||
Subject: [PATCH 06/15] vmbus: dynamically enqueue/dequeue a channel on
|
||||
Subject: [PATCH 05/20] 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 <rolf.neugebauer@docker.com>
|
||||
Cc: K. Y. Srinivasan <kys@microsoft.com>
|
||||
Cc: Haiyang Zhang <haiyangz@microsoft.com>
|
||||
Cc: Stephen Hemminger <sthemmin@microsoft.com>
|
||||
Origin: https://github.com/dcui/linux/commits/decui/hv_sock/v4.11/20170511-debug-0605
|
||||
Origin: git@github.com:dcui/linux.git
|
||||
(cherry picked from commit 1df677b35ff010d0def33f5420773015815cf843)
|
||||
---
|
||||
drivers/hv/channel.c | 12 +++++++++---
|
||||
@ -171,7 +171,7 @@ index fbcb06352308..c5a01a4d589e 100644
|
||||
|
||||
err_free_chan:
|
||||
diff --git a/include/linux/hyperv.h b/include/linux/hyperv.h
|
||||
index 0c170a3f0d8b..ba93b7e4a972 100644
|
||||
index 970771a5f739..a8bae2caa69f 100644
|
||||
--- a/include/linux/hyperv.h
|
||||
+++ b/include/linux/hyperv.h
|
||||
@@ -1437,6 +1437,9 @@ extern bool vmbus_prep_negotiate_resp(struct icmsg_hdr *icmsghdrp, u8 *buf,
|
@ -1,7 +1,7 @@
|
||||
From b2c9515f6c1bdd968c1b0d7c9a285ece2bf7b343 Mon Sep 17 00:00:00 2001
|
||||
From 773676aed6e042b7f0296d0e11fe6b9b6d0cac9c Mon Sep 17 00:00:00 2001
|
||||
From: Dexuan Cui <decui@microsoft.com>
|
||||
Date: Fri, 5 May 2017 16:57:26 -0600
|
||||
Subject: [PATCH 07/15] hv_sock: implements Hyper-V transport for Virtual
|
||||
Subject: [PATCH 06/20] hv_sock: implements Hyper-V transport for Virtual
|
||||
Sockets (AF_VSOCK)
|
||||
|
||||
Hyper-V Sockets (hv_sock) supplies a byte-stream based communication
|
||||
@ -34,7 +34,7 @@ Cc: Stefan Hajnoczi <stefanha@redhat.com>
|
||||
Cc: Vitaly Kuznetsov <vkuznets@redhat.com>
|
||||
Cc: Cathy Avery <cavery@redhat.com>
|
||||
Cc: Rolf Neugebauer <rolf.neugebauer@docker.com>
|
||||
Origin: https://github.com/dcui/linux/commits/decui/hv_sock/v4.11/20170511-debug-0605
|
||||
Origin: git@github.com:dcui/linux.git
|
||||
(cherry picked from commit 3476be340d2ff777609fca3e763da0292acbfc45)
|
||||
---
|
||||
MAINTAINERS | 1 +
|
@ -1,7 +1,7 @@
|
||||
From daa0ed9004d76620cce3dde8cc2ae679d13aa326 Mon Sep 17 00:00:00 2001
|
||||
From a8e8b701064574c36ea5a130904ab59beb9e3ad7 Mon Sep 17 00:00:00 2001
|
||||
From: Dexuan Cui <decui@microsoft.com>
|
||||
Date: Fri, 5 May 2017 16:57:29 -0600
|
||||
Subject: [PATCH 08/15] VMCI: only try to load on VMware hypervisor
|
||||
Subject: [PATCH 07/20] 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 <jhansen@vmware.com>
|
||||
Cc: K. Y. Srinivasan <kys@microsoft.com>
|
||||
Cc: Haiyang Zhang <haiyangz@microsoft.com>
|
||||
Cc: Stephen Hemminger <sthemmin@microsoft.com>
|
||||
Origin: https://github.com/dcui/linux/commits/decui/hv_sock/v4.11/20170511-debug-0605
|
||||
Origin: git@github.com:dcui/linux.git
|
||||
(cherry picked from commit b5566b1b6e5cb19b381590587f841f950caabe4d)
|
||||
---
|
||||
drivers/misc/vmw_vmci/vmci_driver.c | 8 ++++++++
|
@ -1,7 +1,7 @@
|
||||
From 8c91f3d9e1ecdb49d3669deb951a47b0b186e4a2 Mon Sep 17 00:00:00 2001
|
||||
From 02541a42e2e39670e507d26735c887164cf5f897 Mon Sep 17 00:00:00 2001
|
||||
From: Dexuan Cui <decui@microsoft.com>
|
||||
Date: Fri, 5 May 2017 16:57:35 -0600
|
||||
Subject: [PATCH 09/15] hv_sock: add the support of auto-loading
|
||||
Subject: [PATCH 08/20] 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 <decui@microsoft.com>
|
||||
Cc: K. Y. Srinivasan <kys@microsoft.com>
|
||||
Cc: Haiyang Zhang <haiyangz@microsoft.com>
|
||||
Cc: Stephen Hemminger <sthemmin@microsoft.com>
|
||||
Origin: https://github.com/dcui/linux/commits/decui/hv_sock/v4.11/20170511-debug-0605
|
||||
Origin: git@github.com:dcui/linux.git
|
||||
(cherry picked from commit 6f1aa69011356ff95ed6c57400095e5f2d9eb900)
|
||||
---
|
||||
net/vmw_vsock/hyperv_transport.c | 1 +
|
@ -0,0 +1,430 @@
|
||||
From f64517f648f2017ebadf69cb96db8d7dd6d9659b Mon Sep 17 00:00:00 2001
|
||||
From: Dexuan Cui <decui@microsoft.com>
|
||||
Date: Fri, 5 May 2017 18:52:02 -0600
|
||||
Subject: [PATCH 09/20] tools: hv_sock: 2 simple test cases.
|
||||
|
||||
Please read this document first:
|
||||
https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/user-guide/make-integration-service
|
||||
|
||||
And you may want to have a look at
|
||||
https://github.com/dcui/linux/commit/691aff936c0fa6fc24e2662c0e8cc6ab65509600#diff-2cf9109d84c1ba75b09e40090f4a2176R100
|
||||
|
||||
Signed-off-by: Dexuan Cui <decui@microsoft.com>
|
||||
Origin: git@github.com:dcui/linux.git
|
||||
(cherry picked from commit 2fac74605d2db862caaaf4890239b57095fba832)
|
||||
---
|
||||
tools/hv/hv_sock/test-001/client_in_vm.c | 38 +++++++++
|
||||
tools/hv/hv_sock/test-001/server_on_host.c | 128 +++++++++++++++++++++++++++++
|
||||
tools/hv/hv_sock/test-002/client_on_host.c | 127 ++++++++++++++++++++++++++++
|
||||
tools/hv/hv_sock/test-002/server_in_vm.c | 85 +++++++++++++++++++
|
||||
4 files changed, 378 insertions(+)
|
||||
create mode 100644 tools/hv/hv_sock/test-001/client_in_vm.c
|
||||
create mode 100644 tools/hv/hv_sock/test-001/server_on_host.c
|
||||
create mode 100644 tools/hv/hv_sock/test-002/client_on_host.c
|
||||
create mode 100644 tools/hv/hv_sock/test-002/server_in_vm.c
|
||||
|
||||
diff --git a/tools/hv/hv_sock/test-001/client_in_vm.c b/tools/hv/hv_sock/test-001/client_in_vm.c
|
||||
new file mode 100644
|
||||
index 000000000000..2e2371b13fa7
|
||||
--- /dev/null
|
||||
+++ b/tools/hv/hv_sock/test-001/client_in_vm.c
|
||||
@@ -0,0 +1,38 @@
|
||||
+/* The program runs in Linux VM. */
|
||||
+
|
||||
+#include <stdio.h>
|
||||
+#include <unistd.h>
|
||||
+#include <sys/socket.h>
|
||||
+#include <linux/vm_sockets.h>
|
||||
+
|
||||
+int main()
|
||||
+{
|
||||
+ int fd;
|
||||
+
|
||||
+ struct sockaddr_vm sa = {
|
||||
+ .svm_family = AF_VSOCK,
|
||||
+ .svm_reserved1 = 0,
|
||||
+ .svm_cid = VMADDR_CID_ANY,
|
||||
+ };
|
||||
+
|
||||
+ /* Connecting to the host's 00000808-facb-11e6-bd58-64006a7986d3 */
|
||||
+ sa.svm_port = 0x808;
|
||||
+
|
||||
+ fd = socket(AF_VSOCK, SOCK_STREAM, 0);
|
||||
+ if (fd < 0) {
|
||||
+ perror("socket");
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ if (connect(fd, (struct sockaddr*)&sa, sizeof(sa)) != 0) {
|
||||
+ perror("connect");
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ printf("Connected to the host.\n");
|
||||
+
|
||||
+ close(fd);
|
||||
+ printf("Closed the connection.\n");
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
diff --git a/tools/hv/hv_sock/test-001/server_on_host.c b/tools/hv/hv_sock/test-001/server_on_host.c
|
||||
new file mode 100644
|
||||
index 000000000000..22c48e8d3789
|
||||
--- /dev/null
|
||||
+++ b/tools/hv/hv_sock/test-001/server_on_host.c
|
||||
@@ -0,0 +1,128 @@
|
||||
+/* The program runs on Windows 10 or Windows Server 2016 host or newer. */
|
||||
+
|
||||
+#include <stdio.h>
|
||||
+#include <stdint.h>
|
||||
+#include <winsock2.h>
|
||||
+#include <ws2def.h>
|
||||
+#include <initguid.h>
|
||||
+
|
||||
+#pragma comment(lib, "ws2_32.lib")
|
||||
+
|
||||
+#ifndef AF_HYPERV
|
||||
+#define AF_HYPERV 34
|
||||
+#define HV_PROTOCOL_RAW 1
|
||||
+
|
||||
+typedef struct _SOCKADDR_HV
|
||||
+{
|
||||
+ ADDRESS_FAMILY Family;
|
||||
+ USHORT Reserved;
|
||||
+ GUID VmId;
|
||||
+ GUID ServiceId;
|
||||
+} SOCKADDR_HV, *PSOCKADDR_HV;
|
||||
+
|
||||
+DEFINE_GUID(HV_GUID_SELF, 0x00000000, 0x0000, 0x0000,
|
||||
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
|
||||
+#endif /* AF_HYPERV */
|
||||
+
|
||||
+#define VMADDR_PORT_ANY 0xFFFFFFFF
|
||||
+
|
||||
+/* 00000000-facb-11e6-bd58-64006a7986d3 */
|
||||
+DEFINE_GUID(HVSOCK_LINUX_TEMPLATE, 0x00000000, 0xfacb, 0x11e6,
|
||||
+ 0xbd, 0x58, 0x64, 0x00, 0x6a, 0x79, 0x86, 0xd3);
|
||||
+
|
||||
+static const GUID VsockServiceIdTemplate = HVSOCK_LINUX_TEMPLATE;
|
||||
+
|
||||
+bool TryConvertVsockPortToServiceId(uint32_t port, GUID *serviceId)
|
||||
+{
|
||||
+ if (port == VMADDR_PORT_ANY)
|
||||
+ return false;
|
||||
+
|
||||
+ *serviceId = VsockServiceIdTemplate;
|
||||
+ serviceId->Data1 = port;
|
||||
+ return true;
|
||||
+}
|
||||
+
|
||||
+bool TryConvertServiceIdToVsockPort(const GUID *serviceId, uint32_t *port)
|
||||
+{
|
||||
+ if (memcmp(&serviceId->Data2, &VsockServiceIdTemplate.Data2,
|
||||
+ sizeof(GUID) - sizeof(uint32_t)) != 0 ||
|
||||
+ serviceId->Data1 == VMADDR_PORT_ANY) {
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ *port = serviceId->Data1;
|
||||
+ return true;
|
||||
+}
|
||||
+
|
||||
+int CreateListenSocket(uint32_t port, SOCKET *result_fd)
|
||||
+{
|
||||
+ SOCKADDR_HV localAddr;
|
||||
+ SOCKET fd;
|
||||
+ int ret;
|
||||
+
|
||||
+ fd = socket(AF_HYPERV, SOCK_STREAM, HV_PROTOCOL_RAW);
|
||||
+ if (fd == INVALID_SOCKET) {
|
||||
+ printf("socket() failed: error = %d\n", WSAGetLastError());
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ memset(&localAddr, 0, sizeof(SOCKADDR_HV));
|
||||
+ localAddr.Family = AF_HYPERV;
|
||||
+ localAddr.VmId = HV_GUID_SELF;
|
||||
+ TryConvertVsockPortToServiceId(port, &localAddr.ServiceId);
|
||||
+
|
||||
+ ret = bind(fd, (SOCKADDR *)&localAddr, sizeof(SOCKADDR_HV));
|
||||
+ if (ret == SOCKET_ERROR) {
|
||||
+ printf("bind() failed: error = %d\n", WSAGetLastError());
|
||||
+ goto err;
|
||||
+ }
|
||||
+
|
||||
+ ret = listen(fd, 10);
|
||||
+ if (ret == SOCKET_ERROR) {
|
||||
+ printf("listen() failed: error = %d\n", WSAGetLastError());
|
||||
+ goto err;
|
||||
+ }
|
||||
+
|
||||
+ *result_fd = fd;
|
||||
+ printf("Listening on fd = 0x%d, local port = 0x%x\n", fd, port);
|
||||
+ return 0;
|
||||
+err:
|
||||
+ closesocket(fd);
|
||||
+ return -1;
|
||||
+}
|
||||
+
|
||||
+int main()
|
||||
+{
|
||||
+ WSADATA wsaData;
|
||||
+ SOCKADDR_HV remoteAddr;
|
||||
+ int remoteAddrLen;
|
||||
+ SOCKET fd;
|
||||
+ SOCKET children[100];
|
||||
+ int i, ret;
|
||||
+
|
||||
+ // Initialize Winsock
|
||||
+ ret = WSAStartup(MAKEWORD(2, 2), &wsaData);
|
||||
+ if (ret != NO_ERROR) {
|
||||
+ printf("WSAStartup() failed with error: %d\n", ret);
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ // We'll listen on 00000808-facb-11e6-bd58-64006a7986d3
|
||||
+ if (CreateListenSocket(0x808, &fd) < 0) {
|
||||
+ printf("failed to listen!\n");
|
||||
+ ret = -1;
|
||||
+ goto out;
|
||||
+ }
|
||||
+
|
||||
+ for (i = 0; i < ARRAYSIZE(children); i++) {
|
||||
+ remoteAddrLen = sizeof(SOCKADDR_HV);
|
||||
+ children[i] = accept(fd, (sockaddr *)&remoteAddr, &remoteAddrLen);
|
||||
+ closesocket(children[i]);
|
||||
+ printf("Got a connection and closed it.\n");
|
||||
+ }
|
||||
+
|
||||
+ closesocket(fd);
|
||||
+out:
|
||||
+ WSACleanup();
|
||||
+ return ret;
|
||||
+}
|
||||
diff --git a/tools/hv/hv_sock/test-002/client_on_host.c b/tools/hv/hv_sock/test-002/client_on_host.c
|
||||
new file mode 100644
|
||||
index 000000000000..ed5ae99fbfba
|
||||
--- /dev/null
|
||||
+++ b/tools/hv/hv_sock/test-002/client_on_host.c
|
||||
@@ -0,0 +1,127 @@
|
||||
+/* The program runs on Windows 10 or Windows Server 2016 host or newer. */
|
||||
+
|
||||
+#include <stdio.h>
|
||||
+#include <stdint.h>
|
||||
+#include <winsock2.h>
|
||||
+#include <ws2def.h>
|
||||
+#include <initguid.h>
|
||||
+#include <rpc.h> /* for UuidFromStringA() */
|
||||
+#pragma comment(lib, "ws2_32.lib")
|
||||
+#pragma comment(lib, "rpcrt4.lib")
|
||||
+
|
||||
+#ifndef AF_HYPERV
|
||||
+#define AF_HYPERV 34
|
||||
+#define HV_PROTOCOL_RAW 1
|
||||
+
|
||||
+typedef struct _SOCKADDR_HV
|
||||
+{
|
||||
+ ADDRESS_FAMILY Family;
|
||||
+ USHORT Reserved;
|
||||
+ GUID VmId;
|
||||
+ GUID ServiceId;
|
||||
+}SOCKADDR_HV, *PSOCKADDR_HV;
|
||||
+
|
||||
+DEFINE_GUID(HV_GUID_SELF, 0x00000000, 0x0000, 0x0000,
|
||||
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
|
||||
+#endif /* AF_HYPERV */
|
||||
+
|
||||
+#define VMADDR_PORT_ANY 0xFFFFFFFF
|
||||
+
|
||||
+/* 00000000-facb-11e6-bd58-64006a7986d3 */
|
||||
+DEFINE_GUID(HVSOCK_LINUX_TEMPLATE, 0x00000000, 0xfacb, 0x11e6,
|
||||
+ 0xbd, 0x58, 0x64, 0x00, 0x6a, 0x79, 0x86, 0xd3);
|
||||
+
|
||||
+static const GUID VsockServiceIdTemplate = HVSOCK_LINUX_TEMPLATE;
|
||||
+
|
||||
+bool TryConvertVsockPortToServiceId(uint32_t port, GUID *serviceId)
|
||||
+{
|
||||
+ if (port == VMADDR_PORT_ANY)
|
||||
+ return false;
|
||||
+
|
||||
+ *serviceId = VsockServiceIdTemplate;
|
||||
+ serviceId->Data1 = port;
|
||||
+ return true;
|
||||
+}
|
||||
+
|
||||
+bool TryConvertServiceIdToVsockPort(const GUID *serviceId, uint32_t *port)
|
||||
+{
|
||||
+ if (memcmp(&serviceId->Data2, &VsockServiceIdTemplate.Data2,
|
||||
+ sizeof(GUID) - sizeof(uint32_t)) != 0 ||
|
||||
+ serviceId->Data1 == VMADDR_PORT_ANY) {
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ *port = serviceId->Data1;
|
||||
+ return true;
|
||||
+}
|
||||
+
|
||||
+int ConnectToVM(const SOCKADDR_HV *remoteAddr, SOCKET *result_fd)
|
||||
+{
|
||||
+ SOCKADDR_HV localAddr;
|
||||
+ SOCKET fd;
|
||||
+ uint32_t port;
|
||||
+ int ret;
|
||||
+
|
||||
+ fd = socket(AF_HYPERV, SOCK_STREAM, HV_PROTOCOL_RAW);
|
||||
+ if (fd == INVALID_SOCKET) {
|
||||
+ printf("socket() failed with error: %d\n", WSAGetLastError());
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ ret = connect(fd, (SOCKADDR *)remoteAddr, sizeof(SOCKADDR_HV));
|
||||
+ if (ret == SOCKET_ERROR) {
|
||||
+ printf("connect() failed: error = %d\n", WSAGetLastError());
|
||||
+ closesocket(fd);
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ *result_fd = fd;
|
||||
+ printf("Connected to the VM: fd = 0x%x\n", fd);
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+int main()
|
||||
+{
|
||||
+ const char *msg = "***Hello! This message is from the host!***\n";
|
||||
+ WSADATA wsaData;
|
||||
+ SOCKADDR_HV remoteAddr;
|
||||
+ SOCKET fd;
|
||||
+ int ret;
|
||||
+
|
||||
+ // Initialize Winsock
|
||||
+ ret = WSAStartup(MAKEWORD(2, 2), &wsaData);
|
||||
+ if (ret != NO_ERROR) {
|
||||
+ printf("WSAStartup() failed with error: %d\n", ret);
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ memset(&remoteAddr, 0, sizeof(SOCKADDR_HV));
|
||||
+ remoteAddr.Family = AF_HYPERV;
|
||||
+
|
||||
+ // The Linux VM is listening in Vsock port 0x2017
|
||||
+ TryConvertVsockPortToServiceId(0x2017, &remoteAddr.ServiceId);
|
||||
+
|
||||
+ // This is the "remote" VM's VMID got by the PowerShell command
|
||||
+ // "Get-VM -Name <the_VM_name> | ft id".
|
||||
+ //
|
||||
+ // Change it for your own VM.
|
||||
+ if (UuidFromStringA((RPC_CSTR)"c2624c46-1212-484a-8e28-83dd15fef815",
|
||||
+ &remoteAddr.VmId) != RPC_S_OK) {
|
||||
+ printf("Failed to parse the remote VMID: %d\n", GetLastError());
|
||||
+ ret = -1;
|
||||
+ goto out;
|
||||
+ }
|
||||
+
|
||||
+ if (ConnectToVM(&remoteAddr, &fd) < 0) {
|
||||
+ printf("Failed to connect to the VM!\n");
|
||||
+ ret = -1;
|
||||
+ goto out;
|
||||
+ }
|
||||
+ ret = send(fd, msg, strlen(msg), 0);
|
||||
+ printf("Sent a msg to the VM: msg_len = %d.\nExited.\n", ret);
|
||||
+
|
||||
+ closesocket(fd);
|
||||
+out:
|
||||
+ WSACleanup();
|
||||
+ return ret;
|
||||
+}
|
||||
diff --git a/tools/hv/hv_sock/test-002/server_in_vm.c b/tools/hv/hv_sock/test-002/server_in_vm.c
|
||||
new file mode 100644
|
||||
index 000000000000..fb4370c53152
|
||||
--- /dev/null
|
||||
+++ b/tools/hv/hv_sock/test-002/server_in_vm.c
|
||||
@@ -0,0 +1,85 @@
|
||||
+/* The program runs in Linux VM. */
|
||||
+
|
||||
+#include <stdio.h>
|
||||
+#include <string.h>
|
||||
+#include <stdlib.h>
|
||||
+#include <stdbool.h>
|
||||
+#include <unistd.h>
|
||||
+#include <fcntl.h>
|
||||
+#include <sys/types.h>
|
||||
+#include <sys/socket.h>
|
||||
+#include <sys/select.h>
|
||||
+#include <netdb.h>
|
||||
+#include <linux/vm_sockets.h>
|
||||
+
|
||||
+int main()
|
||||
+{
|
||||
+ uint32_t port = 0x2017;
|
||||
+
|
||||
+ int listen_fd;
|
||||
+ int client_fd;
|
||||
+
|
||||
+ struct sockaddr_vm sa_listen = {
|
||||
+ .svm_family = AF_VSOCK,
|
||||
+ .svm_reserved1 = 0,
|
||||
+ .svm_cid = VMADDR_CID_ANY,
|
||||
+ };
|
||||
+
|
||||
+ struct sockaddr_vm sa_client;
|
||||
+ socklen_t socklen_client;
|
||||
+
|
||||
+ char buf[4096];
|
||||
+ int len;
|
||||
+
|
||||
+ /* We'll listen on 00002017-facb-11e6-bd58-64006a7986d3 */
|
||||
+ sa_listen.svm_port = port;
|
||||
+
|
||||
+ listen_fd = socket(AF_VSOCK, SOCK_STREAM, 0);
|
||||
+ if (listen_fd < 0) {
|
||||
+ perror("socket()");
|
||||
+ exit(-1);
|
||||
+ }
|
||||
+
|
||||
+ if (bind(listen_fd, (struct sockaddr *)&sa_listen,
|
||||
+ sizeof(sa_listen)) != 0) {
|
||||
+ perror("bind()");
|
||||
+ goto err;
|
||||
+ }
|
||||
+
|
||||
+ if (listen(listen_fd, 10) != 0) {
|
||||
+ perror("listen()");
|
||||
+ goto err;
|
||||
+ }
|
||||
+
|
||||
+ printf("Listening on port 0x%x...\n", port);
|
||||
+
|
||||
+ socklen_client = sizeof(sa_client);
|
||||
+ client_fd = accept(listen_fd, (struct sockaddr*)&sa_client,
|
||||
+ &socklen_client);
|
||||
+ if (client_fd < 0) {
|
||||
+ perror("accept()");
|
||||
+ goto err;
|
||||
+ }
|
||||
+
|
||||
+ printf("Got a connection from the host: cid=0x%x, port=0x%x.\n",
|
||||
+ sa_client.svm_cid, sa_client.svm_port);
|
||||
+
|
||||
+ do {
|
||||
+ printf("Reading data from the connection...\n");
|
||||
+ len = read(client_fd, buf, sizeof(buf));
|
||||
+ if (len > 0) {
|
||||
+ printf("Read %d bytes:\n", len);
|
||||
+ fflush(stdout);
|
||||
+ write(STDOUT_FILENO, buf, len);
|
||||
+ }
|
||||
+ } while (len > 0);
|
||||
+
|
||||
+ printf("The other end closed the connection.\n");
|
||||
+
|
||||
+ close(client_fd);
|
||||
+ close(listen_fd);
|
||||
+ return 0;
|
||||
+err:
|
||||
+ close(listen_fd);
|
||||
+ return -1;
|
||||
+}
|
||||
--
|
||||
2.13.0
|
||||
|
@ -1,7 +1,7 @@
|
||||
From 19aba7e5812fdb16ccce5da10a8c40025db68cd1 Mon Sep 17 00:00:00 2001
|
||||
From 2aaa664f7216763e69f44ca30fbf0dba23b0bd89 Mon Sep 17 00:00:00 2001
|
||||
From: stephen hemminger <stephen@networkplumber.org>
|
||||
Date: Mon, 27 Feb 2017 10:26:48 -0800
|
||||
Subject: [PATCH 02/15] vmbus: introduce in-place packet iterator
|
||||
Subject: [PATCH 10/20] 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
|
||||
@ -9,7 +9,8 @@ to use for other drivers and NAPI.
|
||||
|
||||
Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
|
||||
Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
(cherry picked from commit f3dd3f4797652c311df9c074436d420f1ad3566e)
|
||||
Origin: git@github.com:dcui/linux.git
|
||||
(cherry picked from commit 2e307800c6a01cd789afe34eccbcabf384959b3f)
|
||||
---
|
||||
drivers/hv/ring_buffer.c | 94 +++++++++++++++++++++++++++++++++++++++++++-
|
||||
drivers/net/hyperv/netvsc.c | 34 +++++-----------
|
||||
@ -239,10 +240,10 @@ index 15ef713d96c0..ab9fe48ec133 100644
|
||||
}
|
||||
|
||||
diff --git a/include/linux/hyperv.h b/include/linux/hyperv.h
|
||||
index 970771a5f739..0c170a3f0d8b 100644
|
||||
index a8bae2caa69f..ba93b7e4a972 100644
|
||||
--- a/include/linux/hyperv.h
|
||||
+++ b/include/linux/hyperv.h
|
||||
@@ -1508,14 +1508,6 @@ static inline void hv_signal_on_read(struct vmbus_channel *channel)
|
||||
@@ -1511,14 +1511,6 @@ static inline void hv_signal_on_read(struct vmbus_channel *channel)
|
||||
return;
|
||||
}
|
||||
|
||||
@ -257,7 +258,7 @@ index 970771a5f739..0c170a3f0d8b 100644
|
||||
/*
|
||||
* Mask off host interrupt callback notifications
|
||||
*/
|
||||
@@ -1549,76 +1541,48 @@ static inline u32 hv_end_read(struct hv_ring_buffer_info *rbi)
|
||||
@@ -1552,76 +1544,48 @@ static inline u32 hv_end_read(struct hv_ring_buffer_info *rbi)
|
||||
/*
|
||||
* An API to support in-place processing of incoming VMBUS packets.
|
||||
*/
|
@ -1,7 +1,7 @@
|
||||
From 86991dc78e3b6fa4a4468553960e60e7059f1d61 Mon Sep 17 00:00:00 2001
|
||||
From 027de2c09c96f6cb0b2a7d7bfdcb3e4faf7e41f8 Mon Sep 17 00:00:00 2001
|
||||
From: Dexuan Cui <decui@microsoft.com>
|
||||
Date: Tue, 16 May 2017 22:14:03 +0800
|
||||
Subject: [PATCH 10/15] hvsock: fix a race in hvs_stream_dequeue()
|
||||
Subject: [PATCH 11/20] 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 <rolf.neugebauer@docker.com>
|
||||
Signed-off-by: Dexuan Cui <decui@microsoft.com>
|
||||
Origin: https://github.com/dcui/linux/commits/decui/hv_sock/v4.11/20170511-debug-0605
|
||||
Origin: git@github.com:dcui/linux.git
|
||||
(cherry picked from commit 83c8635b893bbc0b5b329c632cea0382d5479763)
|
||||
---
|
||||
net/vmw_vsock/hyperv_transport.c | 50 +++++++++++++++++++++++++++++-----------
|
@ -1,10 +1,11 @@
|
||||
From 2517cc6863d81f64da73fcc715458f5331a3eed0 Mon Sep 17 00:00:00 2001
|
||||
From ec13f59e3fcd78a31b8a377db813c750711c262c Mon Sep 17 00:00:00 2001
|
||||
From: Dexuan Cui <decui@microsoft.com>
|
||||
Date: Fri, 19 May 2017 21:49:59 +0800
|
||||
Subject: [PATCH 11/15] hvsock: fix vsock_dequeue/enqueue_accept race
|
||||
Subject: [PATCH 12/20] 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)
|
||||
Signed-off-by: Dexuan Cui <decui@microsoft.com>
|
||||
Origin: git@github.com:dcui/linux.git
|
||||
(cherry picked from commit a2c08e77b8ceb1f146cdc5136e85e7a4c2c9b7cb)
|
||||
---
|
||||
net/vmw_vsock/af_vsock.c | 7 +++++++
|
||||
1 file changed, 7 insertions(+)
|
@ -1,7 +1,7 @@
|
||||
From c10d941318f2fd808ff9316d0a8d676c99f6ba6b Mon Sep 17 00:00:00 2001
|
||||
From b0a431963f3fcd2742c2d12d670bbee5814b6ab6 Mon Sep 17 00:00:00 2001
|
||||
From: "K. Y. Srinivasan" <kys@microsoft.com>
|
||||
Date: Sun, 30 Apr 2017 16:21:18 -0700
|
||||
Subject: [PATCH 12/15] Drivers: hv: vmbus: Fix rescind handling
|
||||
Subject: [PATCH 13/20] Drivers: hv: vmbus: Fix rescind handling
|
||||
|
||||
Fix the rescind handling. This patch addresses the following rescind
|
||||
scenario that is currently not handled correctly:
|
||||
@ -16,8 +16,8 @@ Long Li <longli@microsoft.com> for working with me on this patch.
|
||||
|
||||
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
|
||||
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
||||
Origin: https://github.com/dcui/linux/commits/decui/hv_sock/v4.11/20170511-debug-0605
|
||||
(cherry picked from commit 6172aa1bbfb66a9e0b0da0f162f0e91c129e3c94)
|
||||
Origin: git@github.com:dcui/linux.git
|
||||
(cherry picked from commit be1ce15dfbdfe3f42c8ed23c5904674d5d90b545)
|
||||
---
|
||||
drivers/hv/channel.c | 8 ++++--
|
||||
drivers/hv/channel_mgmt.c | 69 ++++++++++++++++++++++++++++++++++++-----------
|
@ -1,11 +1,11 @@
|
||||
From 6f5032f60fbee1c947cf412599f9f07bd54bd1da Mon Sep 17 00:00:00 2001
|
||||
From 9425dfce5e61ecad4929ec71bae8848c078a6182 Mon Sep 17 00:00:00 2001
|
||||
From: Dexuan Cui <decui@microsoft.com>
|
||||
Date: Mon, 5 Jun 2017 16:13:18 +0800
|
||||
Subject: [PATCH 13/15] vmbus: fix hv_percpu_channel_deq/enq race
|
||||
Subject: [PATCH 14/20] vmbus: fix hv_percpu_channel_deq/enq race
|
||||
|
||||
Signed-off-by: Dexuan Cui <decui@microsoft.com>
|
||||
Origin: https://github.com/dcui/linux/commits/decui/hv_sock/v4.11/20170511-debug-0605
|
||||
(cherry picked from commit 24ff598cdf98290b25805219eff78336bc08e5ab)
|
||||
Origin: git@github.com:dcui/linux.git
|
||||
(cherry picked from commit 8457502df9dd379ddbdfa42a8c9a6421bb3482f1)
|
||||
---
|
||||
drivers/hv/channel_mgmt.c | 32 +++++++++++++++++++++----
|
||||
drivers/hv/connection.c | 11 +++++++++
|
@ -1,11 +1,11 @@
|
||||
From c2369f25d343852682b888928b560c40942398ae Mon Sep 17 00:00:00 2001
|
||||
From 21d1da652810bdc3dd1c0ce62fbf3cb9bc6313b4 Mon Sep 17 00:00:00 2001
|
||||
From: Dexuan Cui <decui@microsoft.com>
|
||||
Date: Mon, 5 Jun 2017 21:32:00 +0800
|
||||
Subject: [PATCH 14/15] vmbus: add vmbus onoffer/onoffer_rescind sync.
|
||||
Subject: [PATCH 15/20] vmbus: add vmbus onoffer/onoffer_rescind sync.
|
||||
|
||||
Signed-off-by: Dexuan Cui <decui@microsoft.com>
|
||||
Origin: https://github.com/dcui/linux/commits/decui/hv_sock/v4.11/20170511-debug-0605
|
||||
(cherry picked from commit 9a00fd7c4ad9c5d1da39c3c44328145fe063ceed)
|
||||
Origin: git@github.com:dcui/linux.git
|
||||
(cherry picked from commit 1b91aa6d0e745d9765e3d90058928829f0b0bd40)
|
||||
---
|
||||
drivers/hv/channel_mgmt.c | 25 +++++++++++++++++++------
|
||||
drivers/hv/hyperv_vmbus.h | 1 +
|
@ -0,0 +1,133 @@
|
||||
From 042b1631de7a37dc79ca73ac9cee340fb0d72475 Mon Sep 17 00:00:00 2001
|
||||
From: Dexuan Cui <decui@microsoft.com>
|
||||
Date: Wed, 21 Jun 2017 22:30:42 +0800
|
||||
Subject: [PATCH 16/20] hv-sock: a temporary workaround for the
|
||||
pending_send_size issue
|
||||
|
||||
While I'm trying to find out the root cause, I believe this can work
|
||||
as a good temporary workround for internal uses...
|
||||
|
||||
Signed-off-by: Dexuan Cui <decui@microsoft.com>
|
||||
Origin: git@github.com:dcui/linux.git
|
||||
(cherry picked from commit 531389d1dc73e2be3ee5dbf2091b6f5e74d9764c)
|
||||
---
|
||||
net/vmw_vsock/af_vsock.c | 7 +++++--
|
||||
net/vmw_vsock/hyperv_transport.c | 30 ++++++++++++++++++++++++------
|
||||
2 files changed, 29 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/net/vmw_vsock/af_vsock.c b/net/vmw_vsock/af_vsock.c
|
||||
index 717db396f59e..7a3fd62ae7c4 100644
|
||||
--- a/net/vmw_vsock/af_vsock.c
|
||||
+++ b/net/vmw_vsock/af_vsock.c
|
||||
@@ -1544,7 +1544,7 @@ static int vsock_stream_sendmsg(struct socket *sock, struct msghdr *msg,
|
||||
struct sock *sk;
|
||||
struct vsock_sock *vsk;
|
||||
ssize_t total_written;
|
||||
- long timeout;
|
||||
+ long timeout, timeout_once;
|
||||
int err;
|
||||
struct vsock_transport_send_notify_data send_data;
|
||||
|
||||
@@ -1615,7 +1615,7 @@ static int vsock_stream_sendmsg(struct socket *sock, struct msghdr *msg,
|
||||
}
|
||||
|
||||
release_sock(sk);
|
||||
- timeout = schedule_timeout(timeout);
|
||||
+ timeout_once = schedule_timeout(1);
|
||||
lock_sock(sk);
|
||||
if (signal_pending(current)) {
|
||||
err = sock_intr_errno(timeout);
|
||||
@@ -1625,6 +1625,9 @@ static int vsock_stream_sendmsg(struct socket *sock, struct msghdr *msg,
|
||||
err = -EAGAIN;
|
||||
finish_wait(sk_sleep(sk), &wait);
|
||||
goto out_err;
|
||||
+ } else {
|
||||
+ if (timeout_once == 0)
|
||||
+ timeout--;
|
||||
}
|
||||
|
||||
prepare_to_wait(sk_sleep(sk), &wait,
|
||||
diff --git a/net/vmw_vsock/hyperv_transport.c b/net/vmw_vsock/hyperv_transport.c
|
||||
index 30154836acd0..b8bf1446ae13 100644
|
||||
--- a/net/vmw_vsock/hyperv_transport.c
|
||||
+++ b/net/vmw_vsock/hyperv_transport.c
|
||||
@@ -268,7 +268,7 @@ static void hvs_channel_cb(void *ctx)
|
||||
sk->sk_data_ready(sk);
|
||||
|
||||
/* Mark it writable only if there is enough space */
|
||||
- if (hvs_channel_writable_bytes(chan) >= HVS_SEND_BUF_SIZE)
|
||||
+ if (hv_get_bytes_to_write(&chan->outbound) > 0)
|
||||
sk->sk_write_space(sk);
|
||||
}
|
||||
|
||||
@@ -350,9 +350,11 @@ static void hvs_open_connection(struct vmbus_channel *chan)
|
||||
set_per_channel_state(chan, conn_from_host ? new : sk);
|
||||
vmbus_set_chn_rescind_callback(chan, hvs_close_connection);
|
||||
|
||||
+#if 0
|
||||
/* See hvs_channel_cb() and hvs_notify_poll_out() */
|
||||
set_channel_pending_send_size(chan,
|
||||
HVS_PKT_LEN(HVS_SEND_BUF_SIZE) + 1);
|
||||
+#endif
|
||||
|
||||
if (conn_from_host) {
|
||||
new->sk_state = SS_CONNECTED;
|
||||
@@ -542,7 +544,7 @@ static ssize_t hvs_stream_enqueue(struct vsock_sock *vsk, struct msghdr *msg,
|
||||
struct hvsock *hvs = vsk->trans;
|
||||
struct vmbus_channel *chan = hvs->chan;
|
||||
struct hvs_send_buf *send_buf;
|
||||
- size_t to_write, max_writable, ret;
|
||||
+ ssize_t to_write, max_writable, ret;
|
||||
|
||||
BUILD_BUG_ON(sizeof(*send_buf) != PAGE_SIZE_4K);
|
||||
|
||||
@@ -551,8 +553,8 @@ static ssize_t hvs_stream_enqueue(struct vsock_sock *vsk, struct msghdr *msg,
|
||||
return -ENOMEM;
|
||||
|
||||
max_writable = hvs_channel_writable_bytes(chan);
|
||||
- to_write = min_t(size_t, len, max_writable);
|
||||
- to_write = min_t(size_t, to_write, HVS_SEND_BUF_SIZE);
|
||||
+ to_write = min_t(ssize_t, len, max_writable);
|
||||
+ to_write = min_t(ssize_t, to_write, HVS_SEND_BUF_SIZE);
|
||||
|
||||
ret = memcpy_from_msg(send_buf->data, msg, to_write);
|
||||
if (ret < 0)
|
||||
@@ -595,8 +597,22 @@ static s64 hvs_stream_has_data(struct vsock_sock *vsk)
|
||||
static s64 hvs_stream_has_space(struct vsock_sock *vsk)
|
||||
{
|
||||
struct hvsock *hvs = vsk->trans;
|
||||
+ s64 ret;
|
||||
|
||||
- return hvs_channel_writable_bytes(hvs->chan);
|
||||
+ ret = hvs_channel_writable_bytes(hvs->chan);
|
||||
+ if (ret > 0) {
|
||||
+ set_channel_pending_send_size(hvs->chan, 0);
|
||||
+ } else {
|
||||
+ /* See hvs_channel_cb() and hvs_notify_poll_out() */
|
||||
+ set_channel_pending_send_size(hvs->chan,
|
||||
+ HVS_PKT_LEN(HVS_SEND_BUF_SIZE) + 1);
|
||||
+
|
||||
+ ret = hvs_channel_writable_bytes(hvs->chan);
|
||||
+ if (ret > 0)
|
||||
+ set_channel_pending_send_size(hvs->chan, 0);
|
||||
+ }
|
||||
+
|
||||
+ return ret;
|
||||
}
|
||||
|
||||
static u64 hvs_stream_rcvhiwat(struct vsock_sock *vsk)
|
||||
@@ -646,8 +662,10 @@ int hvs_notify_poll_in(struct vsock_sock *vsk, size_t target, bool *readable)
|
||||
static
|
||||
int hvs_notify_poll_out(struct vsock_sock *vsk, size_t target, bool *writable)
|
||||
{
|
||||
+ struct hvsock *hvs = vsk->trans;
|
||||
+
|
||||
/* Report writable only if there is enough space */
|
||||
- *writable = hvs_stream_has_space(vsk) >= HVS_SEND_BUF_SIZE;
|
||||
+ *writable = hvs_channel_writable_bytes(hvs->chan) > 0;
|
||||
|
||||
return 0;
|
||||
}
|
||||
--
|
||||
2.13.0
|
||||
|
@ -1,7 +1,7 @@
|
||||
From 578f66359c91feb68ba6874522a5b9b357b61e17 Mon Sep 17 00:00:00 2001
|
||||
From c9a2d11140ca97958406c9a3fc8d0590a16f0f13 Mon Sep 17 00:00:00 2001
|
||||
From: Dexuan Cui <decui@microsoft.com>
|
||||
Date: Thu, 6 Jul 2017 21:37:11 +0000
|
||||
Subject: [PATCH 15/15] vmbus: fix the missed signaling in hv_signal_on_read()
|
||||
Date: Wed, 28 Jun 2017 23:50:38 +0800
|
||||
Subject: [PATCH 17/20] vmbus: fix the missed signaling in hv_signal_on_read()
|
||||
|
||||
There is an off-by-one bug here, which can cause host-to-guest write to stall.
|
||||
|
||||
@ -10,16 +10,10 @@ meaningless: the ring mustn't be 100% full.
|
||||
|
||||
But when cached_write_sz == pending_sz, we must signal the host.
|
||||
|
||||
Fixes: 433e19cf33d3 ("Drivers: hv: vmbus: finally fix
|
||||
hv_need_to_signal_on_read()")
|
||||
|
||||
Signed-off-by: John Starks <John.Starks@microsoft.com>
|
||||
Signed-off-by: Dexuan Cui <decui@microsoft.com>
|
||||
Cc: Haiyang Zhang <haiyangz@microsoft.com>
|
||||
Cc: Stephen Hemminger <sthemmin@microsoft.com>
|
||||
Cc: "K. Y. Srinivasan" <kys@microsoft.com>
|
||||
Cc: <stable@vger.kernel.org>
|
||||
Origin: https://patchwork.kernel.org/patch/9829039/
|
||||
Origin: git@github.com:dcui/linux.git
|
||||
(cherry picked from commit c49aced6328557e6c1f5cf6f58e1fae96fb58fa0)
|
||||
---
|
||||
include/linux/hyperv.h | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
@ -0,0 +1,41 @@
|
||||
From 50733c200b645e604fc5e0e41be818250dc0bf50 Mon Sep 17 00:00:00 2001
|
||||
From: Dexuan Cui <decui@microsoft.com>
|
||||
Date: Fri, 7 Jul 2017 09:15:29 +0800
|
||||
Subject: [PATCH 18/20] hv-sock: avoid double FINs if shutdown() is called
|
||||
|
||||
The host expects a single FIN.
|
||||
|
||||
Signed-off-by: Dexuan Cui <decui@microsoft.com>
|
||||
Origin: git@github.com:dcui/linux.git
|
||||
(cherry picked from commit 651dae7de6c6f066c08845ec7335bfb231d5eabe)
|
||||
---
|
||||
net/vmw_vsock/hyperv_transport.c | 6 ++++++
|
||||
1 file changed, 6 insertions(+)
|
||||
|
||||
diff --git a/net/vmw_vsock/hyperv_transport.c b/net/vmw_vsock/hyperv_transport.c
|
||||
index b8bf1446ae13..50e4bc822c69 100644
|
||||
--- a/net/vmw_vsock/hyperv_transport.c
|
||||
+++ b/net/vmw_vsock/hyperv_transport.c
|
||||
@@ -95,6 +95,9 @@ struct hvsock {
|
||||
u32 recv_data_len;
|
||||
/* The offset of the payload */
|
||||
u32 recv_data_off;
|
||||
+
|
||||
+ /* Have we sent the zero-length packet (FIN)? */
|
||||
+ unsigned long fin_sent;
|
||||
};
|
||||
|
||||
/* In the VM, we support Hyper-V Sockets with AF_VSOCK, and the endpoint is
|
||||
@@ -425,6 +428,9 @@ static int hvs_shutdown(struct vsock_sock *vsk, int mode)
|
||||
|
||||
hvs = vsk->trans;
|
||||
|
||||
+ if (test_and_set_bit(0, &hvs->fin_sent))
|
||||
+ return 0;
|
||||
+
|
||||
send_buf = (struct hvs_send_buf *)&hdr;
|
||||
|
||||
/* It can't fail: see hvs_channel_writable_bytes(). */
|
||||
--
|
||||
2.13.0
|
||||
|
@ -0,0 +1,151 @@
|
||||
From fe302afb2256b498f781741859cd3cda7f7fa7b3 Mon Sep 17 00:00:00 2001
|
||||
From: Cheng-mean Liu <soccerl@microsoft.com>
|
||||
Date: Tue, 11 Jul 2017 16:50:36 -0700
|
||||
Subject: [PATCH 19/20] Added vsock transport support to 9pfs
|
||||
|
||||
Signed-off-by: Cheng-mean Liu <soccerl@microsoft.com>
|
||||
Origin: https://github.com/Microsoft/opengcs/blob/master/kernelconfig/4.11/patch_9pfs_vsock-transport.patch
|
||||
---
|
||||
net/9p/trans_fd.c | 85 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-
|
||||
1 file changed, 84 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/net/9p/trans_fd.c b/net/9p/trans_fd.c
|
||||
index 7bc2208b6cc4..dc34352145df 100644
|
||||
--- a/net/9p/trans_fd.c
|
||||
+++ b/net/9p/trans_fd.c
|
||||
@@ -44,8 +44,9 @@
|
||||
#include <net/9p/9p.h>
|
||||
#include <net/9p/client.h>
|
||||
#include <net/9p/transport.h>
|
||||
-
|
||||
#include <linux/syscalls.h> /* killme */
|
||||
+//#include <linux/kgdb.h>
|
||||
+#include <linux/vm_sockets.h>
|
||||
|
||||
#define P9_PORT 564
|
||||
#define MAX_SOCK_BUF (64*1024)
|
||||
@@ -155,6 +156,7 @@ struct p9_trans_fd {
|
||||
struct p9_conn conn;
|
||||
};
|
||||
|
||||
+
|
||||
static void p9_poll_workfn(struct work_struct *work);
|
||||
|
||||
static DEFINE_SPINLOCK(p9_poll_lock);
|
||||
@@ -740,6 +742,7 @@ static int parse_opts(char *params, struct p9_fd_opts *opts)
|
||||
opts->wfd = ~0;
|
||||
opts->privport = 0;
|
||||
|
||||
+
|
||||
if (!params)
|
||||
return 0;
|
||||
|
||||
@@ -1035,6 +1038,72 @@ p9_fd_create(struct p9_client *client, const char *addr, char *args)
|
||||
return 0;
|
||||
}
|
||||
|
||||
+static int
|
||||
+p9_fd_create_vsock(struct p9_client *client, const char *addr, char *args)
|
||||
+{
|
||||
+ int err;
|
||||
+ struct socket *csocket;
|
||||
+ struct sockaddr_vm server_socket_addr;
|
||||
+ struct p9_fd_opts opts;
|
||||
+
|
||||
+ err = parse_opts(args, &opts);
|
||||
+ if (err < 0)
|
||||
+ return err;
|
||||
+
|
||||
+ csocket = NULL;
|
||||
+
|
||||
+ // for debugging purpose only
|
||||
+ pr_err("%s:%s\n", __func__, addr);
|
||||
+ // kgdb_breakpoint();
|
||||
+
|
||||
+ // create socket
|
||||
+ err = __sock_create(current->nsproxy->net_ns,
|
||||
+ AF_VSOCK,
|
||||
+ SOCK_STREAM,
|
||||
+ 0,
|
||||
+ &csocket, 1);
|
||||
+ if (err) {
|
||||
+ pr_err("%s:__sock_create (%d): problem creating socket (err=%d)\n",
|
||||
+ __func__, task_pid_nr(current), err);
|
||||
+ return err;
|
||||
+ }
|
||||
+
|
||||
+ // server socket address information
|
||||
+ memset((char *)&server_socket_addr, 0, sizeof(struct sockaddr_vm));
|
||||
+ server_socket_addr.svm_family = AF_VSOCK;
|
||||
+ server_socket_addr.svm_reserved1 = 0;
|
||||
+ server_socket_addr.svm_cid = VMADDR_CID_HOST;
|
||||
+
|
||||
+ /* Connecting to the host's 0000pppp-facb-11e6-bd58-64006a7986d3 */
|
||||
+ server_socket_addr.svm_port = opts.port;
|
||||
+
|
||||
+ pr_err("%s:opts.port=(%d)(0x%x)\n", __func__, opts.port, opts.port);
|
||||
+ pr_err("%s: service_id:(hex) 0000%x%x-facb-11e6-bd58-64006a7986d3\n",
|
||||
+ __func__,
|
||||
+ (__u8)((opts.port & 0xff00) >> 8),
|
||||
+ (__u8)(opts.port & 0x00ff));
|
||||
+
|
||||
+ pr_err("%s: connecting", __func__);
|
||||
+ err = csocket->ops->connect(csocket,
|
||||
+ (struct sockaddr *)&server_socket_addr,
|
||||
+ sizeof(struct sockaddr_vm), 0);
|
||||
+ if (err < 0) {
|
||||
+ pr_err("%s:connect (%d): problem connecting socket to %s (err = %d)\n",
|
||||
+ __func__, task_pid_nr(current), addr, err);
|
||||
+ sock_release(csocket);
|
||||
+ return err;
|
||||
+ }
|
||||
+
|
||||
+ pr_err("%s: open socket", __func__);
|
||||
+ err = p9_socket_open(client, csocket);
|
||||
+ if (err < 0) {
|
||||
+ pr_err("%s: p9_socket_open failed\n", __func__);
|
||||
+ }
|
||||
+
|
||||
+ pr_err("Leaving %s\n", __func__);
|
||||
+ return err;
|
||||
+}
|
||||
+
|
||||
static struct p9_trans_module p9_tcp_trans = {
|
||||
.name = "tcp",
|
||||
.maxsize = MAX_SOCK_BUF,
|
||||
@@ -1071,6 +1140,18 @@ static struct p9_trans_module p9_fd_trans = {
|
||||
.owner = THIS_MODULE,
|
||||
};
|
||||
|
||||
+static struct p9_trans_module p9_vsock_trans = {
|
||||
+ .name = "vsock",
|
||||
+ .maxsize = MAX_SOCK_BUF,
|
||||
+ .def = 0,
|
||||
+ .create = p9_fd_create_vsock,
|
||||
+ .close = p9_fd_close,
|
||||
+ .request = p9_fd_request,
|
||||
+ .cancel = p9_fd_cancel,
|
||||
+ .cancelled = p9_fd_cancelled,
|
||||
+ .owner = THIS_MODULE,
|
||||
+};
|
||||
+
|
||||
/**
|
||||
* p9_poll_proc - poll worker thread
|
||||
* @a: thread state and arguments
|
||||
@@ -1108,6 +1189,7 @@ int p9_trans_fd_init(void)
|
||||
v9fs_register_trans(&p9_tcp_trans);
|
||||
v9fs_register_trans(&p9_unix_trans);
|
||||
v9fs_register_trans(&p9_fd_trans);
|
||||
+ v9fs_register_trans(&p9_vsock_trans);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -1118,4 +1200,5 @@ void p9_trans_fd_exit(void)
|
||||
v9fs_unregister_trans(&p9_tcp_trans);
|
||||
v9fs_unregister_trans(&p9_unix_trans);
|
||||
v9fs_unregister_trans(&p9_fd_trans);
|
||||
+ v9fs_unregister_trans(&p9_vsock_trans);
|
||||
}
|
||||
--
|
||||
2.13.0
|
||||
|
@ -0,0 +1,28 @@
|
||||
From 40f1e3dc27695385f68025e74cf103c6a1ce1a62 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 20/20] NVDIMM: reducded ND_MIN_NAMESPACE_SIZE from 4MB to 4KB
|
||||
(page size)
|
||||
|
||||
Signed-off-by: Cheng-mean Liu <soccerl@microsoft.com>
|
||||
Origin: https://github.com/Microsoft/opengcs/blob/master/kernelconfig/4.11/patch_lower-the-minimum-PMEM-size.patch
|
||||
---
|
||||
include/uapi/linux/ndctl.h | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/include/uapi/linux/ndctl.h b/include/uapi/linux/ndctl.h
|
||||
index ede5c6a62164..47760821c5b5 100644
|
||||
--- a/include/uapi/linux/ndctl.h
|
||||
+++ b/include/uapi/linux/ndctl.h
|
||||
@@ -259,7 +259,7 @@ enum nd_driver_flags {
|
||||
};
|
||||
|
||||
enum {
|
||||
- ND_MIN_NAMESPACE_SIZE = 0x00400000,
|
||||
+ ND_MIN_NAMESPACE_SIZE = 0x00001000,
|
||||
};
|
||||
|
||||
enum ars_masks {
|
||||
--
|
||||
2.13.0
|
||||
|
Loading…
Reference in New Issue
Block a user