qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] target/riscv: Use get_address() to get address with Zicbom extensions
@ 2024-04-19 11:05 Philippe Mathieu-Daudé
  2024-04-19 11:37 ` Philippe Mathieu-Daudé
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Philippe Mathieu-Daudé @ 2024-04-19 11:05 UTC (permalink / raw)
  To: qemu-devel
  Cc: qemu-riscv, Palmer Dabbelt, Bin Meng, Alistair Francis,
	Christoph Muellner, Philipp Tomsich, Liu Zhiwei, Weiwei Li,
	Palmer Dabbelt, Daniel Henrique Barboza,
	Philippe Mathieu-Daudé, Zhiwei Jiang

We need to use get_address() to get an address from cpu_gpr[],
since $zero is "special" (NULL).

Fixes: e05da09b7c ("target/riscv: implement Zicbom extension")
Reported-by: Zhiwei Jiang (姜智伟) <jiangzw@tecorigin.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 target/riscv/insn_trans/trans_rvzicbo.c.inc | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/target/riscv/insn_trans/trans_rvzicbo.c.inc b/target/riscv/insn_trans/trans_rvzicbo.c.inc
index d5d7095903..6f6b29598d 100644
--- a/target/riscv/insn_trans/trans_rvzicbo.c.inc
+++ b/target/riscv/insn_trans/trans_rvzicbo.c.inc
@@ -31,27 +31,27 @@
 static bool trans_cbo_clean(DisasContext *ctx, arg_cbo_clean *a)
 {
     REQUIRE_ZICBOM(ctx);
-    gen_helper_cbo_clean_flush(tcg_env, cpu_gpr[a->rs1]);
+    gen_helper_cbo_clean_flush(tcg_env, get_address(ctx, a->rs1, 0));
     return true;
 }
 
 static bool trans_cbo_flush(DisasContext *ctx, arg_cbo_flush *a)
 {
     REQUIRE_ZICBOM(ctx);
-    gen_helper_cbo_clean_flush(tcg_env, cpu_gpr[a->rs1]);
+    gen_helper_cbo_clean_flush(tcg_env, get_address(ctx, a->rs1, 0));
     return true;
 }
 
 static bool trans_cbo_inval(DisasContext *ctx, arg_cbo_inval *a)
 {
     REQUIRE_ZICBOM(ctx);
-    gen_helper_cbo_inval(tcg_env, cpu_gpr[a->rs1]);
+    gen_helper_cbo_inval(tcg_env, get_address(ctx, a->rs1, 0));
     return true;
 }
 
 static bool trans_cbo_zero(DisasContext *ctx, arg_cbo_zero *a)
 {
     REQUIRE_ZICBOZ(ctx);
-    gen_helper_cbo_zero(tcg_env, cpu_gpr[a->rs1]);
+    gen_helper_cbo_zero(tcg_env, get_address(ctx, a->rs1, 0));
     return true;
 }
-- 
2.41.0



^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH] target/riscv: Use get_address() to get address with Zicbom extensions
  2024-04-19 11:05 [PATCH] target/riscv: Use get_address() to get address with Zicbom extensions Philippe Mathieu-Daudé
@ 2024-04-19 11:37 ` Philippe Mathieu-Daudé
  2024-08-11 17:48   ` Michael Tokarev
  2024-04-20 16:02 ` Richard Henderson
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 9+ messages in thread
From: Philippe Mathieu-Daudé @ 2024-04-19 11:37 UTC (permalink / raw)
  To: qemu-devel, qemu-stable
  Cc: qemu-riscv, Palmer Dabbelt, Bin Meng, Alistair Francis,
	Christoph Muellner, Philipp Tomsich, Liu Zhiwei, Weiwei Li,
	Palmer Dabbelt, Daniel Henrique Barboza, Zhiwei Jiang

On 19/4/24 13:05, Philippe Mathieu-Daudé wrote:
> We need to use get_address() to get an address from cpu_gpr[],
> since $zero is "special" (NULL).
> 

Cc: qemu-stable@nongnu.org

