Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755107AbbGFMM5 (ORCPT ); Mon, 6 Jul 2015 08:12:57 -0400 Received: from mail-wg0-f43.google.com ([74.125.82.43]:35510 "EHLO mail-wg0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754923AbbGFMMI (ORCPT ); Mon, 6 Jul 2015 08:12:08 -0400 From: Eric Auger To: eric.auger@st.com, eric.auger@linaro.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, christoffer.dall@linaro.org, marc.zyngier@arm.com, alex.williamson@redhat.com, pbonzini@redhat.com, avi.kivity@gmail.com, mtosatti@redhat.com, feng.wu@intel.com, joro@8bytes.org, b.reynal@virtualopensystems.com Cc: linux-kernel@vger.kernel.org, patches@linaro.org Subject: [RFC v2 5/6] KVM: introduce kvm_arch functions for IRQ bypass Date: Mon, 6 Jul 2015 14:11:31 +0200 Message-Id: <1436184692-20927-6-git-send-email-eric.auger@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1436184692-20927-1-git-send-email-eric.auger@linaro.org> References: <1436184692-20927-1-git-send-email-eric.auger@linaro.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2780 Lines: 96 This patch introduces - kvm_arch_irq_bypass_add_producer - kvm_arch_irq_bypass_del_producer - kvm_arch_irq_bypass_stop - kvm_arch_irq_bypass_resume - kvm_arch_irq_bypass_update They make possible to specialize the KVM IRQ bypass consumer in case CONFIG_KVM_HAVE_IRQ_BYPASS is set. Signed-off-by: Eric Auger --- 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 | 37 +++++++++++++++++++++++++++++++++++++ virt/kvm/Kconfig | 3 +++ 2 files changed, 40 insertions(+) diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index 9564fd7..91a5734 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h @@ -24,6 +24,7 @@ #include #include #include +#include #include #include @@ -1133,5 +1134,41 @@ 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 + +void 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_resume(struct irq_bypass_consumer *); +void kvm_arch_irq_bypass_update(struct irq_bypass_consumer *); + +#else + +static inline void kvm_arch_irq_bypass_add_producer( + struct irq_bypass_consumer *cons, + struct irq_bypass_producer *prod) +{ +} +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_resume( + struct irq_bypass_consumer *cons) +{ +} +static inline void kvm_arch_irq_bypass_update( + 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 -- 1.9.1 -- 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/