[PATCH v6 01/14] tcg: Reset data_gen_ptr correctly

Richard Henderson posted 14 patches 6 days, 2 hours ago
There is a newer version of this series
[PATCH v6 01/14] tcg: Reset data_gen_ptr correctly
Posted by Richard Henderson 6 days, 2 hours ago
This pointer needs to be reset after overflow just like
code_buf and code_ptr.

Cc: qemu-stable@nongnu.org
Fixes: 57a269469db ("tcg: Infrastructure for managing constant pools")
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 tcg/tcg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tcg/tcg.c b/tcg/tcg.c
index 5decd83cf4..0babae1b88 100644
--- a/tcg/tcg.c
+++ b/tcg/tcg.c
@@ -1399,7 +1399,6 @@ TranslationBlock *tcg_tb_alloc(TCGContext *s)
         goto retry;
     }
     qatomic_set(&s->code_gen_ptr, next);
-    s->data_gen_ptr = NULL;
     return tb;
 }
 
@@ -6172,6 +6171,7 @@ int tcg_gen_code(TCGContext *s, TranslationBlock *tb, uint64_t pc_start)
      */
     s->code_buf = tcg_splitwx_to_rw(tb->tc.ptr);
     s->code_ptr = s->code_buf;
+    s->data_gen_ptr = NULL;
 
 #ifdef TCG_TARGET_NEED_LDST_LABELS
     QSIMPLEQ_INIT(&s->ldst_labels);
-- 
2.43.0
Re: [PATCH v6 01/14] tcg: Reset data_gen_ptr correctly
Posted by LIU Zhiwei 19 hours ago
On 2024/10/17 03:31, Richard Henderson wrote:
> This pointer needs to be reset after overflow just like
> code_buf and code_ptr.
>
> Cc: qemu-stable@nongnu.org
> Fixes: 57a269469db ("tcg: Infrastructure for managing constant pools")
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>   tcg/tcg.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tcg/tcg.c b/tcg/tcg.c
> index 5decd83cf4..0babae1b88 100644
> --- a/tcg/tcg.c
> +++ b/tcg/tcg.c
> @@ -1399,7 +1399,6 @@ TranslationBlock *tcg_tb_alloc(TCGContext *s)
>           goto retry;
>       }
>       qatomic_set(&s->code_gen_ptr, next);
> -    s->data_gen_ptr = NULL;
>       return tb;
>   }
>   
> @@ -6172,6 +6171,7 @@ int tcg_gen_code(TCGContext *s, TranslationBlock *tb, uint64_t pc_start)
>        */
>       s->code_buf = tcg_splitwx_to_rw(tb->tc.ptr);
>       s->code_ptr = s->code_buf;
> +    s->data_gen_ptr = NULL;
>   
>   #ifdef TCG_TARGET_NEED_LDST_LABELS
>       QSIMPLEQ_INIT(&s->ldst_labels);

Reviewed-by: LIU Zhiwei <zhiwei_liu@linux.alibaba.com>

Zhiwei
Re: [PATCH v6 01/14] tcg: Reset data_gen_ptr correctly
Posted by Pierrick Bouvier 1 day, 4 hours ago

On 10/16/24 12:31, Richard Henderson wrote:
> This pointer needs to be reset after overflow just like
> code_buf and code_ptr.
> 
> Cc: qemu-stable@nongnu.org
> Fixes: 57a269469db ("tcg: Infrastructure for managing constant pools")
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>   tcg/tcg.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tcg/tcg.c b/tcg/tcg.c
> index 5decd83cf4..0babae1b88 100644
> --- a/tcg/tcg.c
> +++ b/tcg/tcg.c
> @@ -1399,7 +1399,6 @@ TranslationBlock *tcg_tb_alloc(TCGContext *s)
>           goto retry;
>       }
>       qatomic_set(&s->code_gen_ptr, next);
> -    s->data_gen_ptr = NULL;
>       return tb;
>   }
>   
> @@ -6172,6 +6171,7 @@ int tcg_gen_code(TCGContext *s, TranslationBlock *tb, uint64_t pc_start)
>        */
>       s->code_buf = tcg_splitwx_to_rw(tb->tc.ptr);
>       s->code_ptr = s->code_buf;
> +    s->data_gen_ptr = NULL;
>   
>   #ifdef TCG_TARGET_NEED_LDST_LABELS
>       QSIMPLEQ_INIT(&s->ldst_labels);

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Re: [PATCH v6 01/14] tcg: Reset data_gen_ptr correctly
Posted by Alistair Francis 1 day, 21 hours ago
On Thu, Oct 17, 2024 at 5:35 AM Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> This pointer needs to be reset after overflow just like
> code_buf and code_ptr.
>
> Cc: qemu-stable@nongnu.org
> Fixes: 57a269469db ("tcg: Infrastructure for managing constant pools")
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

Acked-by: Alistair Francis <alistair.francis@wdc.com>

Alistair

> ---
>  tcg/tcg.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tcg/tcg.c b/tcg/tcg.c
> index 5decd83cf4..0babae1b88 100644
> --- a/tcg/tcg.c
> +++ b/tcg/tcg.c
> @@ -1399,7 +1399,6 @@ TranslationBlock *tcg_tb_alloc(TCGContext *s)
>          goto retry;
>      }
>      qatomic_set(&s->code_gen_ptr, next);
> -    s->data_gen_ptr = NULL;
>      return tb;
>  }
>
> @@ -6172,6 +6171,7 @@ int tcg_gen_code(TCGContext *s, TranslationBlock *tb, uint64_t pc_start)
>       */
>      s->code_buf = tcg_splitwx_to_rw(tb->tc.ptr);
>      s->code_ptr = s->code_buf;
> +    s->data_gen_ptr = NULL;
>
>  #ifdef TCG_TARGET_NEED_LDST_LABELS
>      QSIMPLEQ_INIT(&s->ldst_labels);
> --
> 2.43.0
>
>