From: Glauber Costa <gcosta@redhat.com>
To: qemu-devel@nongnu.org
Cc: kvm-devel@lists.sourceforge.net, avi@qumranet.com
Subject: [PATCH 02/13] [PATCH] split kqemu_init into two
Date: Thu, 15 May 2008 11:09:22 -0300 [thread overview]
Message-ID: <12108605843020-git-send-email-gcosta@redhat.com> (raw)
In-Reply-To: <12108605813076-git-send-email-gcosta@redhat.com>
we separate kqemu_init() into a part that depends on env,
and other that does not. The later can be initialized earlier
---
exec.c | 3 +++
kqemu.c | 10 +++++++---
target-i386/helper2.c | 2 +-
3 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/exec.c b/exec.c
index 5384460..dfedfc3 100644
--- a/exec.c
+++ b/exec.c
@@ -334,6 +334,9 @@ void exec_init(void)
code_gen_ptr = code_gen_buffer;
page_init();
io_mem_init();
+#ifdef USE_KQEMU
+ kqemu_start();
+#endif
}
void cpu_exec_init(CPUState *env)
diff --git a/kqemu.c b/kqemu.c
index 88592ee..0e38d52 100644
--- a/kqemu.c
+++ b/kqemu.c
@@ -159,7 +159,7 @@ static void kqemu_update_cpuid(CPUState *env)
accelerated code */
}
-int kqemu_init(CPUState *env)
+int kqemu_start(void)
{
struct kqemu_init init;
int ret, version;
@@ -238,13 +238,17 @@ int kqemu_init(CPUState *env)
kqemu_fd = KQEMU_INVALID_FD;
return -1;
}
- kqemu_update_cpuid(env);
- env->kqemu_enabled = kqemu_allowed;
nb_pages_to_flush = 0;
nb_ram_pages_to_update = 0;
return 0;
}
+void kqemu_init_env(CPUState *env)
+{
+ kqemu_update_cpuid(env);
+ env->kqemu_enabled = kqemu_allowed;
+}
+
void kqemu_flush_page(CPUState *env, target_ulong addr)
{
#if defined(DEBUG)
diff --git a/target-i386/helper2.c b/target-i386/helper2.c
index 6cf218f..1c0fcdb 100644
--- a/target-i386/helper2.c
+++ b/target-i386/helper2.c
@@ -113,7 +113,7 @@ CPUX86State *cpu_x86_init(const char *cpu_model)
}
cpu_reset(env);
#ifdef USE_KQEMU
- kqemu_init(env);
+ kqemu_init_env(env);
#endif
return env;
}
--
1.5.5
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
WARNING: multiple messages have this Message-ID (diff)
From: Glauber Costa <gcosta@redhat.com>
To: qemu-devel@nongnu.org
Cc: kvm-devel@lists.sourceforge.net
Subject: [Qemu-devel] [PATCH 02/13] [PATCH] split kqemu_init into two
Date: Thu, 15 May 2008 11:09:22 -0300 [thread overview]
Message-ID: <12108605843020-git-send-email-gcosta@redhat.com> (raw)
In-Reply-To: <12108605813076-git-send-email-gcosta@redhat.com>
we separate kqemu_init() into a part that depends on env,
and other that does not. The later can be initialized earlier
---
exec.c | 3 +++
kqemu.c | 10 +++++++---
target-i386/helper2.c | 2 +-
3 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/exec.c b/exec.c
index 5384460..dfedfc3 100644
--- a/exec.c
+++ b/exec.c
@@ -334,6 +334,9 @@ void exec_init(void)
code_gen_ptr = code_gen_buffer;
page_init();
io_mem_init();
+#ifdef USE_KQEMU
+ kqemu_start();
+#endif
}
void cpu_exec_init(CPUState *env)
diff --git a/kqemu.c b/kqemu.c
index 88592ee..0e38d52 100644
--- a/kqemu.c
+++ b/kqemu.c
@@ -159,7 +159,7 @@ static void kqemu_update_cpuid(CPUState *env)
accelerated code */
}
-int kqemu_init(CPUState *env)
+int kqemu_start(void)
{
struct kqemu_init init;
int ret, version;
@@ -238,13 +238,17 @@ int kqemu_init(CPUState *env)
kqemu_fd = KQEMU_INVALID_FD;
return -1;
}
- kqemu_update_cpuid(env);
- env->kqemu_enabled = kqemu_allowed;
nb_pages_to_flush = 0;
nb_ram_pages_to_update = 0;
return 0;
}
+void kqemu_init_env(CPUState *env)
+{
+ kqemu_update_cpuid(env);
+ env->kqemu_enabled = kqemu_allowed;
+}
+
void kqemu_flush_page(CPUState *env, target_ulong addr)
{
#if defined(DEBUG)
diff --git a/target-i386/helper2.c b/target-i386/helper2.c
index 6cf218f..1c0fcdb 100644
--- a/target-i386/helper2.c
+++ b/target-i386/helper2.c
@@ -113,7 +113,7 @@ CPUX86State *cpu_x86_init(const char *cpu_model)
}
cpu_reset(env);
#ifdef USE_KQEMU
- kqemu_init(env);
+ kqemu_init_env(env);
#endif
return env;
}
--
1.5.5
next prev parent reply other threads:[~2008-05-15 14:09 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-15 14:09 [PATCH 0/13] New shot at QEMUAccel Glauber Costa
2008-05-15 14:09 ` [Qemu-devel] " Glauber Costa
2008-05-15 14:09 ` [PATCH 01/13] [PATCH] make cpu_exec_init symmetric Glauber Costa
2008-05-15 14:09 ` [Qemu-devel] " Glauber Costa
2008-05-15 14:09 ` Glauber Costa [this message]
2008-05-15 14:09 ` [Qemu-devel] [PATCH 02/13] [PATCH] split kqemu_init into two Glauber Costa
2008-05-15 14:09 ` [PATCH 03/13] [PATCH] introduce QEMUAccel and fill it with interrupt specific driver Glauber Costa
2008-05-15 14:09 ` [Qemu-devel] " Glauber Costa
2008-05-15 14:09 ` [PATCH 04/13] [PATCH] init env made accel driver Glauber Costa
2008-05-15 14:09 ` [Qemu-devel] " Glauber Costa
2008-05-15 14:09 ` [PATCH 05/13] [PATCH] wrap cache flushing functions into accel drivers Glauber Costa
2008-05-15 14:09 ` [Qemu-devel] " Glauber Costa
2008-05-15 14:09 ` [PATCH 06/13] [PATCH] turn info kqemu into generic info accelerator Glauber Costa
2008-05-15 14:09 ` [Qemu-devel] " Glauber Costa
2008-05-15 14:09 ` [PATCH 07/13] [PATCH] separate accelerator part of info profiler Glauber Costa
2008-05-15 14:09 ` [Qemu-devel] " Glauber Costa
2008-05-15 14:09 ` [PATCH 08/13] [PATCH] move kqemu externs to kqemu.h Glauber Costa
2008-05-15 14:09 ` [Qemu-devel] " Glauber Costa
2008-05-15 14:09 ` [PATCH 09/13] [PATCH] move disabling code to kqemu.c instead of vl.c Glauber Costa
2008-05-15 14:09 ` [Qemu-devel] " Glauber Costa
2008-05-15 14:09 ` [PATCH 10/13] [PATCH] set_notdirty goes through accel wrapper Glauber Costa
2008-05-15 14:09 ` [Qemu-devel] " Glauber Costa
2008-05-15 14:09 ` [PATCH 11/13] [PATCH] wrap modify_page through accel calls Glauber Costa
2008-05-15 14:09 ` [Qemu-devel] " Glauber Costa
2008-05-15 14:09 ` [PATCH 12/13] [PATCH] remove kqemu reference from hw/pc.c Glauber Costa
2008-05-15 14:09 ` [Qemu-devel] " Glauber Costa
2008-05-15 14:09 ` [PATCH 13/13] [PATCH] build list of available accelerators Glauber Costa
2008-05-15 14:09 ` [Qemu-devel] " Glauber Costa
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=12108605843020-git-send-email-gcosta@redhat.com \
--to=gcosta@redhat.com \
--cc=avi@qumranet.com \
--cc=kvm-devel@lists.sourceforge.net \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.