From mboxrd@z Thu Jan 1 00:00:00 1970 From: Glauber Costa Subject: [PATCH 02/13] [PATCH] split kqemu_init into two Date: Thu, 15 May 2008 11:09:22 -0300 Message-ID: <12108605843020-git-send-email-gcosta@redhat.com> References: <12108605731805-git-send-email-gcosta@redhat.com> <12108605813076-git-send-email-gcosta@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm-devel@lists.sourceforge.net, avi@qumranet.com To: qemu-devel@nongnu.org Return-path: In-Reply-To: <12108605813076-git-send-email-gcosta@redhat.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces@lists.sourceforge.net Errors-To: kvm-devel-bounces@lists.sourceforge.net List-Id: kvm.vger.kernel.org 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/