Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753941AbbHGUJR (ORCPT ); Fri, 7 Aug 2015 16:09:17 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42094 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751373AbbHGUJQ (ORCPT ); Fri, 7 Aug 2015 16:09:16 -0400 Message-ID: <1438978154.4023.262.camel@redhat.com> Subject: Re: [PATCH v4 4/5] KVM: introduce kvm_arch functions for IRQ bypass From: Alex Williamson To: Eric Auger Cc: eric.auger@st.com, feng.wu@intel.com, pbonzini@redhat.com, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, avi.kivity@gmail.com, mtosatti@redhat.com, joro@8bytes.org, marc.zyngier@arm.com, christoffer.dall@linaro.org, linux-kernel@vger.kernel.org, patches@linaro.org Date: Fri, 07 Aug 2015 14:09:14 -0600 In-Reply-To: <1438622444-25444-5-git-send-email-eric.auger@linaro.org> References: <1438622444-25444-1-git-send-email-eric.auger@linaro.org> <1438622444-25444-5-git-send-email-eric.auger@linaro.org> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3341 Lines: 109 On Mon, 2015-08-03 at 19:20 +0200, Eric Auger wrote: > This patch introduces > - kvm_arch_irq_bypass_add_producer > - kvm_arch_irq_bypass_del_producer > - kvm_arch_irq_bypass_stop > - kvm_arch_irq_bypass_start > > They make possible to specialize the KVM IRQ bypass consumer in > case CONFIG_KVM_HAVE_IRQ_BYPASS is set. > > Signed-off-by: Eric Auger > Signed-off-by: Feng Wu > > --- > > v2 -> v3 (Feng Wu): > - use 'kvm_arch_irq_bypass_start' instead of 'kvm_arch_irq_bypass_resume' > - Remove 'kvm_arch_irq_bypass_update', which is not needed to be > a irqbypass callback per Alex's comments. > - Make kvm_arch_irq_bypass_add_producer return 'int' > > v1 -> v2: > - use CONFIG_KVM_HAVE_IRQ_BYPASS instead CONFIG_IRQ_BYPASS_MANAGER > - rename all functions according to Paolo's proposal > - add kvm_arch_irq_bypass_update according to Feng's need > --- > include/linux/kvm_host.h | 33 +++++++++++++++++++++++++++++++++ > virt/kvm/Kconfig | 3 +++ > 2 files changed, 36 insertions(+) > > diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h > index 05e99b8..84b5feb 100644 > --- a/include/linux/kvm_host.h > +++ b/include/linux/kvm_host.h > @@ -24,6 +24,7 @@ > #include > #include > #include > +#include > #include > > #include > @@ -1151,5 +1152,37 @@ static inline void kvm_vcpu_set_dy_eligible(struct kvm_vcpu *vcpu, bool val) > { > } > #endif /* CONFIG_HAVE_KVM_CPU_RELAX_INTERCEPT */ > + > +#ifdef CONFIG_HAVE_KVM_IRQ_BYPASS > + > +int kvm_arch_irq_bypass_add_producer(struct irq_bypass_consumer *, > + struct irq_bypass_producer *); > +void kvm_arch_irq_bypass_del_producer(struct irq_bypass_consumer *, > + struct irq_bypass_producer *); > +void kvm_arch_irq_bypass_stop(struct irq_bypass_consumer *); > +void kvm_arch_irq_bypass_start(struct irq_bypass_consumer *); > + > +#else Do we really need static inline stubs? When would they get used? How would they work since we call them via function pointers? > + > +static inline int kvm_arch_irq_bypass_add_producer( > + struct irq_bypass_consumer *cons, > + struct irq_bypass_producer *prod) > +{ > + return -1; No reason not to stick with standard errno values, is there? -EINVAL Thanks, Alex > +} > +static inline void kvm_arch_irq_bypass_del_producer( > + struct irq_bypass_consumer *cons, > + struct irq_bypass_producer *prod) > +{ > +} > +static inline void kvm_arch_irq_bypass_stop( > + struct irq_bypass_consumer *cons) > +{ > +} > +static inline void kvm_arch_irq_bypass_start( > + struct irq_bypass_consumer *cons) > +{ > +} > +#endif /* CONFIG_HAVE_KVM_IRQ_BYPASS */ > #endif > > diff --git a/virt/kvm/Kconfig b/virt/kvm/Kconfig > index e2c876d..9f8014d 100644 > --- a/virt/kvm/Kconfig > +++ b/virt/kvm/Kconfig > @@ -47,3 +47,6 @@ config KVM_GENERIC_DIRTYLOG_READ_PROTECT > config KVM_COMPAT > def_bool y > depends on COMPAT && !S390 > + > +config HAVE_KVM_IRQ_BYPASS > + bool -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/