diff mbox series

[v8,03/25] mttcg: Add missing tb_lock/unlock() in cpu_exec_step()

Message ID 20170127103922.19658-4-alex.bennee@linaro.org
State Superseded
Headers show
Series Remaining MTTCG Base patches and ARM enablement | expand

Commit Message

Alex Bennée Jan. 27, 2017, 10:39 a.m. UTC
From: Pranith Kumar <bobby.prani@gmail.com>


The recent patch enabling lock assertions uncovered the missing lock
acquisition in cpu_exec_step(). This patch adds them.

CC: Richard Henderson <rth@twiddle.net>
CC: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Pranith Kumar <bobby.prani@gmail.com>

---
 cpu-exec.c | 4 ++++
 1 file changed, 4 insertions(+)

-- 
2.11.0

Comments

Richard Henderson Jan. 31, 2017, 7:13 p.m. UTC | #1
On 01/27/2017 02:39 AM, Alex Bennée wrote:
> From: Pranith Kumar <bobby.prani@gmail.com>

> 

> The recent patch enabling lock assertions uncovered the missing lock

> acquisition in cpu_exec_step(). This patch adds them.

> 

> CC: Richard Henderson <rth@twiddle.net>

> CC: Alex Bennée <alex.bennee@linaro.org>

> Signed-off-by: Pranith Kumar <bobby.prani@gmail.com>

> ---

>  cpu-exec.c | 4 ++++

>  1 file changed, 4 insertions(+)


Reviewed-by: Richard Henderson <rth@twiddle.net>


(Didn't I give a r-b for v7 on this?)


r~
Alex Bennée Feb. 1, 2017, 10:57 a.m. UTC | #2
Richard Henderson <rth@twiddle.net> writes:

> On 01/27/2017 02:39 AM, Alex Bennée wrote:

>> From: Pranith Kumar <bobby.prani@gmail.com>

>>

>> The recent patch enabling lock assertions uncovered the missing lock

>> acquisition in cpu_exec_step(). This patch adds them.

>>

>> CC: Richard Henderson <rth@twiddle.net>

>> CC: Alex Bennée <alex.bennee@linaro.org>

>> Signed-off-by: Pranith Kumar <bobby.prani@gmail.com>

>> ---

>>  cpu-exec.c | 4 ++++

>>  1 file changed, 4 insertions(+)

>

> Reviewed-by: Richard Henderson <rth@twiddle.net>

>

> (Didn't I give a r-b for v7 on this?)


You did but my tooling dropped the ball recalling this :-/

(I keep tags in an org-mode file which re-writes (foo) to {foo}
in the subject which was confusing the script looking for un-applied tags).

Anyway done now thanks :-)

--
Alex Bennée
diff mbox series

Patch

diff --git a/cpu-exec.c b/cpu-exec.c
index 4188fed3c6..1b8685dc21 100644
--- a/cpu-exec.c
+++ b/cpu-exec.c
@@ -233,14 +233,18 @@  static void cpu_exec_step(CPUState *cpu)
     uint32_t flags;
 
     cpu_get_tb_cpu_state(env, &pc, &cs_base, &flags);
+    tb_lock();
     tb = tb_gen_code(cpu, pc, cs_base, flags,
                      1 | CF_NOCACHE | CF_IGNORE_ICOUNT);
     tb->orig_tb = NULL;
+    tb_unlock();
     /* execute the generated code */
     trace_exec_tb_nocache(tb, pc);
     cpu_tb_exec(cpu, tb);
+    tb_lock();
     tb_phys_invalidate(tb, -1);
     tb_free(tb);
+    tb_unlock();
 }
 
 void cpu_exec_step_atomic(CPUState *cpu)