Skip to contentSkip to conversation

Drivers: hv: vmbus: Use the new infrastructure for delivering VMBUS interrupts

PATCH In review K. Y. Srinivasan 3 participants 20 messages Feb 6, 2013 – Feb 17, 2013 Hyper-V/Azure core and drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Drivers: hv: vmbus: Use the new infrastructure for delivering VMBUS interrupts

Use the infrastructure for delivering VMBUS interrupts using a special vector. With this patch, we can now properly handle the VMBUS interrupts that can be delivered on any CPU. Also, turn on interrupt load balancing as well.

This patch requires the infrastructure that was implemented in the patch:
X86: Handle Hyper-V vmbus interrupts as special hypervisor interrupts

---
 drivers/hv/channel_mgmt.c |    2 +-
 drivers/hv/hv.c           |    5 ++---
 drivers/hv/vmbus_drv.c    |   11 +++++++----
 3 files changed, 10 insertions(+), 8 deletions(-)
drivers/hv/channel_mgmt.c +1 -1
index 53a8600..ff1be16 100644
@@ -318,7 +318,7 @@ static u32 get_vp_index(uuid_le *type_guid)
 		return 0;
 	}
 	cur_cpu = (++next_vp % max_cpus);
-	return 0;
+	return cur_cpu;
 }
 
 /*
drivers/hv/hv.c +2 -3
index 1c5481d..7311589 100644
@@ -272,7 +272,7 @@ u16 hv_signal_event(void *con_id)
  * retrieve the initialized message and event pages.  Otherwise, we create and
  * initialize the message and event pages.
  */