> Fixes: e05da09b7c ("target/riscv: implement Zicbom extension")
> Reported-by: Zhiwei Jiang (姜智伟) <jiangzw@tecorigin.com>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>   target/riscv/insn_trans/trans_rvzicbo.c.inc | 8 ++++----
>   1 file changed, 4 insertions(+), 4 deletions(-)



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] target/riscv: Use get_address() to get address with Zicbom extensions
  2024-04-19 11:05 [PATCH] target/riscv: Use get_address() to get address with Zicbom extensions Philippe Mathieu-Daudé
  2024-04-19 11:37 ` Philippe Mathieu-Daudé
@ 2024-04-20 16:02 ` Richard Henderson
  2024-04-21 16:59 ` Daniel Henrique Barboza
  2024-05-29  4:56 ` Philippe Mathieu-Daudé
  3 siblings, 0 replies; 9+ messages in thread
From: Richard Henderson @ 2024-04-20 16:02 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel
  Cc: qemu-riscv, Palmer Dabbelt, Bin Meng, Alistair Francis,
	Christoph Muellner, Philipp Tomsich, Liu Zhiwei, Weiwei Li,
	Palmer Dabbelt, Daniel Henrique Barboza, Zhiwei Jiang

On 4/19/24 04:05, Philippe Mathieu-Daudé wrote:
> We need to use get_address() to get an address from cpu_gpr[],
> since $zero is "special" (NULL).
> 
> Fixes: e05da09b7c ("target/riscv: implement Zicbom extension")
> Reported-by: Zhiwei Jiang (姜智伟)<jiangzw@tecorigin.com>
> Signed-off-by: Philippe Mathieu-Daudé<philmd@linaro.org>
> ---
>   target/riscv/insn_trans/trans_rvzicbo.c.inc | 8 ++++----
>   1 file changed, 4 insertions(+), 4 deletions(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] target/riscv: Use get_address() to get address with Zicbom extensions
  2024-04-19 11:05 [PATCH] target/riscv: Use get_address() to get address with Zicbom extensions Philippe Mathieu-Daudé
  2024-04-19 11:37 ` Philippe Mathieu-Daudé
  2024-04-20 16:02 ` Richard Henderson
@ 2024-04-21 16:59 ` Daniel Henrique Barboza
  2024-05-29  4:56 ` Philippe Mathieu-Daudé
  3 siblings, 0 replies; 9+ messages in thread
From: Daniel Henrique Barboza @ 2024-04-21 16:59 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel
  Cc: qemu-riscv, Palmer Dabbelt, Bin Meng, Alistair Francis,
	Christoph Muellner, Philipp Tomsich, Liu Zhiwei, Weiwei Li,
	Palmer Dabbelt, Zhiwei Jiang



On 4/19/24 08:05, Philippe Mathieu-Daudé wrote:
> We need to use get_address() to get an address from cpu_gpr[],
> since $zero is "special" (NULL).
> 
> Fixes: e05da09b7c ("target/riscv: implement Zicbom extension")
> Reported-by: Zhiwei Jiang (姜智伟) <jiangzw@tecorigin.com>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---

Reviewed-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>

>   target/riscv/insn_trans/trans_rvzicbo.c.inc | 8 ++++----
>   1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/target/riscv/insn_trans/trans_rvzicbo.c.inc b/target/riscv/insn_trans/trans_rvzicbo.c.inc
> index d5d7095903..6f6b29598d 100644
> --- a/target/riscv/insn_trans/trans_rvzicbo.c.inc
> +++ b/target/riscv/insn_trans/trans_rvzicbo.c.inc
> @@ -31,27 +31,27 @@
>   static bool trans_cbo_clean(DisasContext *ctx, arg_cbo_clean *a)
>   {
>       REQUIRE_ZICBOM(ctx);
> -    gen_helper_cbo_clean_flush(tcg_env, cpu_gpr[a->rs1]);
> +    gen_helper_cbo_clean_flush(tcg_env, get_address(ctx, a->rs1, 0));
>       return true;
>   }
>   
>   static bool trans_cbo_flush(DisasContext *ctx, arg_cbo_flush *a)
>   {
>       REQUIRE_ZICBOM(ctx);
> -    gen_helper_cbo_clean_flush(tcg_env, cpu_gpr[a->rs1]);
> +    gen_helper_cbo_clean_flush(tcg_env, get_address(ctx, a->rs1, 0));
>       return true;
>   }
>   
>   static bool trans_cbo_inval(DisasContext *ctx, arg_cbo_inval *a)
>   {
>       REQUIRE_ZICBOM(ctx);
> -    gen_helper_cbo_inval(tcg_env, cpu_gpr[a->rs1]);
> +    gen_helper_cbo_inval(tcg_env, get_address(ctx, a->rs1, 0));
>       return true;
>   }
>   
>   static bool trans_cbo_zero(DisasContext *ctx, arg_cbo_zero *a)
>   {
>       REQUIRE_ZICBOZ(ctx);
> -    gen_helper_cbo_zero(tcg_env, cpu_gpr[a->rs1]);
> +    gen_helper_cbo_zero(tcg_env, get_address(ctx, a->rs1, 0));
>       return true;
>   }


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] target/riscv: Use get_address() to get address with Zicbom extensions
  2024-04-19 11:05 [PATCH] target/riscv: Use get_address() to get address with Zicbom extensions Philippe Mathieu-Daudé
                   ` (2 preceding siblings ...)
  2024-04-21 16:59 ` Daniel Henrique Barboza
