From: Peter Maydell <peter.maydell@linaro.org>
To: qemu-devel@nongnu.org
Cc: Jan Kiszka <jan.kiszka@siemens.com>,
Marcelo Tosatti <mtosatti@redhat.com>,
Avi Kivity <avi@redhat.com>,
patches@linaro.org
Subject: [Qemu-devel] [PATCH] kvm: Move kvm_allows_irq0_override() to target-i386
Date: Fri, 20 Jul 2012 20:14:12 +0100 [thread overview]
Message-ID: <1342811652-16931-1-git-send-email-peter.maydell@linaro.org> (raw)
kvm_allows_irq0_override() is a totally x86 specific concept:
move it to the target-specific source file where it belongs.
This means we need a new header file for the prototype:
kvm_i386.h, in line with the existing kvm_ppc.h.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
I'm sure this isn't the only x86ism in the KVM generic source
files. However the thing I'm specifically trying to do is
nuke all the uses of kvm_irqchip_in_kernel() in common code,
as part of trying to untangle "what irqchip model do you want"
from other aspects of the interrupt handling model.
Other than this one, there are uses in cpus.c and hw/virtio-pci.c,
but I haven't figured out yet exactly what those bits of code
are trying to do...
hw/pc.c | 1 +
kvm-all.c | 5 -----
kvm.h | 2 --
target-i386/kvm.c | 6 ++++++
target-i386/kvm_i386.h | 16 ++++++++++++++++
5 files changed, 23 insertions(+), 7 deletions(-)
create mode 100644 target-i386/kvm_i386.h
diff --git a/hw/pc.c b/hw/pc.c
index 598267a..4953376 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -42,6 +42,7 @@
#include "sysbus.h"
#include "sysemu.h"
#include "kvm.h"
+#include "kvm_i386.h"
#include "xen.h"
#include "blockdev.h"
#include "hw/block-common.h"
diff --git a/kvm-all.c b/kvm-all.c
index 2148b20..65f1160 100644
--- a/kvm-all.c
+++ b/kvm-all.c
@@ -1667,11 +1667,6 @@ int kvm_has_gsi_routing(void)
#endif
}
-int kvm_allows_irq0_override(void)
-{
- return !kvm_irqchip_in_kernel() || kvm_has_gsi_routing();
-}
-
void *kvm_vmalloc(ram_addr_t size)
{
#ifdef TARGET_S390X
diff --git a/kvm.h b/kvm.h
index 2617dd5..c46132f 100644
--- a/kvm.h
+++ b/kvm.h
@@ -62,8 +62,6 @@ int kvm_has_pit_state2(void);
int kvm_has_many_ioeventfds(void);
int kvm_has_gsi_routing(void);
-int kvm_allows_irq0_override(void);
-
#ifdef NEED_CPU_H
int kvm_init_vcpu(CPUArchState *env);
diff --git a/target-i386/kvm.c b/target-i386/kvm.c
index e53c2f6..503abeb 100644
--- a/target-i386/kvm.c
+++ b/target-i386/kvm.c
@@ -23,6 +23,7 @@
#include "qemu-common.h"
#include "sysemu.h"
#include "kvm.h"
+#include "kvm_i386.h"
#include "cpu.h"
#include "gdbstub.h"
#include "host-utils.h"
@@ -65,6 +66,11 @@ static bool has_msr_async_pf_en;
static bool has_msr_misc_enable;
static int lm_capable_kernel;
+int kvm_allows_irq0_override(void)
+{
+ return !kvm_irqchip_in_kernel() || kvm_has_gsi_routing();
+}
+
static struct kvm_cpuid2 *try_get_cpuid(KVMState *s, int max)
{
struct kvm_cpuid2 *cpuid;
diff --git a/target-i386/kvm_i386.h b/target-i386/kvm_i386.h
new file mode 100644
index 0000000..87031c0
--- /dev/null
+++ b/target-i386/kvm_i386.h
@@ -0,0 +1,16 @@
+/*
+ * QEMU KVM support -- x86 specific functions.
+ *
+ * Copyright (c) 2012 Linaro Limited
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2 or later.
+ * See the COPYING file in the top-level directory.
+ *
+ */
+
+#ifndef QEMU_KVM_I386_H
+#define QEMU_KVM_I386_H
+
+int kvm_allows_irq0_override(void);
+
+#endif
--
1.7.5.4
next reply other threads:[~2012-07-20 19:19 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-20 19:14 Peter Maydell [this message]
2012-07-21 6:57 ` [Qemu-devel] [PATCH] kvm: Move kvm_allows_irq0_override() to target-i386 Jan Kiszka
2012-07-21 8:54 ` Peter Maydell
2012-07-21 9:14 ` Jan Kiszka
2012-07-21 9:30 ` Peter Maydell
2012-07-21 9:44 ` Jan Kiszka
2012-07-21 9:56 ` Peter Maydell
2012-07-21 10:22 ` Jan Kiszka
2012-07-21 10:53 ` Peter Maydell
2012-07-21 11:08 ` Jan Kiszka
2012-07-21 12:17 ` Peter Maydell
2012-07-21 12:35 ` Jan Kiszka
2012-07-21 12:57 ` Peter Maydell
2012-07-21 13:16 ` Jan Kiszka
2012-07-23 12:04 ` Cornelia Huck
2012-07-23 12:18 ` Avi Kivity
2012-07-23 12:25 ` Peter Maydell
2012-07-23 12:31 ` Avi Kivity
2012-07-23 12:34 ` Avi Kivity
2012-07-23 13:06 ` Cornelia Huck
2012-07-23 13:14 ` Avi Kivity
2012-07-23 13:55 ` Cornelia Huck
2012-07-23 14:27 ` Avi Kivity
2012-07-23 15:01 ` Cornelia Huck
2012-07-23 12:26 ` Avi Kivity
2012-07-23 12:58 ` Peter Maydell
2012-07-23 13:09 ` Avi Kivity
2012-07-23 13:27 ` Peter Maydell
2012-07-23 13:38 ` Avi Kivity
2012-07-23 13:50 ` Peter Maydell
2012-07-23 14:30 ` Avi Kivity
2012-07-23 17:58 ` Peter Maydell
2012-07-24 8:50 ` Avi Kivity
2012-07-24 8:54 ` Peter Maydell
2012-07-24 8:58 ` Jan Kiszka
2012-07-23 15:19 ` Peter Maydell
2012-07-23 16:55 ` Jan Kiszka
2012-07-23 17:41 ` Peter Maydell
2012-07-23 17:51 ` Jan Kiszka
2012-07-24 8:56 ` 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=1342811652-16931-1-git-send-email-peter.maydell@linaro.org \
--to=peter.maydell@linaro.org \
--cc=avi@redhat.com \
--cc=jan.kiszka@siemens.com \
--cc=mtosatti@redhat.com \
--cc=patches@linaro.org \
--cc=qemu-devel@nongnu.org \
/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).