Received: from eggs.gnu.org ([2001:4830:134:3::10]:50270) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZCFaf-0005AA-Rj for qemu-devel@nongnu.org; Mon, 06 Jul 2015 19:14:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZCFad-0007gA-Mu for qemu-devel@nongnu.org; Mon, 06 Jul 2015 19:14:21 -0400 Received: from cantor2.suse.de ([195.135.220.15]:44079 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZCFad-0007fE-7x for qemu-devel@nongnu.org; Mon, 06 Jul 2015 19:14:19 -0400 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Tue, 7 Jul 2015 01:13:52 +0200 Message-Id: <1436224445-19449-10-git-send-email-afaerber@suse.de> In-Reply-To: <1436224445-19449-1-git-send-email-afaerber@suse.de> References: <1436224445-19449-1-git-send-email-afaerber@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PULL 09/22] cpu: Change tcg_cpu_exec() arg to cpu, not env List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Peter Crosthwaite , =?UTF-8?q?Andreas=20F=C3=A4rber?= , Peter Crosthwaite From: Peter Crosthwaite The sole caller of this function navigates the cpu->env_ptr only for this function to take it back the cpu pointer straight away. Pass in cpu pointer instead and grab the env pointer locally in the function. Removes a core code usage of ENV_GET_CPU(). Reviewed-by: Andreas F=C3=A4rber Reviewed-by: Eduardo Habkost Signed-off-by: Peter Crosthwaite Signed-off-by: Andreas F=C3=A4rber --- cpus.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/cpus.c b/cpus.c index f547aeb..24cac2e 100644 --- a/cpus.c +++ b/cpus.c @@ -1357,9 +1357,9 @@ int vm_stop_force_state(RunState state) } } =20 -static int tcg_cpu_exec(CPUArchState *env) +static int tcg_cpu_exec(CPUState *cpu) { - CPUState *cpu =3D ENV_GET_CPU(env); + CPUArchState *env =3D cpu->env_ptr; int ret; #ifdef CONFIG_PROFILER int64_t ti; @@ -1421,13 +1421,12 @@ static void tcg_exec_all(void) } for (; next_cpu !=3D NULL && !exit_request; next_cpu =3D CPU_NEXT(ne= xt_cpu)) { CPUState *cpu =3D next_cpu; - CPUArchState *env =3D cpu->env_ptr; =20 qemu_clock_enable(QEMU_CLOCK_VIRTUAL, (cpu->singlestep_enabled & SSTEP_NOTIMER) =3D=3D= 0); =20 if (cpu_can_run(cpu)) { - r =3D tcg_cpu_exec(env); + r =3D tcg_cpu_exec(cpu); if (r =3D=3D EXCP_DEBUG) { cpu_handle_guest_debug(cpu); break; --=20 2.1.4