-void hv_synic_init(void *irqarg)
+void hv_synic_init(void *arg)
 {
 	u64 version;
 	union hv_synic_simp simp;
@@ -281,7 +281,6 @@ void hv_synic_init(void *irqarg)
 	union hv_synic_scontrol sctrl;
 	u64 vp_index;
 
-	u32 irq_vector = *((u32 *)(irqarg));
 	int cpu = smp_processor_id();
 
 	if (!hv_context.hypercall_page)
@@ -335,7 +334,7 @@ void hv_synic_init(void *irqarg)
 	rdmsrl(HV_X64_MSR_SINT0 + VMBUS_MESSAGE_SINT, shared_sint.as_uint64);
 
 	shared_sint.as_uint64 = 0;
-	shared_sint.vector = irq_vector; /* HV_SHARED_SINT_IDT_VECTOR + 0x20; */
+	shared_sint.vector = HYPERVISOR_CALLBACK_VECTOR;
 	shared_sint.masked = false;
 	shared_sint.auto_eoi = true;
 
drivers/hv/vmbus_drv.c +7 -4
index cf19dfa..bf421e0 100644
@@ -36,6 +36,7 @@
 #include <linux/kernel_stat.h>
 #include <asm/hyperv.h>
 #include <asm/hypervisor.h>
+#include <asm/mshyperv.h>
 #include "hyperv_vmbus.h"
 
 
@@ -528,7 +529,6 @@ static void vmbus_flow_handler(unsigned int irq, struct irq_desc *desc)
 static int vmbus_bus_init(int irq)
 {
 	int ret;
-	unsigned int vector;
 
 	/* Hypervisor initialization...setup hypercall page..etc */
 	ret = hv_init();
@@ -558,13 +558,16 @@ static int vmbus_bus_init(int irq)
 	 */
 	irq_set_handler(irq, vmbus_flow_handler);
 
-	vector = IRQ0_VECTOR + irq;
+	/*
+	 * Register our interrupt handler.
+	 */
+	hv_register_vmbus_handler(irq, vmbus_isr);
 
 	/*
-	 * Notify the hypervisor of our irq and
+	 * Initialize the per-cpu interrupt state and
 	 * connect to the host.
 	 */
-	on_each_cpu(hv_synic_init, (void *)&vector, 1);
+	on_each_cpu(hv_synic_init, NULL, 1);
 	ret = vmbus_connect();
 	if (ret)
 		goto err_irq;
Signature · 1 line
1.7.4.1
Acked-by on v1 1/1
#1 lore raw
Quoted 8 lines · K. Y. Srinivasan

Use the infrastructure for delivering VMBUS interrupts using a special vector. With this patch, we can now properly handle the VMBUS interrupts that can be delivered on any CPU. Also, turn on interrupt load balancing as well.

This patch requires the infrastructure that was implemented in the patch:
X86: Handle Hyper-V vmbus interrupts as special hypervisor interrupts

Because of the dependancy, this should go through the x86 tree as well:

#2 lore raw
Quoted 18 lines

-----Original Message-----
From: Greg KH [mailto:[email protected]]
Sent: Wednesday, February 06, 2013 2:13 PM
To: KY Srinivasan
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: [PATCH 1/1] Drivers: hv: vmbus: Use the new infrastructure for delivering VMBUS interrupts

Quoted 5 lines · K. Y. Srinivasan

Use the infrastructure for delivering VMBUS interrupts using a special vector. With this patch, we can now properly handle the VMBUS interrupts that can be delivered on any CPU. Also, turn on interrupt load balancing as well.

Quoted 8 lines
Quoted 3 lines

This patch requires the infrastructure that was implemented in the patch:
X86: Handle Hyper-V vmbus interrupts as special hypervisor interrupts

Because of the dependancy, this should go through the x86 tree as well:

Peter,

Let me know if I need to make any adjustments to these patches. These set of patches are key for Linux scalability on Hyper-V.

Regards,

K. Y

#3 lore raw
In reply to Greg KH
Quoted 6 lines · Greg KH
Quoted 5 lines · K. Y. Srinivasan

Use the infrastructure for delivering VMBUS interrupts using a special vector. With this patch, we can now properly handle the VMBUS interrupts that can be delivered on any CPU. Also, turn on interrupt load balancing as well.

Quoted 7 lines
Quoted 3 lines

This patch requires the infrastructure that was implemented in the patch:
X86: Handle Hyper-V vmbus interrupts as special hypervisor interrupts

Because of the dependancy, this should go through the x86 tree as well:

This does not apply to v3.8-rc7 + the set of three vmbus patches for x86. I take it there are additional dependencies -- K.Y., what do I need here?

-hpa

#4 lore raw
Quoted 23 lines

-----Original Message-----
From: H. Peter Anvin [mailto:[email protected]]
Sent: Tuesday, February 12, 2013 7:31 PM
To: Greg KH
Cc: KY Srinivasan; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: [PATCH 1/1] Drivers: hv: vmbus: Use the new infrastructure for delivering VMBUS interrupts

Quoted 10 lines · Greg KH
Quoted 8 lines · K. Y. Srinivasan

Use the infrastructure for delivering VMBUS interrupts using a special vector. With this patch, we can now properly handle the VMBUS interrupts that can be delivered on any CPU. Also, turn on interrupt load balancing as well.

This patch requires the infrastructure that was implemented in the patch:
X86: Handle Hyper-V vmbus interrupts as special hypervisor interrupts

Quoted 7 lines
Quoted 3 lines

Because of the dependancy, this should go through the x86 tree as well:

This does not apply to v3.8-rc7 + the set of three vmbus patches for x86. I take it there are additional dependencies -- K.Y., what do I need here?

Do none of the earlier patches apply or just this patch. If none of them apply, I could rebase all of them and resend them. Please let me know.

Regards,

K. Y

Quoted 5 lines

-hpa

#5 lore raw
Quoted 8 lines · KY Srinivasan
Quoted 4 lines

This does not apply to v3.8-rc7 + the set of three vmbus patches for x86. I take it there are additional dependencies -- K.Y., what do I need here?

Do none of the earlier patches apply or just this patch. If none of them apply, I could rebase all of them and resend them. Please let me know.

The earlier (set of 3) patches apply just fine.

-hpa

#6 lore raw
Quoted 18 lines

-----Original Message-----
From: H. Peter Anvin [mailto:[email protected]]
Sent: Tuesday, February 12, 2013 7:46 PM
To: KY Srinivasan
Cc: Greg KH; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: [PATCH 1/1] Drivers: hv: vmbus: Use the new infrastructure for delivering VMBUS interrupts

Quoted 5 lines · KY Srinivasan
Quoted 4 lines

This does not apply to v3.8-rc7 + the set of three vmbus patches for x86. I take it there are additional dependencies -- K.Y., what do I need here?

Quoted 5 lines
Quoted 3 lines

Do none of the earlier patches apply or just this patch. If none of them apply, I could rebase all of them and resend them. Please let me know.

The earlier (set of 3) patches apply just fine.

Apply them and I will rebase this patch and send it out.

Regards,

K. Y

Quoted 5 lines

-hpa

#7 lore raw
Quoted 3 lines · KY Srinivasan

Apply them and I will rebase this patch and send it out.

Pull the -tip tree and you can base it on the x86/hyperv branch.

-hpa

#8 lore raw
In reply to H. Peter Anvin
Quoted 23 lines

-----Original Message-----
From: H. Peter Anvin [mailto:[email protected]]
Sent: Tuesday, February 12, 2013 7:31 PM
To: Greg KH
Cc: KY Srinivasan; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: [PATCH 1/1] Drivers: hv: vmbus: Use the new infrastructure for delivering VMBUS interrupts

Quoted 10 lines · Greg KH
Quoted 8 lines · K. Y. Srinivasan

Use the infrastructure for delivering VMBUS interrupts using a special vector. With this patch, we can now properly handle the VMBUS interrupts that can be delivered on any CPU. Also, turn on interrupt load balancing as well.

This patch requires the infrastructure that was implemented in the patch:
X86: Handle Hyper-V vmbus interrupts as special hypervisor interrupts

Quoted 7 lines
Quoted 3 lines

Because of the dependancy, this should go through the x86 tree as well:

This does not apply to v3.8-rc7 + the set of three vmbus patches for x86. I take it there are additional dependencies -- K.Y., what do I need here?

Greg,

Peter has checked in the infrastructural patches into v3.8-rc7. This version does not have the patches that upgraded the VMBUS protocol version to the win8 levels. How will the infrastructural patches get moved forward to the version where you have checked-in all the vmbus protocol updates:
[PATCH 00/28] Drivers: hv: Update the Vmbus protocol.

Now that Peter has checked in the needed patches, could you take this patch through your tree. Let me know, if you need, I can re-send this patch to you.

Regards,

K. Y

#9 lore raw
Quoted 31 lines · KY Srinivasan
Quoted 23 lines

-----Original Message-----
From: H. Peter Anvin [mailto:[email protected]]
Sent: Tuesday, February 12, 2013 7:31 PM
To: Greg KH
Cc: KY Srinivasan; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: [PATCH 1/1] Drivers: hv: vmbus: Use the new infrastructure for delivering VMBUS interrupts

Quoted 10 lines · Greg KH
Quoted 8 lines · K. Y. Srinivasan

Use the infrastructure for delivering VMBUS interrupts using a special vector. With this patch, we can now properly handle the VMBUS interrupts that can be delivered on any CPU. Also, turn on interrupt load balancing as well.

This patch requires the infrastructure that was implemented in the patch:
X86: Handle Hyper-V vmbus interrupts as special hypervisor interrupts

Quoted 7 lines
Quoted 3 lines

Because of the dependancy, this should go through the x86 tree as well:

This does not apply to v3.8-rc7 + the set of three vmbus patches for x86. I take it there are additional dependencies -- K.Y., what do I need here?

Quoted 5 lines

Greg,

Peter has checked in the infrastructural patches into v3.8-rc7. This version does not have the patches that upgraded the VMBUS protocol version to the win8 levels.

What is "this version"?

Quoted 3 lines

How will the infrastructural patches get moved forward to the version where you have checked-in all the vmbus protocol updates:
[PATCH 00/28] Drivers: hv: Update the Vmbus protocol.

Those are in the char-misc git tree and will to go Linus for 3.9-rc1.

Quoted 2 lines

Now that Peter has checked in the needed patches, could you take this patch through your tree.

What again is "this"?

Quoted 1 line

Let me know, if you need, I can re-send this patch to you.

Will it cause build problems if I take this patch in my tree, without the changes in the -tip tree?

thanks,

greg k-h

#10 lore raw
Quoted 45 lines

-----Original Message-----
From: Greg KH [mailto:[email protected]]
Sent: Wednesday, February 13, 2013 11:22 AM
To: KY Srinivasan
Cc: H. Peter Anvin; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: [PATCH 1/1] Drivers: hv: vmbus: Use the new infrastructure for delivering VMBUS interrupts

Quoted 9 lines · KY Srinivasan
Quoted 9 lines

-----Original Message-----
From: H. Peter Anvin [mailto:[email protected]]
Sent: Tuesday, February 12, 2013 7:31 PM
To: Greg KH
Cc: KY Srinivasan; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected];

[email protected]

Quoted 22 lines
Quoted 21 lines

Subject: Re: [PATCH 1/1] Drivers: hv: vmbus: Use the new infrastructure for delivering VMBUS interrupts

Quoted 6 lines · Greg KH
Quoted 5 lines · K. Y. Srinivasan

Use the infrastructure for delivering VMBUS interrupts using a special vector. With this patch, we can now properly handle the VMBUS interrupts that can be delivered on any CPU. Also, turn on interrupt load balancing as well.

Quoted 7 lines
Quoted 3 lines

This patch requires the infrastructure that was implemented in the patch:
X86: Handle Hyper-V vmbus interrupts as special hypervisor interrupts

Because of the dependancy, this should go through the x86 tree as well:

This does not apply to v3.8-rc7 + the set of three vmbus patches for x86. I take it there are additional dependencies -- K.Y., what do I need here?

Quoted 7 lines
Quoted 5 lines

Greg,

Peter has checked in the infrastructural patches into v3.8-rc7. This version does not have the patches that upgraded the VMBUS protocol version to the win8 levels.

What is "this version"?

I looked at the tree that Peter checked in the patches:

https://git.kernel.org/?p=linux/kernel/git/tip/tip.git;a=shortlog;h=refs/heads/x86/hyperv

The code under drivers/hv is not the current tip code in your tree. That is the reason, I don't think this patch: [PATCH 1/1] Drivers: hv: vmbus: Use the new infrastructure for delivering VMBUS interrupts should go into Peter's tree.

Quoted 6 lines
Quoted 4 lines

How will the infrastructural patches get moved forward to the version where you have checked-in all the vmbus protocol updates:
[PATCH 00/28] Drivers: hv: Update the Vmbus protocol.

Those are in the char-misc git tree and will to go Linus for 3.9-rc1.

The patches that Peter checked in have no dependence on the vmbus patches
that you have checked into 3.9-rc1. My question was with regards to how the patches that Peter has checked in to 3.8-rc7 will be merged into 3.9-rc1. If the patches that Peter checked are going to show up in 3.9 rc1, then that would be perfect.

Quoted 5 lines
Quoted 3 lines

Now that Peter has checked in the needed patches, could you take this patch through your tree.

What again is "this"?

"this" is the current patch in this email:
[PATCH 1/1] Drivers: hv: vmbus: Use the new infrastructure for delivering VMBUS interrupts

As noted earlier, this patch requires the patches that Peter has now checked into 3.8 rc7. If these are going to be merged with 3.9-rc1, then you can pick up the patch titled:

[PATCH 1/1] Drivers: hv: vmbus: Use the new infrastructure for delivering VMBUS interrupts

Quoted 5 lines
Quoted 2 lines

Let me know, if you need, I can re-send this patch to you.

Will it cause build problems if I take this patch in my tree, without the changes in the -tip tree?

You need to first pick up the patches that Peter has check in.

Regards,

K. Y

#11 lore raw

Sounds like we have the joy of a cross-tree dependency...

-hpa

Signature · 2 lines
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel.  I don't speak on their behalf.
#12 lore raw
Quoted 1 line · H. Peter Anvin

Sounds like we have the joy of a cross-tree dependency...

Yeah, a mess.

KY, how about I just wait until all of this gets merged with Linus for 3.9-rc1, and then you resend me the patches you have to take advantage of these new bits? That makes it easy for everyone involved.

thanks,

greg k-h

#13 lore raw
Quoted 12 lines

-----Original Message-----
From: Greg KH [mailto:[email protected]]
Sent: Wednesday, February 13, 2013 1:24 PM
To: H. Peter Anvin
Cc: KY Srinivasan; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: [PATCH 1/1] Drivers: hv: vmbus: Use the new infrastructure for delivering VMBUS interrupts

Quoted 2 lines
Quoted 1 line · H. Peter Anvin

Sounds like we have the joy of a cross-tree dependency...

Fortunately, the dependency order is "right".

Quoted 6 lines

Yeah, a mess.

KY, how about I just wait until all of this gets merged with Linus for 3.9-rc1, and then you resend me the patches you have to take advantage of these new bits? That makes it easy for everyone involved.

Sounds good. I have only one patch that is needed to take advantage of the patches that Peter has checked in. I will resend you this patch once 3.9-rc1 catches up with the tip. Would you know when 3.9 would catch up with the tip.

Regards,

K. Y

#14 lore raw
In reply to Greg KH
Quoted 9 lines · Greg KH
Quoted 1 line · H. Peter Anvin

Sounds like we have the joy of a cross-tree dependency...

Yeah, a mess.

KY, how about I just wait until all of this gets merged with Linus for 3.9-rc1, and then you resend me the patches you have to take advantage of these new bits? That makes it easy for everyone involved.

The other option is you can pull tip:x86/hyperv from me... it has *only* these changes. I can then let you push them to Linus or I can push them to Linus before you push your tree.

-hpa

#15 lore raw
Quoted 6 lines · H. Peter Anvin
Quoted 5 lines · Greg KH
Quoted 1 line · H. Peter Anvin

Sounds like we have the joy of a cross-tree dependency...

Yeah, a mess.

Quoted 8 lines
Quoted 4 lines

KY, how about I just wait until all of this gets merged with Linus for 3.9-rc1, and then you resend me the patches you have to take advantage of these new bits? That makes it easy for everyone involved.

The other option is you can pull tip:x86/hyperv from me... it has *only* these changes. I can then let you push them to Linus or I can push them to Linus before you push your tree.

Nah, I'll just wait, it's not that big of a deal here, it will all make it into 3.9-final eventually.

greg k-h

#16 lore raw
Quoted 24 lines

-----Original Message-----
From: Greg KH [mailto:[email protected]]
Sent: Wednesday, February 13, 2013 1:53 PM
To: H. Peter Anvin
Cc: KY Srinivasan; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: [PATCH 1/1] Drivers: hv: vmbus: Use the new infrastructure for delivering VMBUS interrupts

Quoted 11 lines · H. Peter Anvin
Quoted 9 lines · Greg KH
Quoted 1 line · H. Peter Anvin

Sounds like we have the joy of a cross-tree dependency...

Yeah, a mess.

KY, how about I just wait until all of this gets merged with Linus for 3.9-rc1, and then you resend me the patches you have to take advantage of these new bits? That makes it easy for everyone involved.

Quoted 6 lines
Quoted 3 lines

The other option is you can pull tip:x86/hyperv from me... it has *only* these changes. I can then let you push them to Linus or I can push them to Linus before you push your tree.

Nah, I'll just wait, it's not that big of a deal here, it will all make it into 3.9-final eventually.

Peter's check-ins are now in Linux-next. Should I send you the vmbus patch that uses this infrastructure.

Regards,

K. Y

#17 lore raw
Quoted 28 lines · KY Srinivasan
Quoted 28 lines

-----Original Message-----
From: Greg KH [mailto:[email protected]]
Sent: Wednesday, February 13, 2013 1:53 PM
To: H. Peter Anvin
Cc: KY Srinivasan; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: [PATCH 1/1] Drivers: hv: vmbus: Use the new infrastructure for delivering VMBUS interrupts

Quoted 14 lines · H. Peter Anvin
Quoted 9 lines · Greg KH
Quoted 1 line · H. Peter Anvin

Sounds like we have the joy of a cross-tree dependency...

Yeah, a mess.

KY, how about I just wait until all of this gets merged with Linus for 3.9-rc1, and then you resend me the patches you have to take advantage of these new bits? That makes it easy for everyone involved.

The other option is you can pull tip:x86/hyperv from me... it has *only* these changes. I can then let you push them to Linus or I can push them to Linus before you push your tree.

Quoted 5 lines
Quoted 2 lines

Nah, I'll just wait, it's not that big of a deal here, it will all make it into 3.9-final eventually.

Peter's check-ins are now in Linux-next. Should I send you the vmbus patch that uses this infrastructure.

No one can base their tree on linux-next, so no. Please wait for them to get into Linus's tree.

Or send them to me now, with the instructions to apply them after 3.9-rc1, and I will save them for that point in time.

thanks,

greg k-h

#18 lore raw
Quoted 45 lines

-----Original Message-----
From: Greg KH [mailto:[email protected]]
Sent: Sunday, February 17, 2013 1:25 PM
To: KY Srinivasan
Cc: H. Peter Anvin; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: [PATCH 1/1] Drivers: hv: vmbus: Use the new infrastructure for delivering VMBUS interrupts

Quoted 9 lines · KY Srinivasan
Quoted 9 lines

-----Original Message-----
From: Greg KH [mailto:[email protected]]
Sent: Wednesday, February 13, 2013 1:53 PM
To: H. Peter Anvin
Cc: KY Srinivasan; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected];