@ 2024-05-29  4:56 ` Philippe Mathieu-Daudé
  2024-06-04  0:20   ` Alistair Francis
  3 siblings, 1 reply; 9+ messages in thread
From: Philippe Mathieu-Daudé @ 2024-05-29  4:56 UTC (permalink / raw)
  To: qemu-devel
  Cc: qemu-riscv, Palmer Dabbelt, Bin Meng, Alistair Francis,
	Christoph Muellner, Philipp Tomsich, Liu Zhiwei, Weiwei Li,
	Palmer Dabbelt, Daniel Henrique Barboza, Zhiwei Jiang

ping?

On 19/4/24 13:05, Philippe Mathieu-Daudé wrote:
> We need to use get_address() to get an address from cpu_gpr[],
> since $zero is "special" (NULL).
> 
> Fixes: e05da09b7c ("target/riscv: implement Zicbom extension")
> Reported-by: Zhiwei Jiang (姜智伟) <jiangzw@tecorigin.com>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>   target/riscv/insn_trans/trans_rvzicbo.c.inc | 8 ++++----
>   1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/target/riscv/insn_trans/trans_rvzicbo.c.inc b/target/riscv/insn_trans/trans_rvzicbo.c.inc
> index d5d7095903..6f6b29598d 100644
> --- a/target/riscv/insn_trans/trans_rvzicbo.c.inc
> +++ b/target/riscv/insn_trans/trans_rvzicbo.c.inc
> @@ -31,27 +31,27 @@
>   static bool trans_cbo_clean(DisasContext *ctx, arg_cbo_clean *a)
>   {
>       REQUIRE_ZICBOM(ctx);
> -    gen_helper_cbo_clean_flush(tcg_env, cpu_gpr[a->rs1]);
> +    gen_helper_cbo_clean_flush(tcg_env, get_address(ctx, a->rs1, 0));
>       return true;
>   }
>   
>   static bool trans_cbo_flush(DisasContext *ctx, arg_cbo_flush *a)
>   {
>       REQUIRE_ZICBOM(ctx);
> -    gen_helper_cbo_clean_flush(tcg_env, cpu_gpr[a->rs1]);
> +    gen_helper_cbo_clean_flush(tcg_env, get_address(ctx, a->rs1, 0));
>       return true;
>   }
>   
>   static bool trans_cbo_inval(DisasContext *ctx, arg_cbo_inval *a)
>   {
>       REQUIRE_ZICBOM(ctx);
> -    gen_helper_cbo_inval(tcg_env, cpu_gpr[a->rs1]);
> +    gen_helper_cbo_inval(tcg_env, get_address(ctx, a->rs1, 0));
>       return true;
>   }
>   
>   static bool trans_cbo_zero(DisasContext *ctx, arg_cbo_zero *a)
>   {
>       REQUIRE_ZICBOZ(ctx);
> -    gen_helper_cbo_zero(tcg_env, cpu_gpr[a->rs1]);
> +    gen_helper_cbo_zero(tcg_env, get_address(ctx, a->rs1, 0));
>       return true;
>   }



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] target/riscv: Use get_address() to get address with Zicbom extensions
  2024-05-29  4:56 ` Philippe Mathieu-Daudé
@ 2024-06-04  0:20   ` Alistair Francis
  2024-06-04  8:08     ` Philippe Mathieu-Daudé
  0 siblings, 1 reply; 9+ messages in thread
From: Alistair Francis @ 2024-06-04  0:20 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, qemu-riscv, Palmer Dabbelt, Bin Meng,
	Alistair Francis, Christoph Muellner, Philipp Tomsich, Liu Zhiwei,
	Weiwei Li, Palmer Dabbelt, Daniel Henrique Barboza, Zhiwei Jiang

On Wed, May 29, 2024 at 2:56 PM Philippe Mathieu-Daudé
<philmd@linaro.org> wrote:
>
> ping?

I originally missed this patch somehow and it has then been fixed
separately as part of
https://patchew.org/QEMU/20240514023910.301766-1-alistair.francis@wdc.com/

Alistair

>
> On 19/4/24 13:05, Philippe Mathieu-Daudé wrote:
> > We need to use get_address() to get an address from cpu_gpr[],
> > since $zero is "special" (NULL).
> >
> > Fixes: e05da09b7c ("target/riscv: implement Zicbom extension")
> > Reported-by: Zhiwei Jiang (姜智伟) <jiangzw@tecorigin.com>
> > Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> > ---
> >   target/riscv/insn_trans/trans_rvzicbo.c.inc | 8 ++++----
> >   1 file changed, 4 insertions(+), 4 deletions(-)
> >
> > diff --git a/target/riscv/insn_trans/trans_rvzicbo.c.inc b/target/riscv/insn_trans/trans_rvzicbo.c.inc
> > index d5d7095903..6f6b29598d 100644
> > --- a/target/riscv/insn_trans/trans_rvzicbo.c.inc
> > +++ b/target/riscv/insn_trans/trans_rvzicbo.c.inc
> > @@ -31,27 +31,27 @@
> >   static bool trans_cbo_clean(DisasContext *ctx, arg_cbo_clean *a)
> >   {
> >       REQUIRE_ZICBOM(ctx);
> > -    gen_helper_cbo_clean_flush(tcg_env, cpu_gpr[a->rs1]);
> > +    gen_helper_cbo_clean_flush(tcg_env, get_address(ctx, a->rs1, 0));
> >       return true;
> >   }
> >
> >   static bool trans_cbo_flush(DisasContext *ctx, arg_cbo_flush *a)
> >   {
> >       REQUIRE_ZICBOM(ctx);
> > -    gen_helper_cbo_clean_flush(tcg_env, cpu_gpr[a->rs1]);
> > +    gen_helper_cbo_clean_flush(tcg_env, get_address(ctx, a->rs1, 0));
> >       return true;
> >   }
> >
> >   static bool trans_cbo_inval(DisasContext *ctx, arg_cbo_inval *a)
> >   {
> >       REQUIRE_ZICBOM(ctx);
> > -    gen_helper_cbo_inval(tcg_env, cpu_gpr[a->rs1]);
> > +    gen_helper_cbo_inval(tcg_env, get_address(ctx, a->rs1, 0));
> >       return true;
> >   }
> >
> >   static bool trans_cbo_zero(DisasContext *ctx, arg_cbo_zero *a)
> >   {
> >       REQUIRE_ZICBOZ(ctx);
> > -    gen_helper_cbo_zero(tcg_env, cpu_gpr[a->rs1]);
> > +    gen_helper_cbo_zero(tcg_env, get_address(ctx, a->rs1, 0));
> >       return true;
> >   }
>
>


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] target/riscv: Use get_address() to get address with Zicbom extensions
  2024-06-04  0:20   ` Alistair Francis
