Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1199109

[PATCH v4 4/5] KVM: introduce kvm_arch functions for IRQ bypass

Path csiph.com!optima2.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!bofh.it!news.nic.it!robomod
From Eric Auger <eric.auger@linaro.org>
Newsgroups linux.kernel
Subject [PATCH v4 4/5] KVM: introduce kvm_arch functions for IRQ bypass
Date Mon, 03 Aug 2015 19:30:03 +0200
Message-ID <pTrIL-1iX-35@gated-at.bofh.it> (permalink)
References <pTrIJ-1iX-7@gated-at.bofh.it>
X-Original-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
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=rhE+pNws+9i2wVHkZ9CO+AUK3bA1GYPxCe74ukY1Hg0=; b=Hs2Ya2HXnEEU6YmoZTcfRwc5FYYS6cGkcwOLZWdjka6+xA/zwOztEGJEMZ4lPSg8MO NCv8JM2JKqbCEwz4Rd+rmqj8swZZF7cJauxja1E9KL+vgy5QJgm0EP105i+xYdqSJ2IL ySuGRPYF8TJDXsJ1zzcp+M/awb5iMWCojNcUnU4/KgtP+udtM63MhhX0cfYJnF4gjlub W0tZj9L57QCb7N6F60gJyd1APoAnfawczamIIKG9qb2oy1cvGVDk7gdm9xPNUnIly/et HtPgVGXEskaGIz4aC77W3xwpPZ538IrEb150/OqmjVpn+PAXa/rhWVAXm5lFNpDYvPN7 vmDw==
X-Gm-Message-State ALoCoQmZOBr0HrdxCKLf0phZrL05W2UAXISzs752bImVrUoCvMTLExbGDogrptjeBxfh+Pm2DCAb
X-Received by 10.194.84.211 with SMTP id b19mr619370wjz.120.1438622503828; Mon, 03 Aug 2015 10:21:43 -0700 (PDT)
X-Mailer git-send-email 1.9.1
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 98
Organization linux.* mail to news gateway
X-Original-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
X-Original-Date Mon, 3 Aug 2015 19:20:43 +0200
X-Original-Message-ID <1438622444-25444-5-git-send-email-eric.auger@linaro.org>
X-Original-References <1438622444-25444-1-git-send-email-eric.auger@linaro.org>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1199109

Show key headers only | View raw


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 <eric.auger@linaro.org>
Signed-off-by: Feng Wu <feng.wu@intel.com>

---

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 <linux/err.h>
 #include <linux/irqflags.h>
 #include <linux/context_tracking.h>
+#include <linux/irqbypass.h>
 #include <asm/signal.h>
 
 #include <linux/kvm.h>
@@ -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
-- 
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/

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

[PATCH v4 4/5] KVM: introduce kvm_arch functions for IRQ bypass Eric Auger <eric.auger@linaro.org> - 2015-08-03 19:30 +0200

csiph-web