[email protected]

Quoted 22 lines
Quoted 21 lines

Subject: Re: [PATCH 1/1] Drivers: hv: vmbus: Use the new infrastructure for delivering VMBUS interrupts

Quoted 6 lines · H. Peter Anvin
Quoted 5 lines · Greg KH
Quoted 1 line · H. Peter Anvin

Sounds like we have the joy of a cross-tree dependency...

Yeah, a mess.

Quoted 8 lines
Quoted 4 lines

KY, how about I just wait until all of this gets merged with Linus for 3.9-rc1, and then you resend me the patches you have to take advantage of these new bits? That makes it easy for everyone involved.

The other option is you can pull tip:x86/hyperv from me... it has *only* these changes. I can then let you push them to Linus or I can push them to Linus before you push your tree.

Nah, I'll just wait, it's not that big of a deal here, it will all make it into 3.9-final eventually.

Quoted 8 lines
Quoted 2 lines

Peter's check-ins are now in Linux-next. Should I send you the vmbus patch that uses this infrastructure.

No one can base their tree on linux-next, so no. Please wait for them to get into Linus's tree.

Or send them to me now, with the instructions to apply them after 3.9-rc1, and I will save them for that point in time.

Thanks Greg. Will do.

K. Y

Quoted 5 lines

thanks,

greg k-h

#19 lore raw
Quoted 9 lines · KY Srinivasan
Quoted 6 lines

No one can base their tree on linux-next, so no. Please wait for them to get into Linus's tree.

Or send them to me now, with the instructions to apply them after 3.9-rc1, and I will save them for that point in time.

Thanks Greg. Will do.

As I said, I'm also perfectly happy to have you take over the tip:x86/hyperv branch for this cycle...

-hpa

Signature · 2 lines
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel.  I don't speak on their behalf.