Drivers: hv: Miscellaneous fixes
Subsystems (2)
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
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
@@ -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
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.
--- drivers/hv/connection.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/hv/connection.c +5 -3
@@ -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
Greg KH
maintainerRe: [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_FAILsounds good enough.Signed-off-by Vitaly Kuznetsov <[email protected]>Signed-off-by K. Y. Srinivasan <[email protected]>--- tools/hv/hv_fcopy_daemon.c | 1 + 1 file changed, 1 insertion(+)
No need to backport for stable?
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 requestedQuoted 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_FAILsounds good enough.
Quoted 7 lines
Quoted 5 lines
Signed-off-by Vitaly Kuznetsov <[email protected]>Signed-off-by K. Y. Srinivasan <[email protected]>--- 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
Greg KH
maintainerRe: [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 requestedQuoted 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_FAILsounds good enough.
Quoted 8 lines
Quoted 7 lines
Quoted 5 lines
Signed-off-by Vitaly Kuznetsov <[email protected]>Signed-off-by K. Y. Srinivasan <[email protected]>--- 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... :)
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 requestedQuoted 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 requestedOn 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 setit
Quoted 8 lines
Quoted 8 lines
Quoted 7 lines
to something,
HV_E_FAILsounds good enough.Signed-off-by Vitaly Kuznetsov <[email protected]>Signed-off-by K. Y. Srinivasan <[email protected]>--- 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