Skip to contentSkip to conversation

target/riscv: Use get_address() to get address with Zicbom extensions

PATCH In review Philippe Mathieu-Daudé 5 participants 9 messages Apr 19, 2024 – Aug 12, 2024 RISC-V

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 target/riscv: Use get_address() to get address with Zicbom extensions

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")
---
 target/riscv/insn_trans/trans_rvzicbo.c.inc | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
target/riscv/insn_trans/trans_rvzicbo.c.inc +4 -4
index d5d7095903..6f6b29598d 100644
@@ -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;
 }
Signature · 1 line
2.41.0
#1 lore raw
Quoted 3 lines · Philippe Mathieu-Daudé

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

Quoted 6 lines
Fixes e05da09b7c ("target/riscv: implement Zicbom extension")
---
  target/riscv/insn_trans/trans_rvzicbo.c.inc | 8 ++++----
  1 file changed, 4 insertions(+), 4 deletions(-)
#2 lore raw

19.04.2024 14:37, Philippe Mathieu-Daudé wrpte:

Quoted 3 lines · Philippe Mathieu-Daudé
Quoted 2 lines

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

Quoted 11 lines
Quoted 6 lines
Fixes e05da09b7c ("target/riscv: implement Zicbom extension")

---
  target/riscv/insn_trans/trans_rvzicbo.c.inc | 8 ++++----

  1 file changed, 4 insertions(+), 4 deletions(-)
Signature · 4 lines
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
#3 lore raw
Quoted 10 lines · Michael Tokarev

19.04.2024 14:37, Philippe Mathieu-Daudé wrpte:

Quoted 3 lines · Philippe Mathieu-Daudé
Quoted 2 lines

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/[email protected]/
was merged instead

Alistair

Reviewed-by on v1 1/1
#4 lore raw
In reply to Philippe Mathieu-Daudé
Quoted 9 lines · Philippe Mathieu-Daudé

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")
---
  target/riscv/insn_trans/trans_rvzicbo.c.inc | 8 ++++----
  1 file changed, 4 insertions(+), 4 deletions(-)

r~

Reviewed-by on v1 1/1
#5 lore raw
In reply to Philippe Mathieu-Daudé
Quoted 7 lines · Philippe Mathieu-Daudé

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")

---

Quoted 39 lines
  target/riscv/insn_trans/trans_rvzicbo.c.inc | 8 ++++----
  1 file changed, 4 insertions(+), 4 deletions(-)
target/riscv/insn_trans/trans_rvzicbo.c.inc +4 -4
index d5d7095903..6f6b29598d 100644
@@ -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;
  }
#6 lore raw
In reply to Philippe Mathieu-Daudé

ping?

Quoted 46 lines · Philippe Mathieu-Daudé

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")
---
  target/riscv/insn_trans/trans_rvzicbo.c.inc | 8 ++++----
  1 file changed, 4 insertions(+), 4 deletions(-)
target/riscv/insn_trans/trans_rvzicbo.c.inc +4 -4
index d5d7095903..6f6b29598d 100644
@@ -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;
  }
#7 lore raw
Quoted 2 lines · Philippe Mathieu-Daudé

ping?

I originally missed this patch somehow and it has then been fixed separately as part of
https://patchew.org/QEMU/[email protected]/

Alistair

Quoted 50 lines · Philippe Mathieu-Daudé
Quoted 46 lines

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")
---
  target/riscv/insn_trans/trans_rvzicbo.c.inc | 8 ++++----
  1 file changed, 4 insertions(+), 4 deletions(-)
target/riscv/insn_trans/trans_rvzicbo.c.inc +4 -4
index d5d7095903..6f6b29598d 100644
@@ -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;
  }
#8 lore raw
Quoted 8 lines · Alistair Francis
Quoted 2 lines · Philippe Mathieu-Daudé

ping?

I originally missed this patch somehow and it has then been fixed separately as part of
https://patchew.org/QEMU/[email protected]/

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

Quoted 14 lines

Alistair

Quoted 11 lines · Philippe Mathieu-Daudé
Quoted 9 lines

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")
---
   target/riscv/insn_trans/trans_rvzicbo.c.inc | 8 ++++----
   1 file changed, 4 insertions(+), 4 deletions(-)