@ 2024-06-04  8:08     ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 9+ messages in thread
From: Philippe Mathieu-Daudé @ 2024-06-04  8:08 UTC (permalink / raw)
  To: Alistair Francis
  Cc: qemu-devel, qemu-riscv, Palmer Dabbelt, Bin Meng,
	Alistair Francis, Christoph Muellner, Philipp Tomsich, Liu Zhiwei,
	Weiwei Li, Palmer Dabbelt, Daniel Henrique Barboza, Zhiwei Jiang

On 4/6/24 02:20, Alistair Francis wrote:
> On Wed, May 29, 2024 at 2:56 PM Philippe Mathieu-Daudé
> <philmd@linaro.org> wrote:
>>
>> ping?
> 
> I originally missed this patch somehow and it has then been fixed
> separately as part of
> https://patchew.org/QEMU/20240514023910.301766-1-alistair.francis@wdc.com/

I see (I also missed your one myself). Maybe add the Fixes/Reported-by 
tags in yours?

> 
> Alistair
> 
>>
>> On 19/4/24 13:05, Philippe Mathieu-Daudé wrote:
>>> We need to use get_address() to get an address from cpu_gpr[],
>>> since $zero is "special" (NULL).
>>>
>>> Fixes: e05da09b7c ("target/riscv: implement Zicbom extension")
>>> Reported-by: Zhiwei Jiang (姜智伟) <jiangzw@tecorigin.com>
>>> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>>> ---
>>>    target/riscv/insn_trans/trans_rvzicbo.c.inc | 8 ++++----
>>>    1 file changed, 4 insertions(+), 4 deletions(-)



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] target/riscv: Use get_address() to get address with Zicbom extensions
  2024-04-19 11:37 ` Philippe Mathieu-Daudé
@ 2024-08-11 17:48   ` Michael Tokarev
  2024-08-12  0:35     ` Alistair Francis
  0 siblings, 1 reply; 9+ messages in thread
From: Michael Tokarev @ 2024-08-11 17:48 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel, qemu-stable
  Cc: qemu-riscv, Palmer Dabbelt, Bin Meng, Alistair Francis,
	Christoph Muellner, Philipp Tomsich, Liu Zhiwei, Weiwei Li,
	Palmer Dabbelt, Daniel Henrique Barboza, Zhiwei Jiang

19.04.2024 14:37, Philippe Mathieu-Daudé wrpte:
> On 19/4/24 13:05, Philippe Mathieu-Daudé wrote:
>> We need to use get_address() to get an address from cpu_gpr[],
>> since $zero is "special" (NULL).

Hi!

Has this change been forgotten, or is it not needed anymore?
It's been quite some time since Apr-19..

Thanks,

/mjt

> 
> Cc: qemu-stable@nongnu.org
> 
>> Fixes: e05da09b7c ("target/riscv: implement Zicbom extension")
>> Reported-by: Zhiwei Jiang (姜智伟) <jiangzw@tecorigin.com>
>> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>> ---
>>   target/riscv/insn_trans/trans_rvzicbo.c.inc | 8 ++++----
>>   1 file changed, 4 insertions(+), 4 deletions(-)
> 
> 

-- 
GPG Key transition (from rsa2048 to rsa4096) since 2024-04-24.
New key: rsa4096/61AD3D98ECDF2C8E  9D8B E14E 3F2A 9DD7 9199  28F1 61AD 3D98 ECDF 2C8E
Old key: rsa2048/457CE0A0804465C5  6EE1 95D1 886E 8FFB 810D  4324 457C E0A0 8044 65C5
Transition statement: http://www.corpit.ru/mjt/gpg-transition-2024.txt



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] target/riscv: Use get_address() to get address with Zicbom extensions
  2024-08-11 17:48   ` Michael Tokarev
