From: Peter Maydell <peter.maydell@linaro.org>
To: qemu-devel@nongnu.org
Cc: Alexander Graf <agraf@suse.de>,
Marcelo Tosatti <mtosatti@redhat.com>,
Jan Kiszka <jan.kiszka@web.de>, Avi Kivity <avi@redhat.com>,
patches@linaro.org
Subject: [Qemu-devel] [PATCH 3/6] kvm: Move kvm_allows_irq0_override() to target-i386
Date: Wed, 25 Jul 2012 14:24:29 +0100 [thread overview]
Message-ID: <1343222672-25312-4-git-send-email-peter.maydell@linaro.org> (raw)
In-Reply-To: <1343222672-25312-1-git-send-email-peter.maydell@linaro.org>
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>
---
hw/pc.c | 1 +
kvm-all.c | 5 -----
kvm-stub.c | 5 -----
kvm.h | 2 --
target-i386/Makefile.objs | 1 +
target-i386/kvm-stub.c | 17 +++++++++++++++++
target-i386/kvm.c | 6 ++++++
target-i386/kvm_i386.h | 16 ++++++++++++++++
8 files changed, 41 insertions(+), 12 deletions(-)
create mode 100644 target-i386/kvm-stub.c
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 9f14274..8e21d81 100644
--- a/kvm-all.c
+++ b/kvm-all.c
@@ -1672,11 +1672,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-stub.c b/kvm-stub.c
index b4023d1..af1cb5e 100644
--- a/kvm-stub.c
+++ b/kvm-stub.c
@@ -72,11 +72,6 @@ int kvm_has_many_ioeventfds(void)
return 0;
}
-int kvm_allows_irq0_override(void)
-{
- return 1;
-}
-
int kvm_has_pit_state2(void)
{
return 0;
diff --git a/kvm.h b/kvm.h
index cfdc95e..e6cbf12 100644
--- a/kvm.h
+++ b/kvm.h
@@ -73,8 +73,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/Makefile.objs b/target-i386/Makefile.objs
index 683fd59..0715f58 100644
--- a/target-i386/Makefile.objs
+++ b/target-i386/Makefile.objs
@@ -3,6 +3,7 @@ obj-y += excp_helper.o fpu_helper.o cc_helper.o int_helper.o svm_helper.o
obj-y += smm_helper.o misc_helper.o mem_helper.o seg_helper.o
obj-$(CONFIG_SOFTMMU) += machine.o arch_memory_mapping.o arch_dump.o
obj-$(CONFIG_KVM) += kvm.o hyperv.o
+obj-$(CONFIG_NO_KVM) += kvm-stub.o
obj-$(CONFIG_LINUX_USER) += ioport-user.o
obj-$(CONFIG_BSD_USER) += ioport-user.o
diff --git a/target-i386/kvm-stub.c b/target-i386/kvm-stub.c
new file mode 100644
index 0000000..30037e4
--- /dev/null
+++ b/target-i386/kvm-stub.c
@@ -0,0 +1,17 @@
+/*
+ * QEMU KVM x86 specific function stubs
+ *
+ * Copyright Linaro Limited 2012
+ *
+ * Author: Peter Maydell <peter.maydell@linaro.org>
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2 or later.
+ * See the COPYING file in the top-level directory.
+ *
+ */
+#include "kvm_i386.h"
+
+int kvm_allows_irq0_override(void)
+{
+ return 1;
+}
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 prev parent reply other threads:[~2012-07-25 13:25 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-25 13:24 [Qemu-devel] [PATCH 0/6] split out uses of kvm_irqchip_in_kernel() Peter Maydell
2012-07-25 13:24 ` [Qemu-devel] [PATCH 1/6] kvm: Decouple 'interrupt injection is async' from 'kernel irqchip' Peter Maydell
2012-07-25 15:41 ` Jan Kiszka
2012-07-25 13:24 ` [Qemu-devel] [PATCH 2/6] kvm: Rename kvm_irqchip_set_irq to kvm_inject_async_irq Peter Maydell
2012-07-25 15:43 ` Jan Kiszka
2012-07-25 15:47 ` Avi Kivity
2012-07-25 15:53 ` Jan Kiszka
2012-07-25 15:55 ` Avi Kivity
2012-07-25 15:56 ` Peter Maydell
2012-07-25 15:58 ` Jan Kiszka
2012-07-25 16:09 ` Peter Maydell
2012-07-25 16:11 ` Jan Kiszka
2012-07-25 16:18 ` Peter Maydell
2012-07-25 16:24 ` Peter Maydell
2012-07-25 16:28 ` Jan Kiszka
2012-07-25 16:36 ` Avi Kivity
2012-07-25 16:41 ` Peter Maydell
2012-07-25 16:56 ` Jan Kiszka
2012-07-25 16:00 ` Avi Kivity
2012-07-25 15:55 ` Peter Maydell
2012-07-25 16:02 ` Avi Kivity
2012-07-25 13:24 ` Peter Maydell [this message]
2012-07-25 15:44 ` [Qemu-devel] [PATCH 3/6] kvm: Move kvm_allows_irq0_override() to target-i386 Jan Kiszka
2012-07-25 13:24 ` [Qemu-devel] [PATCH 4/6] kvm: Don't assume irqchip-in-kernel implies irqfds Peter Maydell
2012-07-25 15:47 ` Jan Kiszka
2012-07-25 15:52 ` Peter Maydell
2012-07-25 15:54 ` Jan Kiszka
2012-07-25 13:24 ` [Qemu-devel] [PATCH 5/6] kvm: Don't assume irqchip implies MSI routing via irqfds Peter Maydell
2012-07-25 15:49 ` Jan Kiszka
2012-07-25 13:24 ` [Qemu-devel] [PATCH 6/6] kvm: Add documentation comment for kvm_irqchip_in_kernel() Peter Maydell
2012-07-25 15:40 ` Andreas Färber
2012-07-25 16:47 ` Jan Kiszka
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=1343222672-25312-4-git-send-email-peter.maydell@linaro.org \
--to=peter.maydell@linaro.org \
--cc=agraf@suse.de \
--cc=avi@redhat.com \
--cc=jan.kiszka@web.de \
--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).