Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1267566 > unrolled thread

[PATCH V2 00/12] Drivers: hv: vmbus: Miscellaneous fixes and cleanup

Started by"K. Y. Srinivasan" <kys@microsoft.com>
First post2015-11-12 02:00 +0100
Last post2015-11-12 02:00 +0100
Articles 6 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH V2 00/12] Drivers: hv: vmbus: Miscellaneous fixes and cleanup  "K. Y. Srinivasan" <kys@microsoft.com> - 2015-11-12 02:00 +0100
    [PATCH V2 01/12] Drivers: hv: vss: run only on supported host versions "K. Y. Srinivasan" <kys@microsoft.com> - 2015-11-12 02:00 +0100
      [PATCH V2 03/12] Drivers: hv: vmbus: Use uuid_le_cmp() for comparing GUIDs "K. Y. Srinivasan" <kys@microsoft.com> - 2015-11-12 02:00 +0100
      [PATCH V2 10/12] Drivers: hv: vmbus: channge vmbus_connection.channel_lock to mutex "K. Y. Srinivasan" <kys@microsoft.com> - 2015-11-12 02:00 +0100
        Re: [PATCH V2 10/12] Drivers: hv: vmbus: channge vmbus_connection.channel_lock to mutex Vitaly Kuznetsov <vkuznets@redhat.com> - 2015-11-12 11:50 +0100
      [PATCH 12/12] tools/hv: Use include/uapi with __EXPORTED_HEADERS__ "K. Y. Srinivasan" <kys@microsoft.com> - 2015-11-12 02:00 +0100

#1267566 — [PATCH V2 00/12] Drivers: hv: vmbus: Miscellaneous fixes and cleanup

From"K. Y. Srinivasan" <kys@microsoft.com>
Date2015-11-12 02:00 +0100
Subject[PATCH V2 00/12] Drivers: hv: vmbus: Miscellaneous fixes and cleanup
Message-ID<qtOp3-1Nx-5@gated-at.bofh.it>
Miscellaneous fixes and cleanup.
Changes from V1: 
Fixed the typo in patch number 3.
Included the patch tools/hv: Use include/uapi with __EXPORTED_HEADERS__

Dexuan Cui (5):
  Drivers: hv: vmbus: serialize process_chn_event() and
    vmbus_close_internal()
  Drivers: hv: vmbus: do sanity check of channel state in
    vmbus_close_internal()
  Drivers: hv: vmbus: fix rescind-offer handling for device without a
    driver
  Drivers: hv: vmbus: release relid on error in vmbus_process_offer()
  Drivers: hv: vmbus: channge vmbus_connection.channel_lock to mutex

Jake Oshins (1):
  drivers:hv: Allow for MMIO claims that span ACPI _CRS records

K. Y. Srinivasan (4):
  Drivers: hv: vmbus: Use uuid_le type consistently
  Drivers: hv: vmbus: Use uuid_le_cmp() for comparing GUIDs
  Drivers: hv: vmbus: Get rid of the unused macro
  Drivers: hv: vmbus: Get rid of the unused irq variable

Kamal Mostafa (1):
  tools/hv: Use include/uapi with __EXPORTED_HEADERS__

Olaf Hering (1):
  Drivers: hv: vss: run only on supported host versions

 drivers/hv/channel.c            |   39 ++++++++++++---
 drivers/hv/channel_mgmt.c       |   42 ++++++++++-------
 drivers/hv/connection.c         |    7 +--
 drivers/hv/hv_snapshot.c        |    5 ++
 drivers/hv/hyperv_vmbus.h       |    2 +-
 drivers/hv/vmbus_drv.c          |   61 +++++++++++------------
 include/linux/hyperv.h          |  101 ++++++++++++---------------------------
 include/linux/mod_devicetable.h |    2 +-
 scripts/mod/file2alias.c        |    2 +-
 tools/hv/Makefile               |    2 +
 10 files changed, 128 insertions(+), 135 deletions(-)

-- 
1.7.4.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1267567 — [PATCH V2 01/12] Drivers: hv: vss: run only on supported host versions