@ 2024-08-12  0:35     ` Alistair Francis
  0 siblings, 0 replies; 9+ messages in thread
From: Alistair Francis @ 2024-08-12  0:35 UTC (permalink / raw)
  To: Michael Tokarev
  Cc: Philippe Mathieu-Daudé, qemu-devel, qemu-stable, qemu-riscv,
	Palmer Dabbelt, Bin Meng, Alistair Francis, Christoph Muellner,
	Philipp Tomsich, Liu Zhiwei, Weiwei Li, Palmer Dabbelt,
	Daniel Henrique Barboza, Zhiwei Jiang

On Mon, Aug 12, 2024 at 3:49 AM Michael Tokarev <mjt@tls.msk.ru> wrote:
>
> 19.04.2024 14:37, Philippe Mathieu-Daudé wrpte:
> > On 19/4/24 13:05, Philippe Mathieu-Daudé wrote:
> >> We need to use get_address() to get an address from cpu_gpr[],
> >> since $zero is "special" (NULL).
>
> Hi!
>
> Has this change been forgotten, or is it not needed anymore?
> It's been quite some time since Apr-19..

It's not needed anymore,
https://patchew.org/QEMU/20240514023910.301766-1-alistair.francis@wdc.com/
was merged instead

Alistair


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2024-08-12  0:36 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-19 11:05 [PATCH] target/riscv: Use get_address() to get address with Zicbom extensions Philippe Mathieu-Daudé
2024-04-19 11:37 ` Philippe Mathieu-Daudé
2024-08-11 17:48   ` Michael Tokarev
2024-08-12  0:35     ` Alistair Francis
2024-04-20 16:02 ` Richard Henderson
2024-04-21 16:59 ` Daniel Henrique Barboza
2024-05-29  4:56 ` Philippe Mathieu-Daudé
2024-06-04  0:20   ` Alistair Francis
2024-06-04  8:08     ` Philippe Mathieu-Daudé

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).