Re: [PATCH 0/6] IRQFD without IRQ routing, enabled for XICS
On Wed, Aug 06, 2014 at 02:35:29PM +0200, Paolo Bonzini wrote: This doesn't build without CONFIG_KVM_XICS, so I had to apply a fixup patch to move some code from being under CONFIG_HAVE_KVM_IRQCHIP or unconditional, to being conditional on CONFIG_HAVE_KVM_IRQFD. I'll send the patch shortly. Oops, sorry, thanks for fixing it up. Also, please look into adding a trace_kvm_set_irq call to kvm_set_irq in arch/powerpc/kvm/book3s_xics.c. I would have preferred these snags to be fixed before (especially since the breakage is simply with make ppc64_defconfig), but it's partly my fault for delaying the review for so long. And the series is good work ... and I have been on vacation for the past three weeks, which didn't help either. and a very nice cleanup of the irqfd architecture. Assuming that the linux-next merge from tomorrow is fine, I'll send the second pull request to Linus. Thanks, Paul. -- To unsubscribe from this list: send the line unsubscribe kvm-ppc in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 0/6] IRQFD without IRQ routing, enabled for XICS
Il 05/08/2014 14:27, Paolo Bonzini ha scritto: Il 30/06/2014 12:51, Paul Mackerras ha scritto: This series of patches provides a way to implement IRQFD support without having to implement IRQ routing, and adds IRQFD support for the XICS interrupt controller emulation. (XICS is the interrupt controller defined for the pSeries machine type, used on IBM POWER servers). The basic approach is to make it easy for code other than irqchip.c to provide a mapping from a global interrupt number (GSI) to an irq routing entry (struct kvm_kernel_irq_routing_entry). To make the lifetime of this routing entry easier to manage, we change the IRQFD code to keep a copy of the routing entry (for the MSI fast-path case) rather than a pointer to the routing entry. Since the copy can't be updated atomically, we add a seqcount_t to make sure that when reading it we get a copy that hasn't been half-way updated. Next we replace the hard-coded accesses outside irqchip.c to the fields of the kvm_irq_routing_table struct with calls to accessor functions in irqchip.c, namely kvm_irq_map_gsi() and kvm_irq_map_chip_pin(). That enables us to move all references to the kvm_irq_routing_table struct, and the definition of that struct, into irqchip.c. Then we move the irq notifier implementation from irqchip.c into eventfd.c and add a separate Kconfig option to enable IRQFD. With that we can enable IRQFD without irq routing, which we achieve by compiling in eventfd.c but not irqchip.c, and providing an alternative implementation of kvm_irq_map_gsi() and kvm_irq_map_chip_pin(). The last patch does that for XICS. With this series I can use vhost-net with KVM guests, and I see the TCP bandwidth between guest and host on a POWER8 machine go from around 700MB/s to over 2GB/s. I would like to see this go into 3.17. arch/ia64/kvm/Kconfig| 1 + arch/powerpc/kvm/Kconfig | 3 + arch/powerpc/kvm/book3s_hv_rm_xics.c | 5 ++ arch/powerpc/kvm/book3s_xics.c | 55 +++--- arch/powerpc/kvm/book3s_xics.h | 2 + arch/powerpc/kvm/mpic.c | 4 +- arch/s390/kvm/Kconfig| 1 + arch/s390/kvm/interrupt.c| 3 +- arch/x86/kvm/Kconfig | 1 + include/linux/kvm_host.h | 43 --- virt/kvm/Kconfig | 3 + virt/kvm/eventfd.c | 134 ++- virt/kvm/irq_comm.c | 24 +++ virt/kvm/irqchip.c | 98 ++--- virt/kvm/kvm_main.c | 2 +- 15 files changed, 227 insertions(+), 152 deletions(-) Applied for 3.17, thanks Eric and Cornelia for testing. Paolo -- To unsubscribe from this list: send the line unsubscribe kvm in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html This doesn't build without CONFIG_KVM_XICS, so I had to apply a fixup patch to move some code from being under CONFIG_HAVE_KVM_IRQCHIP or unconditional, to being conditional on CONFIG_HAVE_KVM_IRQFD. I'll send the patch shortly. Also, please look into adding a trace_kvm_set_irq call to kvm_set_irq in arch/powerpc/kvm/book3s_xics.c. I would have preferred these snags to be fixed before (especially since the breakage is simply with make ppc64_defconfig), but it's partly my fault for delaying the review for so long. And the series is good work and a very nice cleanup of the irqfd architecture. Assuming that the linux-next merge from tomorrow is fine, I'll send the second pull request to Linus. Paolo -- To unsubscribe from this list: send the line unsubscribe kvm-ppc in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 0/6] IRQFD without IRQ routing, enabled for XICS
Il 30/06/2014 12:51, Paul Mackerras ha scritto: This series of patches provides a way to implement IRQFD support without having to implement IRQ routing, and adds IRQFD support for the XICS interrupt controller emulation. (XICS is the interrupt controller defined for the pSeries machine type, used on IBM POWER servers). The basic approach is to make it easy for code other than irqchip.c to provide a mapping from a global interrupt number (GSI) to an irq routing entry (struct kvm_kernel_irq_routing_entry). To make the lifetime of this routing entry easier to manage, we change the IRQFD code to keep a copy of the routing entry (for the MSI fast-path case) rather than a pointer to the routing entry. Since the copy can't be updated atomically, we add a seqcount_t to make sure that when reading it we get a copy that hasn't been half-way updated. Next we replace the hard-coded accesses outside irqchip.c to the fields of the kvm_irq_routing_table struct with calls to accessor functions in irqchip.c, namely kvm_irq_map_gsi() and kvm_irq_map_chip_pin(). That enables us to move all references to the kvm_irq_routing_table struct, and the definition of that struct, into irqchip.c. Then we move the irq notifier implementation from irqchip.c into eventfd.c and add a separate Kconfig option to enable IRQFD. With that we can enable IRQFD without irq routing, which we achieve by compiling in eventfd.c but not irqchip.c, and providing an alternative implementation of kvm_irq_map_gsi() and kvm_irq_map_chip_pin(). The last patch does that for XICS. With this series I can use vhost-net with KVM guests, and I see the TCP bandwidth between guest and host on a POWER8 machine go from around 700MB/s to over 2GB/s. I would like to see this go into 3.17. arch/ia64/kvm/Kconfig| 1 + arch/powerpc/kvm/Kconfig | 3 + arch/powerpc/kvm/book3s_hv_rm_xics.c | 5 ++ arch/powerpc/kvm/book3s_xics.c | 55 +++--- arch/powerpc/kvm/book3s_xics.h | 2 + arch/powerpc/kvm/mpic.c | 4 +- arch/s390/kvm/Kconfig| 1 + arch/s390/kvm/interrupt.c| 3 +- arch/x86/kvm/Kconfig | 1 + include/linux/kvm_host.h | 43 --- virt/kvm/Kconfig | 3 + virt/kvm/eventfd.c | 134 ++- virt/kvm/irq_comm.c | 24 +++ virt/kvm/irqchip.c | 98 ++--- virt/kvm/kvm_main.c | 2 +- 15 files changed, 227 insertions(+), 152 deletions(-) Applied for 3.17, thanks Eric and Cornelia for testing. Paolo -- To unsubscribe from this list: send the line unsubscribe kvm-ppc in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 0/6] IRQFD without IRQ routing, enabled for XICS
Hi Paul, I also confirm your patch works fine on my ARM test environment. I was able to run - with irqchip without regression - without irqchip (ie removing routing totally), just implementing identity kvm_irq_map_gsi and kvm_irq_map_chip_pin and proper kvm_set_irq. The overall integration becomes much simpler :-) Many thanks Best Regards Eric On 07/14/2014 04:18 PM, Cornelia Huck wrote: On Mon, 30 Jun 2014 20:51:08 +1000 Paul Mackerras pau...@samba.org wrote: I would like to see this go into 3.17. FWIW: I've given this a whirl on s390 (with a dataplane disk), and everything seems to work as before. The only thing which is I think worth mentioning is that embedding the routing entry into the irqfd struct will grow it a bit, which might be noticable on large installations with hundreds of devices. OTOH, the routing entry isn't too large, so I don't think it will become a problem. arch/ia64/kvm/Kconfig| 1 + arch/powerpc/kvm/Kconfig | 3 + arch/powerpc/kvm/book3s_hv_rm_xics.c | 5 ++ arch/powerpc/kvm/book3s_xics.c | 55 +++--- arch/powerpc/kvm/book3s_xics.h | 2 + arch/powerpc/kvm/mpic.c | 4 +- arch/s390/kvm/Kconfig| 1 + arch/s390/kvm/interrupt.c| 3 +- arch/x86/kvm/Kconfig | 1 + include/linux/kvm_host.h | 43 --- virt/kvm/Kconfig | 3 + virt/kvm/eventfd.c | 134 ++- virt/kvm/irq_comm.c | 24 +++ virt/kvm/irqchip.c | 98 ++--- virt/kvm/kvm_main.c | 2 +- 15 files changed, 227 insertions(+), 152 deletions(-) -- To unsubscribe from this list: send the line unsubscribe kvm-ppc in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 0/6] IRQFD without IRQ routing, enabled for XICS
On Mon, 30 Jun 2014 20:51:08 +1000 Paul Mackerras pau...@samba.org wrote: I would like to see this go into 3.17. FWIW: I've given this a whirl on s390 (with a dataplane disk), and everything seems to work as before. The only thing which is I think worth mentioning is that embedding the routing entry into the irqfd struct will grow it a bit, which might be noticable on large installations with hundreds of devices. OTOH, the routing entry isn't too large, so I don't think it will become a problem. arch/ia64/kvm/Kconfig| 1 + arch/powerpc/kvm/Kconfig | 3 + arch/powerpc/kvm/book3s_hv_rm_xics.c | 5 ++ arch/powerpc/kvm/book3s_xics.c | 55 +++--- arch/powerpc/kvm/book3s_xics.h | 2 + arch/powerpc/kvm/mpic.c | 4 +- arch/s390/kvm/Kconfig| 1 + arch/s390/kvm/interrupt.c| 3 +- arch/x86/kvm/Kconfig | 1 + include/linux/kvm_host.h | 43 --- virt/kvm/Kconfig | 3 + virt/kvm/eventfd.c | 134 ++- virt/kvm/irq_comm.c | 24 +++ virt/kvm/irqchip.c | 98 ++--- virt/kvm/kvm_main.c | 2 +- 15 files changed, 227 insertions(+), 152 deletions(-) -- To unsubscribe from this list: send the line unsubscribe kvm-ppc in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 0/6] IRQFD without IRQ routing, enabled for XICS
Ping? There have been no comments on this patch series in two weeks, except for Alex's comment that was mostly positive. Could someone put it into the kvm tree please? Thanks, Paul. On Mon, Jun 30, 2014 at 08:51:08PM +1000, Paul Mackerras wrote: This series of patches provides a way to implement IRQFD support without having to implement IRQ routing, and adds IRQFD support for the XICS interrupt controller emulation. (XICS is the interrupt controller defined for the pSeries machine type, used on IBM POWER servers). The basic approach is to make it easy for code other than irqchip.c to provide a mapping from a global interrupt number (GSI) to an irq routing entry (struct kvm_kernel_irq_routing_entry). To make the lifetime of this routing entry easier to manage, we change the IRQFD code to keep a copy of the routing entry (for the MSI fast-path case) rather than a pointer to the routing entry. Since the copy can't be updated atomically, we add a seqcount_t to make sure that when reading it we get a copy that hasn't been half-way updated. Next we replace the hard-coded accesses outside irqchip.c to the fields of the kvm_irq_routing_table struct with calls to accessor functions in irqchip.c, namely kvm_irq_map_gsi() and kvm_irq_map_chip_pin(). That enables us to move all references to the kvm_irq_routing_table struct, and the definition of that struct, into irqchip.c. Then we move the irq notifier implementation from irqchip.c into eventfd.c and add a separate Kconfig option to enable IRQFD. With that we can enable IRQFD without irq routing, which we achieve by compiling in eventfd.c but not irqchip.c, and providing an alternative implementation of kvm_irq_map_gsi() and kvm_irq_map_chip_pin(). The last patch does that for XICS. With this series I can use vhost-net with KVM guests, and I see the TCP bandwidth between guest and host on a POWER8 machine go from around 700MB/s to over 2GB/s. I would like to see this go into 3.17. arch/ia64/kvm/Kconfig| 1 + arch/powerpc/kvm/Kconfig | 3 + arch/powerpc/kvm/book3s_hv_rm_xics.c | 5 ++ arch/powerpc/kvm/book3s_xics.c | 55 +++--- arch/powerpc/kvm/book3s_xics.h | 2 + arch/powerpc/kvm/mpic.c | 4 +- arch/s390/kvm/Kconfig| 1 + arch/s390/kvm/interrupt.c| 3 +- arch/x86/kvm/Kconfig | 1 + include/linux/kvm_host.h | 43 --- virt/kvm/Kconfig | 3 + virt/kvm/eventfd.c | 134 ++- virt/kvm/irq_comm.c | 24 +++ virt/kvm/irqchip.c | 98 ++--- virt/kvm/kvm_main.c | 2 +- 15 files changed, 227 insertions(+), 152 deletions(-) -- To unsubscribe from this list: send the line unsubscribe kvm-ppc in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html -- To unsubscribe from this list: send the line unsubscribe kvm-ppc in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 0/6] IRQFD without IRQ routing, enabled for XICS
This series of patches provides a way to implement IRQFD support without having to implement IRQ routing, and adds IRQFD support for the XICS interrupt controller emulation. (XICS is the interrupt controller defined for the pSeries machine type, used on IBM POWER servers). The basic approach is to make it easy for code other than irqchip.c to provide a mapping from a global interrupt number (GSI) to an irq routing entry (struct kvm_kernel_irq_routing_entry). To make the lifetime of this routing entry easier to manage, we change the IRQFD code to keep a copy of the routing entry (for the MSI fast-path case) rather than a pointer to the routing entry. Since the copy can't be updated atomically, we add a seqcount_t to make sure that when reading it we get a copy that hasn't been half-way updated. Next we replace the hard-coded accesses outside irqchip.c to the fields of the kvm_irq_routing_table struct with calls to accessor functions in irqchip.c, namely kvm_irq_map_gsi() and kvm_irq_map_chip_pin(). That enables us to move all references to the kvm_irq_routing_table struct, and the definition of that struct, into irqchip.c. Then we move the irq notifier implementation from irqchip.c into eventfd.c and add a separate Kconfig option to enable IRQFD. With that we can enable IRQFD without irq routing, which we achieve by compiling in eventfd.c but not irqchip.c, and providing an alternative implementation of kvm_irq_map_gsi() and kvm_irq_map_chip_pin(). The last patch does that for XICS. With this series I can use vhost-net with KVM guests, and I see the TCP bandwidth between guest and host on a POWER8 machine go from around 700MB/s to over 2GB/s. I would like to see this go into 3.17. arch/ia64/kvm/Kconfig| 1 + arch/powerpc/kvm/Kconfig | 3 + arch/powerpc/kvm/book3s_hv_rm_xics.c | 5 ++ arch/powerpc/kvm/book3s_xics.c | 55 +++--- arch/powerpc/kvm/book3s_xics.h | 2 + arch/powerpc/kvm/mpic.c | 4 +- arch/s390/kvm/Kconfig| 1 + arch/s390/kvm/interrupt.c| 3 +- arch/x86/kvm/Kconfig | 1 + include/linux/kvm_host.h | 43 --- virt/kvm/Kconfig | 3 + virt/kvm/eventfd.c | 134 ++- virt/kvm/irq_comm.c | 24 +++ virt/kvm/irqchip.c | 98 ++--- virt/kvm/kvm_main.c | 2 +- 15 files changed, 227 insertions(+), 152 deletions(-) -- To unsubscribe from this list: send the line unsubscribe kvm-ppc in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 0/6] IRQFD without IRQ routing, enabled for XICS
On 30.06.14 12:51, Paul Mackerras wrote: This series of patches provides a way to implement IRQFD support without having to implement IRQ routing, and adds IRQFD support for the XICS interrupt controller emulation. (XICS is the interrupt controller defined for the pSeries machine type, used on IBM POWER servers). The basic approach is to make it easy for code other than irqchip.c to provide a mapping from a global interrupt number (GSI) to an irq routing entry (struct kvm_kernel_irq_routing_entry). To make the lifetime of this routing entry easier to manage, we change the IRQFD code to keep a copy of the routing entry (for the MSI fast-path case) rather than a pointer to the routing entry. Since the copy can't be updated atomically, we add a seqcount_t to make sure that when reading it we get a copy that hasn't been half-way updated. Next we replace the hard-coded accesses outside irqchip.c to the fields of the kvm_irq_routing_table struct with calls to accessor functions in irqchip.c, namely kvm_irq_map_gsi() and kvm_irq_map_chip_pin(). That enables us to move all references to the kvm_irq_routing_table struct, and the definition of that struct, into irqchip.c. Then we move the irq notifier implementation from irqchip.c into eventfd.c and add a separate Kconfig option to enable IRQFD. With that we can enable IRQFD without irq routing, which we achieve by compiling in eventfd.c but not irqchip.c, and providing an alternative implementation of kvm_irq_map_gsi() and kvm_irq_map_chip_pin(). The last patch does that for XICS. With this series I can use vhost-net with KVM guests, and I see the TCP bandwidth between guest and host on a POWER8 machine go from around 700MB/s to over 2GB/s. I would like to see this go into 3.17. I think this approach is good enough for XICS, as it has a 100% flat number space. I'm not yet fully convinced how well this would work out with the GIC, but I know that one too little to make claims. The only thing I disliked about this patch set is that it adds another piece of code that makes MPIC/XICS exclusive options. But I don't think that'd be hard to solve if we start caring. Overall, nice work. Alex -- To unsubscribe from this list: send the line unsubscribe kvm-ppc in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 0/6] IRQFD without IRQ routing, enabled for XICS
On Mon, Jun 30, 2014 at 02:43:56PM +0200, Alexander Graf wrote: On 30.06.14 12:51, Paul Mackerras wrote: This series of patches provides a way to implement IRQFD support without having to implement IRQ routing, and adds IRQFD support for the XICS interrupt controller emulation. (XICS is the interrupt controller defined for the pSeries machine type, used on IBM POWER servers). The basic approach is to make it easy for code other than irqchip.c to provide a mapping from a global interrupt number (GSI) to an irq routing entry (struct kvm_kernel_irq_routing_entry). To make the lifetime of this routing entry easier to manage, we change the IRQFD code to keep a copy of the routing entry (for the MSI fast-path case) rather than a pointer to the routing entry. Since the copy can't be updated atomically, we add a seqcount_t to make sure that when reading it we get a copy that hasn't been half-way updated. Next we replace the hard-coded accesses outside irqchip.c to the fields of the kvm_irq_routing_table struct with calls to accessor functions in irqchip.c, namely kvm_irq_map_gsi() and kvm_irq_map_chip_pin(). That enables us to move all references to the kvm_irq_routing_table struct, and the definition of that struct, into irqchip.c. Then we move the irq notifier implementation from irqchip.c into eventfd.c and add a separate Kconfig option to enable IRQFD. With that we can enable IRQFD without irq routing, which we achieve by compiling in eventfd.c but not irqchip.c, and providing an alternative implementation of kvm_irq_map_gsi() and kvm_irq_map_chip_pin(). The last patch does that for XICS. With this series I can use vhost-net with KVM guests, and I see the TCP bandwidth between guest and host on a POWER8 machine go from around 700MB/s to over 2GB/s. I would like to see this go into 3.17. I think this approach is good enough for XICS, as it has a 100% flat number space. I'm not yet fully convinced how well this would work out with the GIC, but I know that one too little to make claims. The only thing I disliked about this patch set is that it adds another piece of code that makes MPIC/XICS exclusive options. But I don't think that'd be hard to solve if we start caring. I agree. They were already exclusive, of course, and I just followed that pattern. I don't think I made it any harder to change that. The other thing this patch set does is make it a lot easier to change the data structures used by the IRQ routing implementation, for example to use idr structs rather than flat arrays, if we want to, or to implement range routing entries. Overall, nice work. Thanks. Paul. -- To unsubscribe from this list: send the line unsubscribe kvm-ppc in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html