Skip to contentSkip to conversation

Drivers: hv: Miscellaneous fixes

PATCH In review [email protected] 3 participants 7 messages Sep 17, 2018

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

cover Drivers: hv: Miscellaneous fixes

From: "K. Y. Srinivasan" <[email protected]>

Some miscellaneous fixes.

Dexuan Cui (1):
Drivers: hv: vmbus: Use get/put_cpu() in vmbus_connect()

Vitaly Kuznetsov (1):
tools: hv: fcopy: set 'error' in case an unknown operation was
requested

 drivers/hv/connection.c    | 8 +++++---
 tools/hv/hv_fcopy_daemon.c | 1 +
 2 files changed, 6 insertions(+), 3 deletions(-)
Signature · 1 line
2.18.0
#2 lore raw

PATCH 2/2 tools: hv: fcopy: set 'error' in case an unknown operation was requested

In reply to [email protected]

From: Vitaly Kuznetsov <[email protected]>

'error' variable is left uninitialized in case we see an unknown operation. As we don't immediately return and proceed to pwrite() we need to set it to something, HV_E_FAIL sounds good enough.

---
 tools/hv/hv_fcopy_daemon.c | 1 +
 1 file changed, 1 insertion(+)
tools/hv/hv_fcopy_daemon.c +1 -0
index d78aed86af09..8ff8cb1a11f4 100644
@@ -234,6 +234,7 @@ int main(int argc, char *argv[])
 			break;
 
 		default:
+			error = HV_E_FAIL;
 			syslog(LOG_ERR, "Unknown operation: %d",
 				buffer.hdr.operation);
 
Signature · 1 line
2.18.0
#1 lore raw

PATCH 1/2 Drivers: hv: vmbus: Use get/put_cpu() in vmbus_connect()

In reply to [email protected]

From: Dexuan Cui <[email protected]>

With CONFIG_DEBUG_PREEMPT=y, I always see this warning:

BUG: using smp_processor_id() in preemptible [00000000]

Fix the false warning by using get/put_cpu().

Here vmbus_connect() sends a message to the host and waits for the host's response. The host will deliver the response message and an interrupt on CPU msg->target_vcpu, and later the interrupt handler will wake up vmbus_connect(). vmbus_connect() doesn't really have to run on the same cpu as CPU msg->target_vcpu, so it's safe to call put_cpu() just here.

Cc K. Y. Srinivasan <[email protected]>
Cc Haiyang Zhang <[email protected]>
Cc Stephen Hemminger <[email protected]>
---
 drivers/hv/connection.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/hv/connection.c +5 -3
