All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
To: Richard Henderson <richard.henderson@linaro.org>, qemu-devel@nongnu.org
Cc: Sai Pavan Boddu <saipava@xilinx.com>
Subject: Re: [PATCH for-5.2] tcg: Remove assert from set_jmp_reset_offset
Date: Tue, 3 Nov 2020 08:08:47 +0100	[thread overview]
Message-ID: <28efd7ed-d380-354f-e134-f92e0b32eb78@amsat.org> (raw)
In-Reply-To: <20201103033947.94157-1-richard.henderson@linaro.org>

On 11/3/20 4:39 AM, Richard Henderson wrote:
> The range check done here is done later, more appropriately,
> at the end of tcg_gen_code.

Maybe mention commit 6e6c4efed99 ("tcg: Restart after TB code generation
overflow")? (no need to repost).

>  There, a failing range check
> results in a returned error code, which causes the TB to be
> restarted at half the size.
> 
> Reported-by: Sai Pavan Boddu <saipava@xilinx.com>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
> 
> Sai, would you try this against your failing testcase?
> 
> 
> r~
> 
> ---
>  tcg/tcg.c | 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/tcg/tcg.c b/tcg/tcg.c
> index f49f1a7f35..43c6cf8f52 100644
> --- a/tcg/tcg.c
> +++ b/tcg/tcg.c
> @@ -335,10 +335,11 @@ static bool tcg_resolve_relocs(TCGContext *s)
>  
>  static void set_jmp_reset_offset(TCGContext *s, int which)
>  {
> -    size_t off = tcg_current_code_size(s);
> -    s->tb_jmp_reset_offset[which] = off;
> -    /* Make sure that we didn't overflow the stored offset.  */
> -    assert(s->tb_jmp_reset_offset[which] == off);
> +    /*
> +     * We will check for overflow at the end of the opcode loop in
> +     * tcg_gen_code, where we bound tcg_current_code_size to UINT16_MAX.
> +     */
> +    s->tb_jmp_reset_offset[which] = tcg_current_code_size(s);
>  }
>  
>  #include "tcg-target.c.inc"
> 

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>



      parent reply	other threads:[~2020-11-03  7:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-03  3:39 [PATCH for-5.2] tcg: Remove assert from set_jmp_reset_offset Richard Henderson
2020-11-03  6:54 ` Sai Pavan Boddu
2020-11-03  7:08 ` Philippe Mathieu-Daudé [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=28efd7ed-d380-354f-e134-f92e0b32eb78@amsat.org \
    --to=f4bug@amsat.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=saipava@xilinx.com \
    /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.