aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorJan Kiszka <jan.kiszka@siemens.com>2012-05-16 15:41:11 -0300
committerMarcelo Tosatti <mtosatti@redhat.com>2012-05-16 18:04:44 -0300
commit08a82ac01cb5409480128f8e1f144557d99b74a3 (patch)
treec7151763bac0097f5f8ca4ef67969729281b3e8d /hw
parent04fa27f5ae5f025424bb7b88d3453c46e8900102 (diff)
downloadqemu-08a82ac01cb5409480128f8e1f144557d99b74a3.zip
qemu-08a82ac01cb5409480128f8e1f144557d99b74a3.tar.gz
qemu-08a82ac01cb5409480128f8e1f144557d99b74a3.tar.bz2
pc: Enable MSI support at APIC level
Push msi_supported enabling to the APIC implementations where we can encapsulate the decision more cleanly, hiding the details from the generic code. Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/apic.c3
-rw-r--r--hw/pc.c9
-rw-r--r--hw/xen.h10
-rw-r--r--hw/xen_apic.c5
4 files changed, 8 insertions, 19 deletions
diff --git a/hw/apic.c b/hw/apic.c
index 4eeaf88..5fbf01c 100644
--- a/hw/apic.c
+++ b/hw/apic.c
@@ -19,6 +19,7 @@
#include "apic_internal.h"
#include "apic.h"
#include "ioapic.h"
+#include "msi.h"
#include "host-utils.h"
#include "trace.h"
#include "pc.h"
@@ -862,6 +863,8 @@ static void apic_init(APICCommonState *s)
s->timer = qemu_new_timer_ns(vm_clock, apic_timer, s);
local_apics[s->idx] = s;
+
+ msi_supported = true;
}
static void apic_class_init(ObjectClass *klass, void *data)
diff --git a/hw/pc.c b/hw/pc.c
index 4d34a33..6691b18 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -911,15 +911,6 @@ static DeviceState *apic_init(void *env, uint8_t apic_id)
apic_mapped = 1;
}
- /* KVM does not support MSI yet. */
- if (!kvm_irqchip_in_kernel()) {
- msi_supported = true;
- }
-
- if (xen_msi_support()) {
- msi_supported = true;
- }
-
return dev;
}
diff --git a/hw/xen.h b/hw/xen.h
index 3ae4cd0..e5926b7 100644
--- a/hw/xen.h
+++ b/hw/xen.h
@@ -57,14 +57,4 @@ void xen_register_framebuffer(struct MemoryRegion *mr);
# define HVM_MAX_VCPUS 32
#endif
-static inline int xen_msi_support(void)
-{
-#if defined(CONFIG_XEN_CTRL_INTERFACE_VERSION) \
- && CONFIG_XEN_CTRL_INTERFACE_VERSION >= 420
- return xen_enabled();
-#else
- return 0;
-#endif
-}
-
#endif /* QEMU_HW_XEN_H */
diff --git a/hw/xen_apic.c b/hw/xen_apic.c
index 1725ff6..a9e101f 100644
--- a/hw/xen_apic.c
+++ b/hw/xen_apic.c
@@ -40,6 +40,11 @@ static void xen_apic_init(APICCommonState *s)
{
memory_region_init_io(&s->io_memory, &xen_apic_io_ops, s, "xen-apic-msi",
MSI_SPACE_SIZE);
+
+#if defined(CONFIG_XEN_CTRL_INTERFACE_VERSION) \
+ && CONFIG_XEN_CTRL_INTERFACE_VERSION >= 420
+ msi_supported = true;
+#endif
}
static void xen_apic_set_base(APICCommonState *s, uint64_t val)