From: Peter Crosthwaite <crosthwaitepeter@gmail.com>
To: qemu-devel@nongnu.org
Cc: aurelien@aurel32.net,
Peter Crosthwaite <crosthwaite.peter@gmail.com>,
ehabkost@redhat.com, afaerber@suse.de, rth@twiddle.net
Subject: [Qemu-devel] [PATCH qom v4 6/7] cpus: Change tcg_cpu_exec() arg to cpu, not env
Date: Tue, 23 Jun 2015 19:31:17 -0700 [thread overview]
Message-ID: <43bd3e9f504b200ccd223f70b9d22538db2c60d1.1435112834.git.crosthwaite.peter@gmail.com> (raw)
In-Reply-To: <cover.1435112834.git.crosthwaite.peter@gmail.com>
In-Reply-To: <cover.1435112834.git.crosthwaite.peter@gmail.com>
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 <afaerber@suse.de>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>
---
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
next prev parent reply other threads:[~2015-06-24 2:31 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-24 2:31 [Qemu-devel] [PATCH qom v4 0/7] More core code ENV_GET_CPU removals Peter Crosthwaite
2015-06-24 2:31 ` [Qemu-devel] [PATCH qom v4 1/7] cpus: Add Error argument to cpu_exec_init() Peter Crosthwaite
2015-06-24 13:37 ` Andreas Färber
2015-06-24 2:31 ` [Qemu-devel] [PATCH qom v4 2/7] cpus: Convert cpu_index into a bitmap Peter Crosthwaite
2015-06-24 13:53 ` Andreas Färber
2015-06-24 15:39 ` Andreas Färber
2015-06-24 2:31 ` [Qemu-devel] [PATCH qom v4 3/7] ppc: Move cpu_exec_init() call to realize function Peter Crosthwaite
2015-06-24 2:31 ` [Qemu-devel] [PATCH qom v4 4/7] translate-all: Change tb_flush() env argument to cpu Peter Crosthwaite
2015-06-24 15:30 ` Andreas Färber
2015-06-24 17:06 ` Peter Crosthwaite
2015-06-24 17:23 ` Andreas Färber
2015-06-24 17:29 ` Peter Crosthwaite
2015-06-24 2:31 ` [Qemu-devel] [PATCH qom v4 5/7] gdbserver: _fork: Change fn to accept cpu instead of env Peter Crosthwaite
2015-06-24 2:31 ` Peter Crosthwaite [this message]
2015-06-24 2:31 ` [Qemu-devel] [PATCH qom v4 7/7] cpus: Change exec_init() arg to cpu, not env Peter Crosthwaite
2015-07-02 15:55 ` Andreas Färber
2015-06-24 17:13 ` [Qemu-devel] [PATCH qom v4 0/7] More core code ENV_GET_CPU removals Andreas Färber
2015-06-24 17:16 ` Paolo Bonzini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=43bd3e9f504b200ccd223f70b9d22538db2c60d1.1435112834.git.crosthwaite.peter@gmail.com \
--to=crosthwaitepeter@gmail.com \
--cc=afaerber@suse.de \
--cc=aurelien@aurel32.net \
--cc=crosthwaite.peter@gmail.com \
--cc=ehabkost@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=rth@twiddle.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).