From: Alexander Graf <agraf@suse.de>
To: kvm-ppc@vger.kernel.org
Cc: "kvm@vger.kernel.org mailing list" <kvm@vger.kernel.org>,
Scott Wood <scottwood@freescale.com>,
Marcelo Tosatti <mtosatti@redhat.com>,
Gleb Natapov <gleb@redhat.com>
Subject: [PATCH 2/7] KVM: Introduce __KVM_HAVE_IRQCHIP
Date: Tue, 16 Apr 2013 17:26:10 +0000 [thread overview]
Message-ID: <1366133175-23986-3-git-send-email-agraf@suse.de> (raw)
In-Reply-To: <1366133175-23986-1-git-send-email-agraf@suse.de>
Quite a bit of code in KVM has been conditionalized on availability of
IOAPIC emulation. However, most of it is generically applicable to
platforms that don't have an IOPIC, but a different type of irq chip.
Introduce a new define to distinguish between generic code and IOAPIC
specific code.
Signed-off-by: Alexander Graf <agraf@suse.de>
---
arch/x86/include/uapi/asm/kvm.h | 1 +
include/linux/kvm_host.h | 4 ++--
include/uapi/linux/kvm.h | 2 +-
virt/kvm/eventfd.c | 6 +++---
4 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/arch/x86/include/uapi/asm/kvm.h b/arch/x86/include/uapi/asm/kvm.h
index a65ec29..923478e 100644
--- a/arch/x86/include/uapi/asm/kvm.h
+++ b/arch/x86/include/uapi/asm/kvm.h
@@ -28,6 +28,7 @@
/* Select x86 specific features in <linux/kvm.h> */
#define __KVM_HAVE_PIT
#define __KVM_HAVE_IOAPIC
+#define __KVM_HAVE_IRQCHIP
#define __KVM_HAVE_IRQ_LINE
#define __KVM_HAVE_DEVICE_ASSIGNMENT
#define __KVM_HAVE_MSI
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
index 303d05b..4b30906 100644
--- a/include/linux/kvm_host.h
+++ b/include/linux/kvm_host.h
@@ -304,7 +304,7 @@ struct kvm_kernel_irq_routing_entry {
struct hlist_node link;
};
-#ifdef __KVM_HAVE_IOAPIC
+#ifdef __KVM_HAVE_IRQCHIP
struct kvm_irq_routing_table {
int chip[KVM_NR_IRQCHIPS][KVM_IRQCHIP_NUM_PINS];
@@ -432,7 +432,7 @@ void kvm_vcpu_uninit(struct kvm_vcpu *vcpu);
int __must_check vcpu_load(struct kvm_vcpu *vcpu);
void vcpu_put(struct kvm_vcpu *vcpu);
-#ifdef __KVM_HAVE_IOAPIC
+#ifdef __KVM_HAVE_IRQCHIP
int kvm_irqfd_init(void);
void kvm_irqfd_exit(void);
#else
diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h
index 74d0ff3..c38d269 100644
--- a/include/uapi/linux/kvm.h
+++ b/include/uapi/linux/kvm.h
@@ -579,7 +579,7 @@ struct kvm_ppc_smmu_info {
#ifdef __KVM_HAVE_PIT
#define KVM_CAP_REINJECT_CONTROL 24
#endif
-#ifdef __KVM_HAVE_IOAPIC
+#ifdef __KVM_HAVE_IRQCHIP
#define KVM_CAP_IRQ_ROUTING 25
#endif
#define KVM_CAP_IRQ_INJECT_STATUS 26
diff --git a/virt/kvm/eventfd.c b/virt/kvm/eventfd.c
index c5d43ff..0797571 100644
--- a/virt/kvm/eventfd.c
+++ b/virt/kvm/eventfd.c
@@ -35,7 +35,7 @@
#include "iodev.h"
-#ifdef __KVM_HAVE_IOAPIC
+#ifdef __KVM_HAVE_IRQCHIP
/*
* --------------------------------------------------------------------
* irqfd: Allows an fd to be used to inject an interrupt to the guest
@@ -433,7 +433,7 @@ fail:
void
kvm_eventfd_init(struct kvm *kvm)
{
-#ifdef __KVM_HAVE_IOAPIC
+#ifdef __KVM_HAVE_IRQCHIP
spin_lock_init(&kvm->irqfds.lock);
INIT_LIST_HEAD(&kvm->irqfds.items);
INIT_LIST_HEAD(&kvm->irqfds.resampler_list);
@@ -442,7 +442,7 @@ kvm_eventfd_init(struct kvm *kvm)
INIT_LIST_HEAD(&kvm->ioeventfds);
}
-#ifdef __KVM_HAVE_IOAPIC
+#ifdef __KVM_HAVE_IRQCHIP
/*
* shutdown any irqfd's that match fd+gsi
*/
--
1.6.0.2
next prev parent reply other threads:[~2013-04-16 17:26 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-16 17:26 [PATCH 0/7] KVM: irqfd generalization prepare patch set Alexander Graf
2013-04-16 17:26 ` [PATCH 1/7] KVM: Add KVM_IRQCHIP_NUM_PINS in addition to KVM_IOAPIC_NUM_PINS Alexander Graf
2013-04-17 11:51 ` Paolo Bonzini
2013-04-16 17:26 ` Alexander Graf [this message]
2013-04-17 11:49 ` [PATCH 2/7] KVM: Introduce __KVM_HAVE_IRQCHIP Paolo Bonzini
2013-04-17 11:53 ` Alexander Graf
2013-04-17 11:54 ` Paolo Bonzini
2013-04-17 11:59 ` Alexander Graf
2013-04-17 12:06 ` Paolo Bonzini
2013-04-17 12:10 ` Alexander Graf
2013-04-17 12:15 ` Paolo Bonzini
2013-04-17 12:16 ` Alexander Graf
2013-04-24 9:55 ` Gleb Natapov
2013-04-16 17:26 ` [PATCH 3/7] KVM: Remove kvm_get_intr_delivery_bitmask Alexander Graf
2013-04-16 17:26 ` [PATCH 4/7] KVM: Move irq routing to generic code Alexander Graf
2013-04-16 17:26 ` [PATCH 5/7] KVM: Extract generic irqchip logic into irqchip.c Alexander Graf
2013-04-17 11:50 ` Paolo Bonzini
2013-04-17 11:54 ` Alexander Graf
2013-04-17 12:05 ` Paolo Bonzini
2013-04-17 12:06 ` Alexander Graf
2013-04-16 17:26 ` [PATCH 6/7] KVM: Move irq routing setup to irqchip.c Alexander Graf
2013-04-16 17:26 ` [PATCH 7/7] KVM: Move irqfd resample cap handling to generic code Alexander Graf
2013-04-21 10:51 ` [PATCH 0/7] KVM: irqfd generalization prepare patch set Michael S. Tsirkin
2013-04-25 9:39 ` Alexander Graf
2013-04-24 10:20 ` Gleb Natapov
2013-04-25 7:28 ` Gleb Natapov
2013-04-25 9:35 ` Alexander Graf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1366133175-23986-3-git-send-email-agraf@suse.de \
--to=agraf@suse.de \
--cc=gleb@redhat.com \
--cc=kvm-ppc@vger.kernel.org \
--cc=kvm@vger.kernel.org \
--cc=mtosatti@redhat.com \
--cc=scottwood@freescale.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox