Skip to contentSkip to conversation

Drivers: hv: Some miscellaneous fixes

PATCH New K. Y. Srinivasan 1 participant 6 messages Jul 3, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover Drivers: hv: Some miscellaneous fixes

Some miscellaneous fixes.

Dan Carpenter (1):
hv: util: checking the wrong variable

Denis V. Lunev (1):
mshyperv: fix recognition of Hyper-V guest crash MSR's

K. Y. Srinivasan (1):
Drivers: hv: vmbus: Consider ND NIC in binding channels to CPUs

Nik Nyby (1):
Drivers: hv: vmbus: fix typo in hv_port_info struct

Vitaly Kuznetsov (1):
Drivers: hv: vmbus: don't send CHANNELMSG_UNLOAD on pre-Win2012R2
hosts

 arch/x86/include/asm/mshyperv.h |    1 +
 arch/x86/kernel/cpu/mshyperv.c  |    1 +
 drivers/hv/channel_mgmt.c       |    5 +++++
 drivers/hv/hv_utils_transport.c |    2 +-
 drivers/hv/hyperv_vmbus.h       |    2 +-
 drivers/hv/vmbus_drv.c          |    4 ++--
 6 files changed, 11 insertions(+), 4 deletions(-)
Signature · 1 line
1.7.4.1
#1 lore raw

PATCH 1/5 hv: util: checking the wrong variable

From: Dan Carpenter <[email protected]>

We don't catch this allocation failure because there is a typo and we check the wrong variable.

Fixes 14b50f80c32d ('Drivers: hv: util: introduce hv_utils_transport abstraction')
---
 drivers/hv/hv_utils_transport.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/hv/hv_utils_transport.c +1 -1