index ced041899456..f4d08c8ac7f8 100644
@@ -76,6 +76,7 @@ static int vmbus_negotiate_version(struct vmbus_channel_msginfo *msginfo,
 					__u32 version)
 {
 	int ret = 0;
+	unsigned int cur_cpu;
 	struct vmbus_channel_initiate_contact *msg;
 	unsigned long flags;
 
@@ -118,9 +119,10 @@ static int vmbus_negotiate_version(struct vmbus_channel_msginfo *msginfo,
 	 * the CPU attempting to connect may not be CPU 0.
 	 */
 	if (version >= VERSION_WIN8_1) {
-		msg->target_vcpu =
-			hv_cpu_number_to_vp_number(smp_processor_id());
-		vmbus_connection.connect_cpu = smp_processor_id();
+		cur_cpu = get_cpu();
+		msg->target_vcpu = hv_cpu_number_to_vp_number(cur_cpu);
+		vmbus_connection.connect_cpu = cur_cpu;
+		put_cpu();
 	} else {
 		msg->target_vcpu = 0;
 		vmbus_connection.connect_cpu = 0;
Signature · 1 line
2.18.0
maintainer
#3 lore raw

Re: [PATCH 2/2] tools: hv: fcopy: set 'error' in case an unknown operation was requested

In reply to [email protected]
Quoted 11 lines · On Mon, Sep 17, 2018 at 04:14:55AM +0000, [email protected] wrote:

From: Vitaly Kuznetsov <[email protected]>

'error' variable is left uninitialized in case we see an unknown operation. As we don't immediately return and proceed to pwrite() we need to set it to something, HV_E_FAIL sounds good enough.

---
 tools/hv/hv_fcopy_daemon.c | 1 +
 1 file changed, 1 insertion(+)

No need to backport for stable?

#4 lore raw

RE: [PATCH 2/2] tools: hv: fcopy: set 'error' in case an unknown operation was requested

Quoted 20 lines

-----Original Message-----
From: Greg KH <[email protected]>
Sent: Sunday, September 16, 2018 9:56 PM
To: KY Srinivasan <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Stephen Hemminger <[email protected]>; Michael Kelley (EOSG) <[email protected]>; vkuznets <[email protected]>
Subject: Re: [PATCH 2/2] tools: hv: fcopy: set 'error' in case an unknown operation was requested

Quoted 6 lines · On Mon, Sep 17, 2018 at 04:14:55AM +0000, [email protected] wrote:

From: Vitaly Kuznetsov <[email protected]>

'error' variable is left uninitialized in case we see an unknown operation. As we don't immediately return and proceed to pwrite() we need to set it to something, HV_E_FAIL sounds good enough.

Quoted 7 lines
Quoted 5 lines
---
 tools/hv/hv_fcopy_daemon.c | 1 +
 1 file changed, 1 insertion(+)

No need to backport for stable?

Thanks for pointing this out. Should I resubmit with the stable tag?

Thanks,

K. Y

maintainer
#5 lore raw

Re: [PATCH 2/2] tools: hv: fcopy: set 'error' in case an unknown operation was requested

Quoted 20 lines · KY Srinivasan
Quoted 20 lines

-----Original Message-----
From: Greg KH <[email protected]>
Sent: Sunday, September 16, 2018 9:56 PM
To: KY Srinivasan <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Stephen Hemminger <[email protected]>; Michael Kelley (EOSG) <[email protected]>; vkuznets <[email protected]>
Subject: Re: [PATCH 2/2] tools: hv: fcopy: set 'error' in case an unknown operation was requested

Quoted 6 lines · On Mon, Sep 17, 2018 at 04:14:55AM +0000, [email protected] wrote:

From: Vitaly Kuznetsov <[email protected]>

'error' variable is left uninitialized in case we see an unknown operation. As we don't immediately return and proceed to pwrite() we need to set it to something, HV_E_FAIL sounds good enough.

Quoted 8 lines
Quoted 7 lines
Quoted 5 lines
---
 tools/hv/hv_fcopy_daemon.c | 1 +
 1 file changed, 1 insertion(+)

No need to backport for stable?

Thanks for pointing this out. Should I resubmit with the stable tag?

I can do it... :)

#6 lore raw

RE: [PATCH 2/2] tools: hv: fcopy: set 'error' in case an unknown operation was requested

Quoted 42 lines

-----Original Message-----
From: Greg KH <[email protected]>
Sent: Monday, September 17, 2018 7:28 AM
To: KY Srinivasan <[email protected]>
Cc: [email protected]; Stephen Hemminger <[email protected]>; [email protected]; [email protected]; Michael Kelley (EOSG) <[email protected]>; [email protected]; [email protected]; vkuznets <[email protected]>
Subject: Re: [PATCH 2/2] tools: hv: fcopy: set 'error' in case an unknown operation was requested

Quoted 14 lines · KY Srinivasan
Quoted 14 lines

-----Original Message-----
From: Greg KH <[email protected]>
Sent: Sunday, September 16, 2018 9:56 PM
To: KY Srinivasan <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Stephen Hemminger <[email protected]>; Michael Kelley (EOSG) <[email protected]>; vkuznets <[email protected]>
Subject: Re: [PATCH 2/2] tools: hv: fcopy: set 'error' in case an unknown operation was requested

On Mon, Sep 17, 2018 at 04:14:55AM +0000, [email protected]

Quoted 4 lines · wrote:
Quoted 4 lines
Quoted 4 lines

From: Vitaly Kuznetsov <[email protected]>

'error' variable is left uninitialized in case we see an unknown operation. As we don't immediately return and proceed to pwrite() we need to set

it

Quoted 8 lines
Quoted 8 lines
Quoted 7 lines

to something, HV_E_FAIL sounds good enough.

---
 tools/hv/hv_fcopy_daemon.c | 1 +
 1 file changed, 1 insertion(+)
Quoted 4 lines
Quoted 2 lines
Quoted 1 line

No need to backport for stable?

Thanks for pointing this out. Should I resubmit with the stable tag?

I can do it... :)

Thank you!

K. Y