From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LxPkW-0004V3-Ls for qemu-devel@nongnu.org; Fri, 24 Apr 2009 14:03:44 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LxPkV-0004U6-KA for qemu-devel@nongnu.org; Fri, 24 Apr 2009 14:03:43 -0400 Received: from [199.232.76.173] (port=36834 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LxPkU-0004U0-Vu for qemu-devel@nongnu.org; Fri, 24 Apr 2009 14:03:43 -0400 Received: from savannah.gnu.org ([199.232.41.3]:35164 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LxPkU-0003L3-Dl for qemu-devel@nongnu.org; Fri, 24 Apr 2009 14:03:42 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1LxPkT-0002ws-WD for qemu-devel@nongnu.org; Fri, 24 Apr 2009 18:03:42 +0000 Received: from aliguori by cvs.savannah.gnu.org with local (Exim 4.69) (envelope-from ) id 1LxPkT-0002wo-GQ for qemu-devel@nongnu.org; Fri, 24 Apr 2009 18:03:41 +0000 MIME-Version: 1.0 Errors-To: aliguori Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Anthony Liguori Message-Id: Date: Fri, 24 Apr 2009 18:03:41 +0000 Subject: [Qemu-devel] [7242] qemu: introduce qemu_init_vcpu (Marcelo Tosatti) List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Revision: 7242 http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=7242 Author: aliguori Date: 2009-04-24 18:03:41 +0000 (Fri, 24 Apr 2009) Log Message: ----------- qemu: introduce qemu_init_vcpu (Marcelo Tosatti) Signed-off-by: Marcelo Tosatti Signed-off-by: Anthony Liguori Modified Paths: -------------- trunk/qemu-common.h trunk/target-alpha/translate.c trunk/target-arm/helper.c trunk/target-cris/translate.c trunk/target-i386/helper.c trunk/target-m68k/helper.c trunk/target-mips/translate.c trunk/target-ppc/helper.c trunk/target-sh4/translate.c trunk/target-sparc/helper.c trunk/vl.c Modified: trunk/qemu-common.h =================================================================== --- trunk/qemu-common.h 2009-04-24 18:03:33 UTC (rev 7241) +++ trunk/qemu-common.h 2009-04-24 18:03:41 UTC (rev 7242) @@ -189,6 +189,12 @@ /* Force QEMU to process pending events */ void qemu_notify_event(void); +#ifdef CONFIG_USER_ONLY +#define qemu_init_vcpu(env) do { } while (0) +#else +void qemu_init_vcpu(void *env); +#endif + typedef struct QEMUIOVector { struct iovec *iov; int niov; Modified: trunk/target-alpha/translate.c =================================================================== --- trunk/target-alpha/translate.c 2009-04-24 18:03:33 UTC (rev 7241) +++ trunk/target-alpha/translate.c 2009-04-24 18:03:41 UTC (rev 7242) @@ -2505,6 +2505,7 @@ env->ipr[IPR_SISR] = 0; env->ipr[IPR_VIRBND] = -1ULL; + qemu_init_vcpu(env); return env; } Modified: trunk/target-arm/helper.c =================================================================== --- trunk/target-arm/helper.c 2009-04-24 18:03:33 UTC (rev 7241) +++ trunk/target-arm/helper.c 2009-04-24 18:03:41 UTC (rev 7242) @@ -267,6 +267,7 @@ gdb_register_coprocessor(env, vfp_gdb_get_reg, vfp_gdb_set_reg, 19, "arm-vfp.xml", 0); } + qemu_init_vcpu(env); return env; } Modified: trunk/target-cris/translate.c =================================================================== --- trunk/target-cris/translate.c 2009-04-24 18:03:33 UTC (rev 7241) +++ trunk/target-cris/translate.c 2009-04-24 18:03:41 UTC (rev 7242) @@ -3405,6 +3405,7 @@ cpu_exec_init(env); cpu_reset(env); + qemu_init_vcpu(env); if (tcg_initialized) return env; Modified: trunk/target-i386/helper.c =================================================================== --- trunk/target-i386/helper.c 2009-04-24 18:03:33 UTC (rev 7241) +++ trunk/target-i386/helper.c 2009-04-24 18:03:41 UTC (rev 7242) @@ -1692,7 +1692,8 @@ #ifdef CONFIG_KQEMU kqemu_init(env); #endif - if (kvm_enabled()) - kvm_init_vcpu(env); + + qemu_init_vcpu(env); + return env; } Modified: trunk/target-m68k/helper.c =================================================================== --- trunk/target-m68k/helper.c 2009-04-24 18:03:33 UTC (rev 7241) +++ trunk/target-m68k/helper.c 2009-04-24 18:03:41 UTC (rev 7242) @@ -180,6 +180,7 @@ } cpu_reset(env); + qemu_init_vcpu(env); return env; } Modified: trunk/target-mips/translate.c =================================================================== --- trunk/target-mips/translate.c 2009-04-24 18:03:33 UTC (rev 7241) +++ trunk/target-mips/translate.c 2009-04-24 18:03:41 UTC (rev 7242) @@ -8551,6 +8551,7 @@ env->cpu_model_str = cpu_model; mips_tcg_init(); cpu_reset(env); + qemu_init_vcpu(env); return env; } Modified: trunk/target-ppc/helper.c =================================================================== --- trunk/target-ppc/helper.c 2009-04-24 18:03:33 UTC (rev 7241) +++ trunk/target-ppc/helper.c 2009-04-24 18:03:41 UTC (rev 7242) @@ -2831,8 +2831,7 @@ cpu_ppc_register_internal(env, def); cpu_ppc_reset(env); - if (kvm_enabled()) - kvm_init_vcpu(env); + qemu_init_vcpu(env); return env; } Modified: trunk/target-sh4/translate.c =================================================================== --- trunk/target-sh4/translate.c 2009-04-24 18:03:33 UTC (rev 7241) +++ trunk/target-sh4/translate.c 2009-04-24 18:03:41 UTC (rev 7242) @@ -290,6 +290,7 @@ cpu_sh4_reset(env); cpu_sh4_register(env, def); tlb_flush(env, 1); + qemu_init_vcpu(env); return env; } Modified: trunk/target-sparc/helper.c =================================================================== --- trunk/target-sparc/helper.c 2009-04-24 18:03:33 UTC (rev 7241) +++ trunk/target-sparc/helper.c 2009-04-24 18:03:41 UTC (rev 7242) @@ -723,6 +723,7 @@ return NULL; } cpu_reset(env); + qemu_init_vcpu(env); return env; } Modified: trunk/vl.c =================================================================== --- trunk/vl.c 2009-04-24 18:03:33 UTC (rev 7241) +++ trunk/vl.c 2009-04-24 18:03:41 UTC (rev 7242) @@ -3731,6 +3731,15 @@ return qemu_event_init(); } +void qemu_init_vcpu(void *_env) +{ + CPUState *env = _env; + + if (kvm_enabled()) + kvm_init_vcpu(env); + return; +} + #ifdef _WIN32 static void host_main_loop_wait(int *timeout) {