From"K. Y. Srinivasan" <kys@microsoft.com>
Date2015-11-12 02:00 +0100
Subject[PATCH V2 01/12] Drivers: hv: vss: run only on supported host versions
Message-ID<qtOp3-1Nx-7@gated-at.bofh.it>
In reply to#1267566
From: Olaf Hering <olaf@aepfle.de>

The Backup integration service on WS2012 has appearently trouble to
negotiate with a guest which does not support the provided util version.
Currently the VSS driver supports only version 5/0. A WS2012 offers only
version 1/x and 3/x, and vmbus_prep_negotiate_resp correctly returns an
empty icframe_vercnt/icmsg_vercnt. But the host ignores that and
continues to send ICMSGTYPE_NEGOTIATE messages. The result are weird
errors during boot and general misbehaviour.

Check the Windows version to work around the host bug, skip hv_vss_init
on WS2012 and older.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
---
 drivers/hv/hv_snapshot.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/drivers/hv/hv_snapshot.c b/drivers/hv/hv_snapshot.c
index a548ae4..81882d4 100644
--- a/drivers/hv/hv_snapshot.c
+++ b/drivers/hv/hv_snapshot.c
@@ -331,6 +331,11 @@ static void vss_on_reset(void)
 int
 hv_vss_init(struct hv_util_service *srv)
 {
+	if (vmbus_proto_version < VERSION_WIN8_1) {
+		pr_warn("Integration service 'Backup (volume snapshot)'"
+			" not supported on this host version.\n");
+		return -ENOTSUPP;
+	}
 	recv_buffer = srv->recv_buffer;
 
 	/*
-- 
1.7.4.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1267568 — [PATCH V2 03/12] Drivers: hv: vmbus: Use uuid_le_cmp() for comparing GUIDs

From"K. Y. Srinivasan" <kys@microsoft.com>
Date2015-11-12 02:00 +0100
Subject[PATCH V2 03/12] Drivers: hv: vmbus: Use uuid_le_cmp() for comparing GUIDs
Message-ID<qtOp4-1Nx-33@gated-at.bofh.it>
In reply to#1267567
Use uuid_le_cmp() for comparing GUIDs.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
---
	V2: Fixed the typo in both the commit log and Subject line.

 drivers/hv/channel_mgmt.c |    3 +--
 drivers/hv/vmbus_drv.c    |    4 ++--
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c
index 38470aa..dc4fb0b 100644
--- a/drivers/hv/channel_mgmt.c
+++ b/drivers/hv/channel_mgmt.c
@@ -408,8 +408,7 @@ static void init_vp_index(struct vmbus_channel *channel, const uuid_le *type_gui
 	struct cpumask *alloced_mask;
 
 	for (i = IDE; i < MAX_PERF_CHN; i++) {
-		if (!memcmp(type_guid->b, &hp_devs[i].guid,
-				 sizeof(uuid_le))) {
+		if (!uuid_le_cmp(*type_guid, hp_devs[i].guid)) {
 			perf_chn = true;
 			break;
 		}
diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c
index 7078b5f..9e0e25c 100644
--- a/drivers/hv/vmbus_drv.c
+++ b/drivers/hv/vmbus_drv.c
@@ -533,7 +533,7 @@ static const uuid_le null_guid;
 
 static inline bool is_null_guid(const uuid_le *guid)
 {
-	if (memcmp(guid, &null_guid, sizeof(uuid_le)))
+	if (uuid_le_cmp(*guid, null_guid))
 		return false;
 	return true;
 }
@@ -547,7 +547,7 @@ static const struct hv_vmbus_device_id *hv_vmbus_get_id(
 					const uuid_le *guid)
 {
 	for (; !is_null_guid(&id->guid); id++)
-		if (!memcmp(&id->guid, guid, sizeof(uuid_le)))
+		if (!uuid_le_cmp(id->guid, *guid))
 			return id;
 
 	return NULL;
-- 
1.7.4.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1267569 — [PATCH V2 10/12] Drivers: hv: vmbus: channge vmbus_connection.channel_lock to mutex

From"K. Y. Srinivasan" <kys@microsoft.com>
Date2015-11-12 02:00 +0100
Subject[PATCH V2 10/12] Drivers: hv: vmbus: channge vmbus_connection.channel_lock to mutex
Message-ID<qtOp5-1Nx-35@gated-at.bofh.it>
In reply to#1267567
From: Dexuan Cui <decui@microsoft.com>

spinlock is unnecessary here.
mutex is enough.

Signed-off-by: Dexuan Cui <decui@microsoft.com>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
---
 drivers/hv/channel_mgmt.c |   12 ++++++------
 drivers/hv/connection.c   |    7 +++----
 drivers/hv/hyperv_vmbus.h |    2 +-
 3 files changed, 10 insertions(+), 11 deletions(-)

diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c
index 9c9da3a..d013171 100644
--- a/drivers/hv/channel_mgmt.c
+++ b/drivers/hv/channel_mgmt.c
@@ -206,9 +206,9 @@ void hv_process_channel_removal(struct vmbus_channel *channel, u32 relid)
 	}
 
 	if (channel->primary_channel == NULL) {
-		spin_lock_irqsave(&vmbus_connection.channel_lock, flags);
+		mutex_lock(&vmbus_connection.channel_mutex);
 		list_del(&channel->listentry);
-		spin_unlock_irqrestore(&vmbus_connection.channel_lock, flags);
+		mutex_unlock(&vmbus_connection.channel_mutex);
 
 		primary_channel = channel;
 	} else {
@@ -253,7 +253,7 @@ static void vmbus_process_offer(struct vmbus_channel *newchannel)
 	unsigned long flags;
 
 	/* Make sure this is a new offer */
-	spin_lock_irqsave(&vmbus_connection.channel_lock, flags);
+	mutex_lock(&vmbus_connection.channel_mutex);
 
 	list_for_each_entry(channel, &vmbus_connection.chn_list, listentry) {
 		if (!uuid_le_cmp(channel->offermsg.offer.if_type,
@@ -269,7 +269,7 @@ static void vmbus_process_offer(struct vmbus_channel *newchannel)
 		list_add_tail(&newchannel->listentry,
 			      &vmbus_connection.chn_list);
 
-	spin_unlock_irqrestore(&vmbus_connection.channel_lock, flags);
+	mutex_unlock(&vmbus_connection.channel_mutex);
 
 	if (!fnew) {
 		/*
@@ -341,9 +341,9 @@ static void vmbus_process_offer(struct vmbus_channel *newchannel)
 err_deq_chan:
 	vmbus_release_relid(newchannel->offermsg.child_relid);
 
-	spin_lock_irqsave(&vmbus_connection.channel_lock, flags);
+	mutex_lock(&vmbus_connection.channel_mutex);
 	list_del(&newchannel->listentry);
-	spin_unlock_irqrestore(&vmbus_connection.channel_lock, flags);
+	mutex_unlock(&vmbus_connection.channel_mutex);
 
 	if (newchannel->target_cpu != get_cpu()) {
 		put_cpu();
diff --git a/drivers/hv/connection.c b/drivers/hv/connection.c
index 4fc2e88..521f48e 100644
--- a/drivers/hv/connection.c
+++ b/drivers/hv/connection.c
@@ -146,7 +146,7 @@ int vmbus_connect(void)
 	spin_lock_init(&vmbus_connection.channelmsg_lock);
 
 	INIT_LIST_HEAD(&vmbus_connection.chn_list);
-	spin_lock_init(&vmbus_connection.channel_lock);
+	mutex_init(&vmbus_connection.channel_mutex);
 
 	/*
 	 * Setup the vmbus event connection for channel interrupt
@@ -282,11 +282,10 @@ struct vmbus_channel *relid2channel(u32 relid)
 {
 	struct vmbus_channel *channel;
 	struct vmbus_channel *found_channel  = NULL;
-	unsigned long flags;
 	struct list_head *cur, *tmp;
 	struct vmbus_channel *cur_sc;
 
-	spin_lock_irqsave(&vmbus_connection.channel_lock, flags);
+	mutex_lock(&vmbus_connection.channel_mutex);
 	list_for_each_entry(channel, &vmbus_connection.chn_list, listentry) {
 		if (channel->offermsg.child_relid == relid) {
 			found_channel = channel;
@@ -305,7 +304,7 @@ struct vmbus_channel *relid2channel(u32 relid)
 			}
 		}
 	}
-	spin_unlock_irqrestore(&vmbus_connection.channel_lock, flags);
+	mutex_unlock(&vmbus_connection.channel_mutex);
 
 	return found_channel;
 }
diff --git a/drivers/hv/hyperv_vmbus.h b/drivers/hv/hyperv_vmbus.h
index 64950d8..0af6dce 100644
--- a/drivers/hv/hyperv_vmbus.h
+++ b/drivers/hv/hyperv_vmbus.h
@@ -688,7 +688,7 @@ struct vmbus_connection {
 
 	/* List of channels */
 	struct list_head chn_list;
-	spinlock_t channel_lock;
+	struct mutex channel_mutex;
 
 	struct workqueue_struct *work_queue;
 };
-- 
1.7.4.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1267812 — Re: [PATCH V2 10/12] Drivers: hv: vmbus: channge vmbus_connection.channel_lock to mutex

FromVitaly Kuznetsov <vkuznets@redhat.com>
Date2015-11-12 11:50 +0100
SubjectRe: [PATCH V2 10/12] Drivers: hv: vmbus: channge vmbus_connection.channel_lock to mutex
Message-ID<qtXC2-7M0-15@gated-at.bofh.it>
In reply to#1267569
"K. Y. Srinivasan" <kys@microsoft.com> writes:

> From: Dexuan Cui <decui@microsoft.com>
>
> spinlock is unnecessary here.
> mutex is enough.

Hm, mutex is usually required when we need to sleep and a spinlock is
enough otherwise :-)

Or are you trying to say we don't need to disable interrupts here? In
that can maybe we can just switch to spin_lock()/spin_unlock()?

>
> Signed-off-by: Dexuan Cui <decui@microsoft.com>
> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
> ---
>  drivers/hv/channel_mgmt.c |   12 ++++++------
>  drivers/hv/connection.c   |    7 +++----
>  drivers/hv/hyperv_vmbus.h |    2 +-
>  3 files changed, 10 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c
> index 9c9da3a..d013171 100644
> --- a/drivers/hv/channel_mgmt.c
> +++ b/drivers/hv/channel_mgmt.c
> @@ -206,9 +206,9 @@ void hv_process_channel_removal(struct vmbus_channel *channel, u32 relid)
>  	}
>
>  	if (channel->primary_channel == NULL) {
> -		spin_lock_irqsave(&vmbus_connection.channel_lock, flags);
> +		mutex_lock(&vmbus_connection.channel_mutex);
>  		list_del(&channel->listentry);
> -		spin_unlock_irqrestore(&vmbus_connection.channel_lock, flags);
> +		mutex_unlock(&vmbus_connection.channel_mutex);
>
>  		primary_channel = channel;
>  	} else {
> @@ -253,7 +253,7 @@ static void vmbus_process_offer(struct vmbus_channel *newchannel)
>  	unsigned long flags;
>
>  	/* Make sure this is a new offer */
> -	spin_lock_irqsave(&vmbus_connection.channel_lock, flags);
> +	mutex_lock(&vmbus_connection.channel_mutex);
>
>  	list_for_each_entry(channel, &vmbus_connection.chn_list, listentry) {
>  		if (!uuid_le_cmp(channel->offermsg.offer.if_type,
> @@ -269,7 +269,7 @@ static void vmbus_process_offer(struct vmbus_channel *newchannel)
>  		list_add_tail(&newchannel->listentry,
>  			      &vmbus_connection.chn_list);
>
> -	spin_unlock_irqrestore(&vmbus_connection.channel_lock, flags);
> +	mutex_unlock(&vmbus_connection.channel_mutex);
>
>  	if (!fnew) {
>  		/*
> @@ -341,9 +341,9 @@ static void vmbus_process_offer(struct vmbus_channel *newchannel)
>  err_deq_chan:
>  	vmbus_release_relid(newchannel->offermsg.child_relid);
>
> -	spin_lock_irqsave(&vmbus_connection.channel_lock, flags);
> +	mutex_lock(&vmbus_connection.channel_mutex);
>  	list_del(&newchannel->listentry);
> -	spin_unlock_irqrestore(&vmbus_connection.channel_lock, flags);
> +	mutex_unlock(&vmbus_connection.channel_mutex);
>
>  	if (newchannel->target_cpu != get_cpu()) {
>  		put_cpu();
> diff --git a/drivers/hv/connection.c b/drivers/hv/connection.c
> index 4fc2e88..521f48e 100644
> --- a/drivers/hv/connection.c
> +++ b/drivers/hv/connection.c
> @@ -146,7 +146,7 @@ int vmbus_connect(void)
>  	spin_lock_init(&vmbus_connection.channelmsg_lock);
>
>  	INIT_LIST_HEAD(&vmbus_connection.chn_list);
> -	spin_lock_init(&vmbus_connection.channel_lock);
> +	mutex_init(&vmbus_connection.channel_mutex);
>
>  	/*
>  	 * Setup the vmbus event connection for channel interrupt
> @@ -282,11 +282,10 @@ struct vmbus_channel *relid2channel(u32 relid)
>  {
>  	struct vmbus_channel *channel;
>  	struct vmbus_channel *found_channel  = NULL;
> -	unsigned long flags;
>  	struct list_head *cur, *tmp;
>  	struct vmbus_channel *cur_sc;
>
> -	spin_lock_irqsave(&vmbus_connection.channel_lock, flags);
> +	mutex_lock(&vmbus_connection.channel_mutex);
>  	list_for_each_entry(channel, &vmbus_connection.chn_list, listentry) {
>  		if (channel->offermsg.child_relid == relid) {
>  			found_channel = channel;
> @@ -305,7 +304,7 @@ struct vmbus_channel *relid2channel(u32 relid)
>  			}
>  		}
>  	}
> -	spin_unlock_irqrestore(&vmbus_connection.channel_lock, flags);
> +	mutex_unlock(&vmbus_connection.channel_mutex);
>
>  	return found_channel;
>  }
> diff --git a/drivers/hv/hyperv_vmbus.h b/drivers/hv/hyperv_vmbus.h
> index 64950d8..0af6dce 100644
> --- a/drivers/hv/hyperv_vmbus.h
> +++ b/drivers/hv/hyperv_vmbus.h
> @@ -688,7 +688,7 @@ struct vmbus_connection {
>
>  	/* List of channels */
>  	struct list_head chn_list;
> -	spinlock_t channel_lock;
> +	struct mutex channel_mutex;
>
>  	struct workqueue_struct *work_queue;
>  };

-- 
  Vitaly
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1267570 — [PATCH 12/12] tools/hv: Use include/uapi with __EXPORTED_HEADERS__

From"K. Y. Srinivasan" <kys@microsoft.com>
Date2015-11-12 02:00 +0100
Subject[PATCH 12/12] tools/hv: Use include/uapi with __EXPORTED_HEADERS__
Message-ID<qtOp5-1Nx-37@gated-at.bofh.it>
In reply to#1267567
From: Kamal Mostafa <kamal@canonical.com>

Use the local uapi headers to keep in sync with "recently" added #define's
(e.g. VSS_OP_REGISTER1).

Fixes: 3eb2094c59e89db2bedd401e23c7a870081c9edb
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
---
 tools/hv/Makefile |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/tools/hv/Makefile b/tools/hv/Makefile
index a8ab795..a8c4644 100644
--- a/tools/hv/Makefile
+++ b/tools/hv/Makefile
@@ -5,6 +5,8 @@ PTHREAD_LIBS = -lpthread
 WARNINGS = -Wall -Wextra
 CFLAGS = $(WARNINGS) -g $(PTHREAD_LIBS) $(shell getconf LFS_CFLAGS)
 
+CFLAGS += -D__EXPORTED_HEADERS__ -I../../include/uapi -I../../include
+
 all: hv_kvp_daemon hv_vss_daemon hv_fcopy_daemon
 %: %.c
 	$(CC) $(CFLAGS) -o $@ $^
-- 
1.7.4.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web