From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Marcelo Tosatti <mtosatti@redhat.com>, Avi Kivity <avi@redhat.com>
Cc: kvm@vger.kernel.org, Paul Mackerras <paulus@au1.ibm.com>
Subject: [PATCH] qemu-kvm: Build fixes for ppc64-softmmu
Date: Wed, 09 May 2012 12:59:07 +1000 [thread overview]
Message-ID: <1336532347.1714.11.camel@pasglop> (raw)
This is a small collection of build fixes that allow the
qemu-kvm tree to build a ppc64-softmmu target with kvm
enabled (provided device-assignment is disabled).
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
Avi, Marcelo: This is really only for qemu-kvm, not upstream qemu,
but since distros such as Fedora use this as base qemu source tree,
it would be great to have these fixed.
diff --git a/kvm-all.c b/kvm-all.c
index 99eb095..03d4b31 100644
--- a/kvm-all.c
+++ b/kvm-all.c
@@ -941,6 +941,12 @@ int kvm_irqchip_commit_routes(KVMState *s)
static void kvm_init_irq_routing(KVMState *s)
{
}
+
+int kvm_irqchip_commit_routes(KVMState *s)
+{
+ return -ENOSYS;
+}
+
#endif /* !KVM_CAP_IRQ_ROUTING */
static int kvm_irqchip_create(KVMState *s)
diff --git a/qemu-kvm.c b/qemu-kvm.c
index 34e1ac8..108050b 100644
--- a/qemu-kvm.c
+++ b/qemu-kvm.c
@@ -30,6 +30,7 @@
#define ALIGN(x, y) (((x)+(y)-1) & ~((y)-1))
+#ifdef KVM_CAP_IRQ_ROUTING
static inline void clear_gsi(KVMState *s, unsigned int gsi)
{
uint32_t *bitmap = s->used_gsi_bitmap;
@@ -40,6 +41,7 @@ static inline void clear_gsi(KVMState *s, unsigned int gsi)
DPRINTF("Invalid GSI %u\n", gsi);
}
}
+#endif
#ifdef KVM_CAP_DEVICE_ASSIGNMENT
int kvm_assign_pci_device(KVMState *s,
@@ -228,6 +230,7 @@ int kvm_del_irq_route(int gsi, int irqchip, int pin)
int kvm_get_irq_route_gsi(void)
{
+#ifdef KVM_CAP_IRQ_ROUTING
KVMState *s = kvm_state;
int i, bit;
uint32_t *buf = s->used_gsi_bitmap;
@@ -243,8 +246,12 @@ int kvm_get_irq_route_gsi(void)
}
return -ENOSPC;
+#else
+ return -ENOSYS;
+#endif
}
+#ifdef KVM_CAP_IRQ_ROUTING
static void kvm_msi_routing_entry(struct kvm_irq_routing_entry *e,
KVMMsiMessage *msg)
@@ -256,9 +263,11 @@ static void kvm_msi_routing_entry(struct kvm_irq_routing_entry *e,
e->u.msi.address_hi = msg->addr_hi;
e->u.msi.data = msg->data;
}
+#endif
int kvm_msi_message_add(KVMMsiMessage *msg)
{
+#ifdef KVM_CAP_IRQ_ROUTING
struct kvm_irq_routing_entry e;
int ret;
@@ -271,18 +280,26 @@ int kvm_msi_message_add(KVMMsiMessage *msg)
kvm_msi_routing_entry(&e, msg);
kvm_add_routing_entry(kvm_state, &e);
return 0;
+#else
+ return -ENOSYS;
+#endif
}
int kvm_msi_message_del(KVMMsiMessage *msg)
{
+#ifdef KVM_CAP_IRQ_ROUTING
struct kvm_irq_routing_entry e;
kvm_msi_routing_entry(&e, msg);
return kvm_del_routing_entry(&e);
+#else
+ return -ENOSYS;
+#endif
}
int kvm_msi_message_update(KVMMsiMessage *old, KVMMsiMessage *new)
{
+#ifdef KVM_CAP_IRQ_ROUTING
struct kvm_irq_routing_entry e1, e2;
int ret;
@@ -300,6 +317,9 @@ int kvm_msi_message_update(KVMMsiMessage *old, KVMMsiMessage *new)
}
return 1;
+#else
+ return -ENOSYS;
+#endif
}
@@ -317,9 +337,8 @@ int kvm_assign_set_msix_entry(KVMState *s,
#endif
#if !defined(TARGET_I386)
-int kvm_arch_init_irq_routing(void)
+void kvm_arch_init_irq_routing(KVMState *s)
{
- return 0;
}
#endif
next reply other threads:[~2012-05-09 3:00 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-09 2:59 Benjamin Herrenschmidt [this message]
2012-05-09 8:02 ` [PATCH] qemu-kvm: Build fixes for ppc64-softmmu Avi Kivity
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=1336532347.1714.11.camel@pasglop \
--to=benh@kernel.crashing.org \
--cc=avi@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=mtosatti@redhat.com \
--cc=paulus@au1.ibm.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.