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: Auger Eric X-Patchwork-Id: 50739 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f70.google.com (mail-la0-f70.google.com [209.85.215.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 6903A229FC for ; Mon, 6 Jul 2015 12:12:15 +0000 (UTC) Received: by lagx9 with SMTP id x9sf46674191lag.2 for ; Mon, 06 Jul 2015 05:12:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=CLBvjtZpKhL2rRccCX6legTQBJbI+qfvWVOoNa00r+s=; b=Ep57REgWh7/qIyj2kIEYF0iI5s54cMYBWb4xTkPhSxLBlnlZaUFv1Dn7vSBDoPc+US 1lY2FtZQIn5jMiElBYREw/vIw5tjuIasPZeK0ttS+5NiWlw4k5HS2PEoFndzngSQJ5a2 AuUi8c1fXoO/T+6G8f+sRRW6Z3QZjNpTnPtDqusEjLZH6zoz2hjjfssDcwCFBFQJNLbF UWowm6XfOzl2xCLUm/34z1RL0WzBY42tTi4orMcHQ/QhYmQJhdrRMv1NQsscCwC7EU2f n2p83AA6jbWle9nDshAd3cU01XlDv/AmFEeej30mNHvTdv794gROkViG0rhLhC8+TJ5r uqRA== X-Gm-Message-State: ALoCoQkUeXpZvWzhu7q2tcYSaI+g19RqD39/QRv8ToYhHYQ3pbZsronJDklMkWyG08edmXtLyAlZ X-Received: by 10.112.42.236 with SMTP id r12mr30628347lbl.2.1436184734250; Mon, 06 Jul 2015 05:12:14 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.27.194 with SMTP id v2ls745015lag.59.gmail; Mon, 06 Jul 2015 05:12:14 -0700 (PDT) X-Received: by 10.112.190.10 with SMTP id gm10mr47431723lbc.2.1436184734035; Mon, 06 Jul 2015 05:12:14 -0700 (PDT) Received: from mail-la0-f43.google.com (mail-la0-f43.google.com. [209.85.215.43]) by mx.google.com with ESMTPS id ud5si15124168lac.28.2015.07.06.05.12.14 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Jul 2015 05:12:14 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.43 as permitted sender) client-ip=209.85.215.43; Received: by lazt12 with SMTP id t12so7039675laz.2 for ; Mon, 06 Jul 2015 05:12:14 -0700 (PDT) X-Received: by 10.152.5.197 with SMTP id u5mr9945648lau.76.1436184733944; Mon, 06 Jul 2015 05:12:13 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp1684348lbb; Mon, 6 Jul 2015 05:12:13 -0700 (PDT) X-Received: by 10.194.94.101 with SMTP id db5mr92334158wjb.91.1436184727670; Mon, 06 Jul 2015 05:12:07 -0700 (PDT) Received: from mail-wi0-f178.google.com (mail-wi0-f178.google.com. [209.85.212.178]) by mx.google.com with ESMTPS id ew7si33548456wic.100.2015.07.06.05.12.07 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Jul 2015 05:12:07 -0700 (PDT) Received-SPF: pass (google.com: domain of eric.auger@linaro.org designates 209.85.212.178 as permitted sender) client-ip=209.85.212.178; Received: by wiwl6 with SMTP id l6so282740814wiw.0 for ; Mon, 06 Jul 2015 05:12:07 -0700 (PDT) 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 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> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: eric.auger@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.43 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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