From patchwork Mon Jul 6 23:13:52 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andreas_F=C3=A4rber?= X-Patchwork-Id: 491881 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 027E01402A6 for ; Tue, 7 Jul 2015 09:21:32 +1000 (AEST) Received: from localhost ([::1]:53284 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZCFhZ-0000SW-S4 for incoming@patchwork.ozlabs.org; Mon, 06 Jul 2015 19:21:29 -0400 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 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id C361AADDF; Mon, 6 Jul 2015 23:14:18 +0000 (UTC) From: =?UTF-8?q?Andreas=20F=C3=A4rber?= To: qemu-devel@nongnu.org Date: Tue, 7 Jul 2015 01:13:52 +0200 Message-Id: <1436224445-19449-10-git-send-email-afaerber@suse.de> X-Mailer: git-send-email 2.1.4 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 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] X-Received-From: 195.135.220.15 Cc: Paolo Bonzini , Peter Crosthwaite , =?UTF-8?q?Andreas=20F=C3=A4rber?= , Peter Crosthwaite Subject: [Qemu-devel] [PULL 09/22] cpu: Change tcg_cpu_exec() arg to cpu, not env X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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ärber Reviewed-by: Eduardo Habkost Signed-off-by: Peter Crosthwaite Signed-off-by: Andreas Färber --- 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) } } -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; @@ -1421,13 +1421,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;