mbox series

[RFC,DEBUG,0/3] debug patch for lookup-ptr hang

Message ID 20170609170100.3599-1-alex.bennee@linaro.org
Headers show
Series debug patch for lookup-ptr hang | expand

Message

Alex Bennée June 9, 2017, 5 p.m. UTC
Hi,

These are debug patches only but represent how much I have narrowed
down the problem so far. I've included Thomas' patch to fix the
thread=single|multi option as that is currently broken upstream. So
far it seems though the problem is unrelated to multi-threading.

As discussed in the other thread I found not returning to a
tb_htable_lookup but adding it to the tb_jmp_cache made the problem go
away. I also tried various printfs but they also seemed to un-wedge
the hang I was seeing. It is not really a hang rather than a busy-spin
that will eventually given enough time unwind.

So added a new TB flag (is_magic) which if set would skip returning
the code ptr and default to exiting the loop via the epilogue and set
it for all DISAS_JUMP/DISAS_UPDATE paths that trigger
lookup_and_goto_ptr. After selectively commenting them out I found the
RET instruction is responsible for my particular fail case.

I find this confusing because BL and BLR basically do the same thing
and they seem to work fine.

I have an uneasy feeling there is some subtle black magic in the
interaction between cpu_get_tb_cpu_state(env, &pc, &cs_base, &flags),
addr and the TCGv cpu_pc but I haven't nailed it down. I'm posting
this for those that still have some Friday left in case it prompts any
thoughts.

Over to you, hopefully inspiration will strike before I return to the
fray on Monday ;-)

Cheers,

Alex Bennée (2):
  tcg-runtime: light re-factor of lookup_tb_ptr
  translate-a64: fix lookup_tb_ptr hang (DEBUG!)

Thomas Huth (1):
  vl: Fix broken thread=xxx option of the --accel parameter

 include/exec/exec-all.h    |  2 ++
 target/arm/translate-a64.c | 21 +++++++++++++++++----
 target/arm/translate.h     |  2 ++
 tcg-runtime.c              | 37 +++++++++++++++++++++----------------
 vl.c                       | 13 +++++--------
 5 files changed, 47 insertions(+), 28 deletions(-)

-- 
2.13.0

Comments

no-reply@patchew.org June 9, 2017, 9:11 p.m. UTC | #1
Hi,

This series seems to have some coding style problems. See output below for
more information:

Message-id: 20170609170100.3599-1-alex.bennee@linaro.org
Type: series
Subject: [Qemu-devel] [RFC DEBUG PATCH 0/3] debug patch for lookup-ptr hang

=== TEST SCRIPT BEGIN ===
#!/bin/bash

BASE=base
n=1
total=$(git log --oneline $BASE.. | wc -l)
failed=0

git config --local diff.renamelimit 0
git config --local diff.renames True

commits="$(git log --format=%H --reverse $BASE..)"
for c in $commits; do
    echo "Checking PATCH $n/$total: $(git log -n 1 --format=%s $c)..."
    if ! git show $c --format=email | ./scripts/checkpatch.pl --mailback -; then
        failed=1
        echo
    fi
    n=$((n+1))
done

exit $failed
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
Switched to a new branch 'test'
92d6f9b translate-a64: fix lookup_tb_ptr hang (DEBUG!)
4772b63 tcg-runtime: light re-factor of lookup_tb_ptr
8add5ba vl: Fix broken thread=xxx option of the --accel parameter

=== OUTPUT BEGIN ===
Checking PATCH 1/3: vl: Fix broken thread=xxx option of the --accel parameter...
Checking PATCH 2/3: tcg-runtime: light re-factor of lookup_tb_ptr...
ERROR: "foo * bar" should be "foo *bar"
#28: FILE: tcg-runtime.c:151:
+    void * code_ptr = NULL;

total: 1 errors, 0 warnings, 49 lines checked

Your patch has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

Checking PATCH 3/3: translate-a64: fix lookup_tb_ptr hang (DEBUG!)...
=== OUTPUT END ===

Test command exited with code: 1


---
Email generated automatically by Patchew [http://patchew.org/].
Please send your feedback to patchew-devel@freelists.org