All of lore.kernel.org
 help / color / mirror / Atom feed
From: Fabien Chouteau <chouteau@adacore.com>
To: Richard Henderson <richard.henderson@linaro.org>
Cc: "open list:RISC-V" <qemu-riscv@nongnu.org>,
	Sagar Karandikar <sagark@eecs.berkeley.edu>,
	Bastian Koppelmann <kbastian@mail.uni-paderborn.de>,
	Palmer Dabbelt <palmer@sifive.com>,
	"open list:All patches CC here" <qemu-devel@nongnu.org>,
	Alistair Francis <Alistair.Francis@wdc.com>
Subject: Re: [Qemu-riscv] [Qemu-devel] [PATCH] RISC-V: fix single stepping over ret and other branching instructions
Date: Mon, 25 Mar 2019 12:48:45 +0100	[thread overview]
Message-ID: <eceb7ec3-73cd-a058-1410-e9217ec27ff4@adacore.com> (raw)
In-Reply-To: <43360785-4c71-bda6-c2f0-a5b02838865c@linaro.org>

Thanks Richard,

I sent a version 2.

On 22/03/2019 16:24, Richard Henderson wrote:
> On 3/22/19 4:22 AM, Fabien Chouteau wrote:
>> +/* Wrapper around tcg_gen_exit_tb that handles single stepping */
>> +static void exit_tb(DisasContext *ctx, TranslationBlock *tb, unsigned idx)
>> +{
>> +    if (ctx->base.singlestep_enabled) {
>> +        gen_exception_debug();
>> +    } else {
>> +        tcg_gen_exit_tb(tb, idx);
>> +    }
>> +}
> 
> You should remove the TB and idx parameters here and pass NULL, 0 to
> tcg_gen_exit_tb.
> 
>> @@ -138,14 +158,10 @@ static void gen_goto_tb(DisasContext *ctx, int n, target_ulong dest)
>>          /* chaining is only allowed when the jump is to the same page */
>>          tcg_gen_goto_tb(n);
>>          tcg_gen_movi_tl(cpu_pc, dest);
>> -        tcg_gen_exit_tb(ctx->base.tb, n);
>> +        exit_tb(ctx, ctx->base.tb, n);
> 
> Because this is the only non-zero use, and it is already protected by
> use_goto_tb, which includes the single-step check.
> 
> Because goto_tb(n) must be paired with exit_tb(tb, n), and vice-versa.
> 
> 
> r~
> 



      reply	other threads:[~2019-03-25 11:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-22 11:22 [Qemu-riscv] [PATCH] RISC-V: fix single stepping over ret and other branching instructions Fabien Chouteau
2019-03-22 15:24 ` [Qemu-riscv] [Qemu-devel] " Richard Henderson
2019-03-25 11:48   ` Fabien Chouteau [this message]

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=eceb7ec3-73cd-a058-1410-e9217ec27ff4@adacore.com \
    --to=chouteau@adacore.com \
    --cc=Alistair.Francis@wdc.com \
    --cc=kbastian@mail.uni-paderborn.de \
    --cc=palmer@sifive.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-riscv@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=sagark@eecs.berkeley.edu \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.