index ea7ba5e..6a9d80a 100644
@@ -186,7 +186,7 @@ int hvutil_transport_send(struct hvutil_transport *hvt, void *msg, int len)
 		return -EINVAL;
 	} else if (hvt->mode == HVUTIL_TRANSPORT_NETLINK) {
 		cn_msg = kzalloc(sizeof(*cn_msg) + len, GFP_ATOMIC);
-		if (!msg)
+		if (!cn_msg)
 			return -ENOMEM;
 		cn_msg->id.idx = hvt->cn_id.idx;
 		cn_msg->id.val = hvt->cn_id.val;
Signature · 1 line
1.7.4.1
#2 lore raw

PATCH 2/5 Drivers: hv: vmbus: fix typo in hv_port_info struct

From: Nik Nyby <[email protected]>

This fixes a typo: base_flag_bumber to base_flag_number

---
 drivers/hv/hyperv_vmbus.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/hv/hyperv_vmbus.h +1 -1
index cddc0c9..6383707 100644
@@ -141,7 +141,7 @@ struct hv_port_info {
 		struct {
 			u32 target_sint;
 			u32 target_vp;
-			u16 base_flag_bumber;
+			u16 base_flag_number;
 			u16 flag_count;
 			u32 rsvdz;
 		} event_port_info;
Signature · 1 line
1.7.4.1
#3 lore raw

PATCH 3/5 Drivers: hv: vmbus: don't send CHANNELMSG_UNLOAD on pre-Win2012R2 hosts

In reply to K. Y. Srinivasan

From: Vitaly Kuznetsov <[email protected]>

Pre-Win2012R2 hosts don't properly handle CHANNELMSG_UNLOAD and wait_for_completion() hangs. Avoid sending such request on old hosts.

---
 drivers/hv/channel_mgmt.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
drivers/hv/channel_mgmt.c +4 -0
index 4506a66..00ba3f3 100644
@@ -469,6 +469,10 @@ void vmbus_initiate_unload(void)
 {
 	struct vmbus_channel_message_header hdr;
 
+	/* Pre-Win2012R2 hosts don't support reconnect */
+	if (vmbus_proto_version < VERSION_WIN8_1)
+		return;
+
 	init_completion(&vmbus_connection.unload_event);
 	memset(&hdr, 0, sizeof(struct vmbus_channel_message_header));
 	hdr.msgtype = CHANNELMSG_UNLOAD;
Signature · 1 line
1.7.4.1
#4 lore raw

PATCH 4/5 mshyperv: fix recognition of Hyper-V guest crash MSR's

In reply to K. Y. Srinivasan

From: Denis V. Lunev <[email protected]>

Hypervisor Top Level Functional Specification v3.1/4.0 notes that cpuid (0x40000003) EDX's 10th bit should be used to check that Hyper-V guest crash MSR's functionality available.

This patch should fix this recognition. Currently the code checks EAX register instead of EDX.

---
 arch/x86/include/asm/mshyperv.h |    1 +
 arch/x86/kernel/cpu/mshyperv.c  |    1 +
 drivers/hv/vmbus_drv.c          |    4 ++--
 3 files changed, 4 insertions(+), 2 deletions(-)
arch/x86/include/asm/mshyperv.h +1 -0
index d02f9c9..aaf59b7 100644
@@ -7,6 +7,7 @@
 
 struct ms_hyperv_info {
 	u32 features;
+	u32 misc_features;
 	u32 hints;
 };
 
arch/x86/kernel/cpu/mshyperv.c +1 -0
index 1a6e742..9b5d7b5 100644
@@ -160,6 +160,7 @@ static void __init ms_hyperv_init_platform(void)
 	 * Extract the features and hints
 	 */
 	ms_hyperv.features = cpuid_eax(HYPERV_CPUID_FEATURES);
+	ms_hyperv.misc_features = cpuid_edx(HYPERV_CPUID_FEATURES);
 	ms_hyperv.hints    = cpuid_eax(HYPERV_CPUID_ENLIGHTMENT_INFO);
 
 	printk(KERN_INFO "HyperV: features 0x%x, hints 0x%x\n",
drivers/hv/vmbus_drv.c +2 -2
index 83759c1..8c3eaee 100644
@@ -868,7 +868,7 @@ static int vmbus_bus_init(int irq)
 	/*
 	 * Only register if the crash MSRs are available
 	 */
-	if (ms_hyperv.features & HV_FEATURE_GUEST_CRASH_MSR_AVAILABLE) {
+	if (ms_hyperv.misc_features & HV_FEATURE_GUEST_CRASH_MSR_AVAILABLE) {
 		register_die_notifier(&hyperv_die_block);
 		atomic_notifier_chain_register(&panic_notifier_list,
 					       &hyperv_panic_block);
@@ -1313,7 +1313,7 @@ static void __exit vmbus_exit(void)
 	hv_remove_vmbus_irq();
 	tasklet_kill(&msg_dpc);
 	vmbus_free_channels();
-	if (ms_hyperv.features & HV_FEATURE_GUEST_CRASH_MSR_AVAILABLE) {
+	if (ms_hyperv.misc_features & HV_FEATURE_GUEST_CRASH_MSR_AVAILABLE) {
 		unregister_die_notifier(&hyperv_die_block);
 		atomic_notifier_chain_unregister(&panic_notifier_list,
 						 &hyperv_panic_block);
Signature · 1 line
1.7.4.1
#5 lore raw

PATCH 5/5 Drivers: hv: vmbus: Consider ND NIC in binding channels to CPUs

In reply to K. Y. Srinivasan

We cycle through all the "high performance" channels to distribute load across the available CPUs. Process the NetworkDirect as a high performance device.

---
 drivers/hv/channel_mgmt.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/hv/channel_mgmt.c +1 -0
index 00ba3f3..30613df 100644
@@ -347,6 +347,7 @@ enum {
 	IDE = 0,
 	SCSI,
 	NIC,
+	ND_NIC,
 	MAX_PERF_CHN,
 };
 
Signature · 1 line
1.7.4.1