[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 01/13] [PATCH] make cpu_exec_init symmetric
From: |
Glauber Costa |
Subject: |
[Qemu-devel] [PATCH 01/13] [PATCH] make cpu_exec_init symmetric |
Date: |
Thu, 15 May 2008 11:09:21 -0300 |
we put all the code that needs to be executed only at cpu0
out of cpu_exec_init(), in exec_init(). It is executed
before machine_init(), and only once. With this change,
code cpu_exec_init() is completely symmetric.
---
exec-all.h | 1 +
exec.c | 15 +++++++++------
vl.c | 1 +
3 files changed, 11 insertions(+), 6 deletions(-)
diff --git a/exec-all.h b/exec-all.h
index d8c6c33..8c32858 100644
--- a/exec-all.h
+++ b/exec-all.h
@@ -82,6 +82,7 @@ int cpu_restore_state_copy(struct TranslationBlock *tb,
void *puc);
void cpu_resume_from_signal(CPUState *env1, void *puc);
void cpu_exec_init(CPUState *env);
+void exec_init(void);
int page_unprotect(target_ulong address, unsigned long pc, void *puc);
void tb_invalidate_phys_page_range(target_phys_addr_t start,
target_phys_addr_t end,
int is_cpu_write_access);
diff --git a/exec.c b/exec.c
index 2fd0078..5384460 100644
--- a/exec.c
+++ b/exec.c
@@ -327,17 +327,20 @@ static void tlb_unprotect_code_phys(CPUState *env,
ram_addr_t ram_addr,
target_ulong vaddr);
#endif
+/* Must be called once before any of attempts to call cpu_init */
+void exec_init(void)
+{
+ cpu_gen_init();
+ code_gen_ptr = code_gen_buffer;
+ page_init();
+ io_mem_init();
+}
+
void cpu_exec_init(CPUState *env)
{
CPUState **penv;
int cpu_index;
- if (!code_gen_ptr) {
- cpu_gen_init();
- code_gen_ptr = code_gen_buffer;
- page_init();
- io_mem_init();
- }
env->next_cpu = NULL;
penv = &first_cpu;
cpu_index = 0;
diff --git a/vl.c b/vl.c
index 67712f0..5999b37 100644
--- a/vl.c
+++ b/vl.c
@@ -8576,6 +8576,7 @@ int main(int argc, char **argv)
}
}
+ exec_init();
machine->init(ram_size, vga_ram_size, boot_devices, ds,
kernel_filename, kernel_cmdline, initrd_filename, cpu_model);
--
1.5.5
- [Qemu-devel] [PATCH 0/13] New shot at QEMUAccel, Glauber Costa, 2008/05/15
- [Qemu-devel] [PATCH 01/13] [PATCH] make cpu_exec_init symmetric,
Glauber Costa <=
- [Qemu-devel] [PATCH 02/13] [PATCH] split kqemu_init into two, Glauber Costa, 2008/05/15
- [Qemu-devel] [PATCH 03/13] [PATCH] introduce QEMUAccel and fill it with interrupt specific driver, Glauber Costa, 2008/05/15
- [Qemu-devel] [PATCH 04/13] [PATCH] init env made accel driver, Glauber Costa, 2008/05/15
- [Qemu-devel] [PATCH 05/13] [PATCH] wrap cache flushing functions into accel drivers, Glauber Costa, 2008/05/15
- [Qemu-devel] [PATCH 06/13] [PATCH] turn info kqemu into generic info accelerator, Glauber Costa, 2008/05/15
- [Qemu-devel] [PATCH 07/13] [PATCH] separate accelerator part of info profiler, Glauber Costa, 2008/05/15
- [Qemu-devel] [PATCH 08/13] [PATCH] move kqemu externs to kqemu.h, Glauber Costa, 2008/05/15
- [Qemu-devel] [PATCH 09/13] [PATCH] move disabling code to kqemu.c instead of vl.c, Glauber Costa, 2008/05/15
- [Qemu-devel] [PATCH 10/13] [PATCH] set_notdirty goes through accel wrapper, Glauber Costa, 2008/05/15
- [Qemu-devel] [PATCH 11/13] [PATCH] wrap modify_page through accel calls, Glauber Costa, 2008/05/15