From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34653) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VvI97-0007YS-PC for qemu-devel@nongnu.org; Mon, 23 Dec 2013 21:55:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VvI93-0003nZ-IE for qemu-devel@nongnu.org; Mon, 23 Dec 2013 21:55:01 -0500 Received: from [222.73.24.84] (port=26652 helo=song.cn.fujitsu.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VvI93-0003nF-5n for qemu-devel@nongnu.org; Mon, 23 Dec 2013 21:54:57 -0500 Message-ID: <1387853579.8547.6.camel@G08FNSTD131468> From: Chen Fan Date: Tue, 24 Dec 2013 10:52:59 +0800 In-Reply-To: <1387852706-18926-1-git-send-email-afaerber@suse.de> References: <1387852706-18926-1-git-send-email-afaerber@suse.de> Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" Subject: Re: [Qemu-devel] [PATCH qom-cpu] cpu-exec: Optimize X86CPU usage in cpu_exec() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Andreas =?ISO-8859-1?Q?F=E4rber?= Cc: qemu-devel@nongnu.org On Tue, 2013-12-24 at 03:38 +0100, Andreas F=C3=A4rber wrote: > Replace growing numbers of inline x86_env_get_cpu() with x86_cpu variable= . >=20 > Signed-off-by: Andreas F=C3=A4rber > --- > cpu-exec.c | 14 ++++++++++---- > 1 file changed, 10 insertions(+), 4 deletions(-) >=20 > diff --git a/cpu-exec.c b/cpu-exec.c > index 2711c58..f7a215c 100644 > --- a/cpu-exec.c > +++ b/cpu-exec.c > @@ -206,6 +206,9 @@ int cpu_exec(CPUArchState *env) > (defined(TARGET_M68K) || defined(TARGET_PPC) || defined(TARGET_S39= 0X))) > CPUClass *cc =3D CPU_GET_CLASS(cpu); > #endif > +#ifdef TARGET_I386 > + X86CPU *x86_cpu =3D X86_CPU(cpu); > +#endif Hi, Andreas, I think this defined grammar should correspond with other, of course it's correct also. > int ret, interrupt_request; > TranslationBlock *tb; > uint8_t *tc_ptr; > @@ -320,24 +323,24 @@ int cpu_exec(CPUArchState *env) > #if !defined(CONFIG_USER_ONLY) > if (interrupt_request & CPU_INTERRUPT_POLL) { > cpu->interrupt_request &=3D ~CPU_INTERRUPT_POLL; > - apic_poll_irq(x86_env_get_cpu(env)->apic_state); > + apic_poll_irq(x86_cpu->apic_state); > } > #endif > if (interrupt_request & CPU_INTERRUPT_INIT) { > cpu_svm_check_intercept_param(env, SVM_EXIT_= INIT, > 0); > - do_cpu_init(x86_env_get_cpu(env)); > + do_cpu_init(x86_cpu); > env->exception_index =3D EXCP_HALTED; > cpu_loop_exit(env); > } else if (interrupt_request & CPU_INTERRUPT_SIPI) { > - do_cpu_sipi(x86_env_get_cpu(env)); > + do_cpu_sipi(x86_cpu); > } else if (env->hflags2 & HF2_GIF_MASK) { > if ((interrupt_request & CPU_INTERRUPT_SMI) && > !(env->hflags & HF_SMM_MASK)) { > cpu_svm_check_intercept_param(env, SVM_EXIT_= SMI, > 0); > cpu->interrupt_request &=3D ~CPU_INTERRUPT_S= MI; > - do_smm_enter(x86_env_get_cpu(env)); > + do_smm_enter(x86_cpu); > next_tb =3D 0; > } else if ((interrupt_request & CPU_INTERRUPT_NM= I) && > !(env->hflags2 & HF2_NMI_MASK)) { > @@ -685,6 +688,9 @@ int cpu_exec(CPUArchState *env) > (defined(TARGET_M68K) || defined(TARGET_PPC) || defined(TARGET_S39= 0X))) > cc =3D CPU_GET_CLASS(cpu); > #endif > +#ifdef TARGET_I386 > + x86_cpu =3D X86_CPU(cpu); > +#endif > } > } /* for(;;) */ > =20 Reviewed-by: Chen Fan Thanks. Chen