From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56181) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z7aTW-0000Ap-DX for qemu-devel@nongnu.org; Tue, 23 Jun 2015 22:31:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z7aTV-0004vA-8D for qemu-devel@nongnu.org; Tue, 23 Jun 2015 22:31:42 -0400 Received: from mail-pa0-x231.google.com ([2607:f8b0:400e:c03::231]:33246) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z7aTV-0004uc-2B for qemu-devel@nongnu.org; Tue, 23 Jun 2015 22:31:41 -0400 Received: by padev16 with SMTP id ev16so19034248pad.0 for ; Tue, 23 Jun 2015 19:31:40 -0700 (PDT) From: Peter Crosthwaite Date: Tue, 23 Jun 2015 19:31:17 -0700 Message-Id: <43bd3e9f504b200ccd223f70b9d22538db2c60d1.1435112834.git.crosthwaite.peter@gmail.com> In-Reply-To: References: In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [Qemu-devel] [PATCH qom v4 6/7] cpus: 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: aurelien@aurel32.net, Peter Crosthwaite , ehabkost@redhat.com, afaerber@suse.de, rth@twiddle.net 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ärber Reviewed-by: Eduardo Habkost Signed-off-by: Peter Crosthwaite --- Changed since v3: Add () to tcg_cpu_exec in commit subject Changed since v1: Add () to ENV_GET_CPU() in commit message --- cpus.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/cpus.c b/cpus.c index 4f0e54d..abf6f06 100644 --- a/cpus.c +++ b/cpus.c @@ -1344,9 +1344,9 @@ int vm_stop_force_state(RunState state) } } -static int tcg_cpu_exec(CPUArchState *env) +static int tcg_cpu_exec(CPUState *cpu) { - CPUState *cpu = ENV_GET_CPU(env); + CPUArchState *env = cpu->env_ptr; int ret; #ifdef CONFIG_PROFILER int64_t ti; @@ -1408,13 +1408,12 @@ static void tcg_exec_all(void) } for (; next_cpu != NULL && !exit_request; next_cpu = CPU_NEXT(next_cpu)) { CPUState *cpu = next_cpu; - CPUArchState *env = cpu->env_ptr; qemu_clock_enable(QEMU_CLOCK_VIRTUAL, (cpu->singlestep_enabled & SSTEP_NOTIMER) == 0); if (cpu_can_run(cpu)) { - r = tcg_cpu_exec(env); + r = tcg_cpu_exec(cpu); if (r == EXCP_DEBUG) { cpu_handle_guest_debug(cpu); break; -- 1.9.1