From patchwork Mon Jul 6 12:11:31 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Auger X-Patchwork-Id: 6722621 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id F2D119F380 for ; Mon, 6 Jul 2015 12:14:35 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2C2A6205F2 for ; Mon, 6 Jul 2015 12:14:35 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 552BF2037E for ; Mon, 6 Jul 2015 12:14:34 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZC5Ga-0001Az-9a; Mon, 06 Jul 2015 12:12:56 +0000 Received: from mail-wi0-f173.google.com ([209.85.212.173]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZC5G8-0000iL-Vj for linux-arm-kernel@lists.infradead.org; Mon, 06 Jul 2015 12:12:29 +0000 Received: by widjy10 with SMTP id jy10so159009989wid.1 for ; Mon, 06 Jul 2015 05:12:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=CLBvjtZpKhL2rRccCX6legTQBJbI+qfvWVOoNa00r+s=; b=aFpTq/+DEsdoIwUn3UnT99niuDxEwlW2lcQ0ULee13eqc1/Rkhec7sk7oFsq1NRVln /wL5iaOEez6foE8BfQO6NqEEVoZDNtutMkOl5lfsJOWOG9zMfCGP9JSwJQJZG0jH6zX2 LUYhfisF1GL2fuw+eyj1Q5XQzC3w/WwmM2EdX64mmMUKIFyMKfHyVQtnddJ3HlJXyY1a JmeYzmv1SE6fdv6Pli1d1Znijz1F8lT6GEwZPv55Qbjo4cJjO3Jt1xwjimwX+VKlGiVS zXu6QU8AnpCuGXQOD1hv35biFd3JXiyK1awHaUQS7w92aJ+hnItus+tw1GQmCfmMbjvb cCwQ== X-Gm-Message-State: ALoCoQlOdtvPRgJPvsS+ITN0389u51hD5z5HbdZs1uVSatwZJu2IIeG9NlzhUYcKyVgSSrY7eDl0 X-Received: by 10.195.13.113 with SMTP id ex17mr99129317wjd.17.1436184727356; Mon, 06 Jul 2015 05:12:07 -0700 (PDT) Received: from gnx2579.home (LCaen-156-56-7-90.w80-11.abo.wanadoo.fr. [80.11.198.90]) by mx.google.com with ESMTPSA id v3sm27806709wja.31.2015.07.06.05.12.05 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Jul 2015 05:12:06 -0700 (PDT) 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 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150706_051229_174631_6393AC9B X-CRM114-Status: GOOD ( 13.02 ) X-Spam-Score: -2.6 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org, patches@linaro.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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