diff mbox

[v2--refid=<20090521172122.bb12027c.sfr@canb.auug.org.au>] kvm: fix irqfd build failure discovered in linux-next

Message ID 20090521132723.8177.20321.stgit@dev.haskins.net (mailing list archive)
State New, archived
Headers show

Commit Message

Gregory Haskins May 21, 2009, 1:27 p.m. UTC
Stephen Rothwell noted a build failure in arch != x86 in last nights
linux-next tree, as noted here:


This patch corrects the build issue by requiring explicit support for
IRQFD to be defined, and only defining it on x86 (the only arch fully
supported).  The code itself isnt architecture dependent, but we need
to add a new file to each makefile, advertise the capability, and
of course, test that it works for each supported arch.  We will submit
patches against each relevant arch at a later time to enable support
there as well.

Signed-off-by: Gregory Haskins <ghaskins@novell.com>

 arch/x86/kvm/Kconfig     |    4 ++++
 include/linux/kvm_host.h |   17 +++++++++++++++++
 virt/kvm/eventfd.c       |    6 ++++++
 virt/kvm/kvm_main.c      |    2 +-
 4 files changed, 28 insertions(+), 1 deletions(-)

To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Gregory Haskins May 21, 2009, 1:31 p.m. UTC | #1
Gregory Haskins wrote:
> Stephen Rothwell noted a build failure in arch != x86 in last nights
> linux-next tree, as noted here:

Typo on "stg-mail" command line caused the messed up subject above.  Pls
ignore this mail in favor of the real v2 resend that followed this.

diff mbox


diff --git a/arch/x86/kvm/Kconfig b/arch/x86/kvm/Kconfig
index 8600a09..6460091 100644
--- a/arch/x86/kvm/Kconfig
+++ b/arch/x86/kvm/Kconfig
@@ -8,6 +8,10 @@  config HAVE_KVM_IRQCHIP
        default y
+       bool
+       default y
 	bool "Virtualization"
 	depends on HAVE_KVM || X86
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
index 3b6caf5..28bd112 100644
--- a/include/linux/kvm_host.h
+++ b/include/linux/kvm_host.h
@@ -134,7 +134,9 @@  struct kvm {
 	struct list_head vm_list;
 	struct kvm_io_bus mmio_bus;
 	struct kvm_io_bus pio_bus;
 	struct list_head irqfds;
 	struct kvm_vm_stat stat;
 	struct kvm_arch arch;
 	atomic_t users_count;
@@ -529,7 +531,22 @@  static inline void kvm_free_irq_routing(struct kvm *kvm) {}
+void kvm_irqfd_init(struct kvm *kvm);
 int kvm_irqfd(struct kvm *kvm, int fd, int gsi, int flags);
 void kvm_irqfd_release(struct kvm *kvm);
+static inline void kvm_irqfd_init(struct kvm *kvm) {}
+static inline int kvm_irqfd(struct kvm *kvm, int fd, int gsi, int flags)
+	return -EINVAL;
+static inline void kvm_irqfd_release(struct kvm *kvm) {}
diff --git a/virt/kvm/eventfd.c b/virt/kvm/eventfd.c
index 72a282e..c63ff6a 100644
--- a/virt/kvm/eventfd.c
+++ b/virt/kvm/eventfd.c
@@ -206,6 +206,12 @@  kvm_deassign_irqfd(struct kvm *kvm, int fd, int gsi)
 	return count ? count : -ENOENT;
+kvm_irqfd_init(struct kvm *kvm)
+	INIT_LIST_HEAD(&kvm->irqfds);
 kvm_irqfd(struct kvm *kvm, int fd, int gsi, int flags)
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index b58837d..de042cb 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -983,7 +983,7 @@  static struct kvm *kvm_create_vm(void)
-	INIT_LIST_HEAD(&kvm->irqfds);
+	kvm_irqfd_init(kvm);