aboutsummaryrefslogtreecommitdiff
path: root/hw/pc.c
diff options
context:
space:
mode:
authorWei Liu <wei.liu2@citrix.com>2012-04-12 10:02:47 +0000
committerStefano Stabellini <stefano.stabellini@eu.citrix.com>2012-04-13 17:34:21 +0000
commit9468e9c41a89b1c9f3a905b8959e1dd3f055c732 (patch)
tree286143660626abe4dc85165933db7ab0f766523f /hw/pc.c
parentf1dbf015dfb0aa7f66f710a1f1bc58b662951de2 (diff)
Xen: Add xen-apic support and hook it up.
Signed-off-by: Wei Liu <wei.liu2@citrix.com> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw/pc.c')
-rw-r--r--hw/pc.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/hw/pc.c b/hw/pc.c
index 67f0479f40..1f5aacb2d2 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -42,6 +42,7 @@
#include "sysbus.h"
#include "sysemu.h"
#include "kvm.h"
+#include "xen.h"
#include "blockdev.h"
#include "ui/qemu-spice.h"
#include "memory.h"
@@ -891,9 +892,12 @@ static DeviceState *apic_init(void *env, uint8_t apic_id)
if (kvm_irqchip_in_kernel()) {
dev = qdev_create(NULL, "kvm-apic");
+ } else if (xen_enabled()) {
+ dev = qdev_create(NULL, "xen-apic");
} else {
dev = qdev_create(NULL, "apic");
}
+
qdev_prop_set_uint8(dev, "id", apic_id);
qdev_prop_set_ptr(dev, "cpu_env", env);
qdev_init_nofail(dev);
@@ -912,6 +916,10 @@ static DeviceState *apic_init(void *env, uint8_t apic_id)
msi_supported = true;
}
+ if (xen_enabled()) {
+ msi_supported = true;
+ }
+
return dev;
}