From: Igor Mammedov <imammedo@redhat.com>
To: qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org, aliguori@us.ibm.com,
wei.liu2@citrix.com, ehabkost@redhat.com,
stefano.stabellini@eu.citrix.com, sw@weilnetz.de,
mtosatti@redhat.com, agraf@suse.de, blauwirbel@gmail.com,
avi@redhat.com, jan.kiszka@siemens.com,
anthony.perard@citrix.com, pbonzini@redhat.com, afaerber@suse.de
Subject: [Qemu-devel] [PATCH qom-next 1/6] pc: Enable MSI support at APIC level
Date: Wed, 23 May 2012 18:39:36 +0200 [thread overview]
Message-ID: <1337791181-27446-2-git-send-email-imammedo@redhat.com> (raw)
In-Reply-To: <1337791181-27446-1-git-send-email-imammedo@redhat.com>
From: Jan Kiszka <jan.kiszka@siemens.com>
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>
---
hw/apic.c | 3 +++
hw/pc.c | 9 ---------
hw/xen.h | 10 ----------
hw/xen_apic.c | 5 +++++
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 4167782..ad27f36 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)
--
1.7.7.6
next prev parent reply other threads:[~2012-05-23 16:40 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-23 16:39 [Qemu-devel] [PATCH qom-next v2 0/6] target-i386: re-factor CPU creation/initialization to QOM Igor Mammedov
2012-05-23 16:39 ` Igor Mammedov [this message]
2012-05-23 16:39 ` [Qemu-devel] [PATCH qom-next 2/6] target-i386: move cpu halted decision into x86_cpu_reset Igor Mammedov
2012-05-23 16:39 ` [Qemu-devel] [PATCH qom-next 3/6] target-i386: add cpu-model property to x86_cpu Igor Mammedov
2012-05-23 16:39 ` [Qemu-devel] [PATCH qom-next 4/6] pc: move apic_mapped initialization into common apic init code Igor Mammedov
2012-05-23 16:44 ` Peter Maydell
2012-05-23 20:08 ` Jan Kiszka
2012-05-23 21:09 ` Igor Mammedov
2012-05-23 21:26 ` Peter Maydell
2012-05-24 13:10 ` Igor Mammedov
2012-05-24 13:21 ` Peter Maydell
2012-05-24 13:25 ` Jan Kiszka
2012-05-24 13:39 ` Igor Mammedov
2012-05-24 13:45 ` Andreas Färber
2012-05-23 16:39 ` [Qemu-devel] [PATCH qom-next 5/6] target-i386: make initialize CPU in QOM way Igor Mammedov
2012-05-23 21:27 ` Andreas Färber
2012-05-24 9:29 ` Igor Mammedov
2012-05-23 16:39 ` [Qemu-devel] [PATCH qom-next 6/6] target-i386: move reset callback to cpu.c Igor Mammedov
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=1337791181-27446-2-git-send-email-imammedo@redhat.com \
--to=imammedo@redhat.com \
--cc=afaerber@suse.de \
--cc=agraf@suse.de \
--cc=aliguori@us.ibm.com \
--cc=anthony.perard@citrix.com \
--cc=avi@redhat.com \
--cc=blauwirbel@gmail.com \
--cc=ehabkost@redhat.com \
--cc=jan.kiszka@siemens.com \
--cc=mtosatti@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=stefano.stabellini@eu.citrix.com \
--cc=sw@weilnetz.de \
--cc=wei.liu2@citrix.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;
as well as URLs for NNTP newsgroup(s).