From patchwork Mon Aug 10 13:31:06 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Auger Eric X-Patchwork-Id: 52254 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f198.google.com (mail-lb0-f198.google.com [209.85.217.198]) by patches.linaro.org (Postfix) with ESMTPS id 2E58C22919 for ; Mon, 10 Aug 2015 13:32:06 +0000 (UTC) Received: by lbsm2 with SMTP id m2sf25801123lbs.1 for ; Mon, 10 Aug 2015 06:32:05 -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=U+gBX2kamKHqJuQRU385PZZQlQXLPF09Xxdf69XHWik=; b=Yq9YR+TDs8HbuTT1l/gkoDZAwDv5l9KAeofGjfPpmVhUW5QERsoKEaqfh89mrY3Q7O bd9QwkoJojfHxqr/1W63n4sjpqLkdILT87IT/lfZ+fKHbghIbrCvjk53nPBeLo4aKWMY hqOz/goUO83pjQjT0e7meCmqpUtpbmk7DONnjPrcCM/YCQDUCHAG7UYSKBCFLjdVAirx WJ++UEblBucwtE0hm7LhTwYPYIVUFtzWHlbrCeZ3YUJXfw0jg5eIU3y7GtYs6/aonDbl ba5c8jvEgLLO9zLvDTp53/JBC+2qvdtTCHohdRZ7hviBXZZtC7wEhv6kYXQp7IziVgnC iQCA== X-Gm-Message-State: ALoCoQnaAZ299hCOBD2ht7Fom4HinlVjTNYi1k3vpMAEzn1oSNOJX9oeCVbxYU5c9CC3HG+dGKJZ X-Received: by 10.180.79.10 with SMTP id f10mr3737473wix.3.1439213525162; Mon, 10 Aug 2015 06:32:05 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.120.40 with SMTP id kz8ls728963lab.24.gmail; Mon, 10 Aug 2015 06:32:05 -0700 (PDT) X-Received: by 10.152.225.165 with SMTP id rl5mr20038657lac.1.1439213524998; Mon, 10 Aug 2015 06:32:04 -0700 (PDT) Received: from mail-la0-f49.google.com (mail-la0-f49.google.com. [209.85.215.49]) by mx.google.com with ESMTPS id dn7si14036665lbb.71.2015.08.10.06.32.04 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Aug 2015 06:32:04 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.49 as permitted sender) client-ip=209.85.215.49; Received: by lahi9 with SMTP id i9so23219620lah.2 for ; Mon, 10 Aug 2015 06:32:04 -0700 (PDT) X-Received: by 10.112.129.137 with SMTP id nw9mr13893445lbb.19.1439213524900; Mon, 10 Aug 2015 06:32:04 -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 l6csp1937011lba; Mon, 10 Aug 2015 06:32:04 -0700 (PDT) X-Received: by 10.194.179.167 with SMTP id dh7mr47320430wjc.15.1439213520715; Mon, 10 Aug 2015 06:32:00 -0700 (PDT) Received: from mail-wi0-f169.google.com (mail-wi0-f169.google.com. [209.85.212.169]) by mx.google.com with ESMTPS id ho2si19394433wjb.162.2015.08.10.06.32.00 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Aug 2015 06:32:00 -0700 (PDT) Received-SPF: pass (google.com: domain of eric.auger@linaro.org designates 209.85.212.169 as permitted sender) client-ip=209.85.212.169; Received: by wicja10 with SMTP id ja10so25865065wic.1 for ; Mon, 10 Aug 2015 06:32:00 -0700 (PDT) X-Received: by 10.194.90.225 with SMTP id bz1mr29046882wjb.110.1439213520336; Mon, 10 Aug 2015 06:32:00 -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 s16sm13826483wib.16.2015.08.10.06.31.58 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Aug 2015 06:31:59 -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, alex.williamson@redhat.com, pbonzini@redhat.com, feng.wu@intel.com Cc: linux-kernel@vger.kernel.org, patches@linaro.org, christoffer.dall@linaro.org, marc.zyngier@arm.com Subject: [PATCH v5 4/5] KVM: introduce kvm_arch functions for IRQ bypass Date: Mon, 10 Aug 2015 15:31:06 +0200 Message-Id: <1439213467-13668-5-git-send-email-eric.auger@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1439213467-13668-1-git-send-email-eric.auger@linaro.org> References: <1439213467-13668-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.49 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 --- v4 -> v5: - remove static inline stub functions 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 | 10 ++++++++++ virt/kvm/Kconfig | 3 +++ 2 files changed, 13 insertions(+) diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index 05e99b8..5ac8d21 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,14 @@ 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 *); +#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