From patchwork Mon Aug 3 17:20:43 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Auger Eric X-Patchwork-Id: 51877 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f197.google.com (mail-wi0-f197.google.com [209.85.212.197]) by patches.linaro.org (Postfix) with ESMTPS id B0CDD229FD for ; Mon, 3 Aug 2015 17:21:50 +0000 (UTC) Received: by wibdx1 with SMTP id dx1sf29624884wib.2 for ; Mon, 03 Aug 2015 10:21:50 -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=rhE+pNws+9i2wVHkZ9CO+AUK3bA1GYPxCe74ukY1Hg0=; b=PafNwdTc05xGc2S7HrpqNJZC8uSw+1ccZNBR+C+s04eqc/SfXi8arBtT1kwtiC1l8O d3c4NgOTxvkKOa8krBK3Ko8/QFS3cPm8D8+V9hzn6M2pnlcSSJ89EHXmA1t+lnfZKbBA V8HuGBOUvdIZMlKBCdmi1TmDFh+NZlhfbbMSRzsMyCxB0NRB6D8GngcChIk3VTJ9bAdP Q9enYUbnL1qtpjLjBAYyaj4ypHrGqHtnPZI/ajV9nQG8GReq2TKhmmRbrpcppkEIeHd5 rOJ9+WTbP9614a4U0ZL+PXASc6SgD6joT4EZ5SvkIHPJfsJKhXXdQ2IGaQ5fotJRIXAB WBdg== X-Gm-Message-State: ALoCoQkwVuHY9IyeN+nxHUEkAsV2sBdOlyyiH8U8UGlYL8dQpdk+U/GR/HVkuhTyy14iWZoA7Mss X-Received: by 10.180.160.133 with SMTP id xk5mr6175224wib.1.1438622510038; Mon, 03 Aug 2015 10:21:50 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.170.195 with SMTP id ao3ls665881lac.53.gmail; Mon, 03 Aug 2015 10:21:49 -0700 (PDT) X-Received: by 10.152.6.102 with SMTP id z6mr17599288laz.95.1438622509747; Mon, 03 Aug 2015 10:21:49 -0700 (PDT) Received: from mail-lb0-f169.google.com (mail-lb0-f169.google.com. [209.85.217.169]) by mx.google.com with ESMTPS id y12si12561167lbm.75.2015.08.03.10.21.49 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Aug 2015 10:21:49 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.169 as permitted sender) client-ip=209.85.217.169; Received: by lbbpo9 with SMTP id po9so7736455lbb.2 for ; Mon, 03 Aug 2015 10:21:49 -0700 (PDT) X-Received: by 10.152.5.228 with SMTP id v4mr18050633lav.36.1438622509653; Mon, 03 Aug 2015 10:21:49 -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.7.198 with SMTP id l6csp1982290lba; Mon, 3 Aug 2015 10:21:49 -0700 (PDT) X-Received: by 10.194.90.171 with SMTP id bx11mr34404744wjb.129.1438622504320; Mon, 03 Aug 2015 10:21:44 -0700 (PDT) Received: from mail-wi0-f175.google.com (mail-wi0-f175.google.com. [209.85.212.175]) by mx.google.com with ESMTPS id b14si26813551wjz.87.2015.08.03.10.21.44 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Aug 2015 10:21:44 -0700 (PDT) Received-SPF: pass (google.com: domain of eric.auger@linaro.org designates 209.85.212.175 as permitted sender) client-ip=209.85.212.175; Received: by wibud3 with SMTP id ud3so144900243wib.1 for ; Mon, 03 Aug 2015 10:21:44 -0700 (PDT) X-Received: by 10.194.84.211 with SMTP id b19mr619370wjz.120.1438622503828; Mon, 03 Aug 2015 10:21:43 -0700 (PDT) Received: from gnx2579.home (LCaen-156-56-7-90.w80-11.abo.wanadoo.fr. [80.11.198.90]) by smtp.gmail.com with ESMTPSA id uo6sm23887512wjc.1.2015.08.03.10.21.41 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Aug 2015 10:21:42 -0700 (PDT) From: Eric Auger To: eric.auger@st.com, eric.auger@linaro.org, alex.williamson@redhat.com, feng.wu@intel.com, pbonzini@redhat.com, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org Cc: 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 Subject: [PATCH v4 4/5] KVM: introduce kvm_arch functions for IRQ bypass Date: Mon, 3 Aug 2015 19:20:43 +0200 Message-Id: <1438622444-25444-5-git-send-email-eric.auger@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1438622444-25444-1-git-send-email-eric.auger@linaro.org> References: <1438622444-25444-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.217.169 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_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 + +static inline int kvm_arch_irq_bypass_add_producer( + struct irq_bypass_consumer *cons, + struct irq_bypass_producer *prod) +{ + return -1; +} +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