|
@@ -0,0 +1,53 @@
|
|
|
+From 71ddb2f0d01d62eeef3578126656470742dd4160 Mon Sep 17 00:00:00 2001
|
|
|
+From: "yilun.xie" <yilun.xie@starfivetech.com>
|
|
|
+Date: Tue, 22 Mar 2022 02:26:39 -0700
|
|
|
+Subject: [PATCH 3/3] Fix cache instruction bug
|
|
|
+
|
|
|
+---
|
|
|
+ target/riscv/insn_trans/trans_rvi.c.inc | 18 +++++++++++-------
|
|
|
+ 1 file changed, 11 insertions(+), 7 deletions(-)
|
|
|
+
|
|
|
+diff --git a/target/riscv/insn_trans/trans_rvi.c.inc b/target/riscv/insn_trans/trans_rvi.c.inc
|
|
|
+index bdabeaf376..1784bbbfb8 100644
|
|
|
+--- a/target/riscv/insn_trans/trans_rvi.c.inc
|
|
|
++++ b/target/riscv/insn_trans/trans_rvi.c.inc
|
|
|
+@@ -532,24 +532,28 @@ static bool trans_csrrci(DisasContext *ctx, arg_csrrci *a)
|
|
|
+
|
|
|
+ static bool trans_cflush_d_l1(DisasContext *ctx, arg_cflush_d_l1 *a)
|
|
|
+ {
|
|
|
+- gen_helper_cflush_d_l1(cpu_gpr[a->rs1]);
|
|
|
++ if(a->rs1 != 0)
|
|
|
++ gen_helper_cflush_d_l1(cpu_gpr[a->rs1]);
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+-static bool trans_cdiscard_d_l1(DisasContext *ctx, arg_cflush_d_l1 *a)
|
|
|
++static bool trans_cdiscard_d_l1(DisasContext *ctx, arg_cdiscard_d_l1 *a)
|
|
|
+ {
|
|
|
+- gen_helper_cdiscard_d_l1(cpu_gpr[a->rs1]);
|
|
|
++ if(a->rs1 != 0)
|
|
|
++ gen_helper_cdiscard_d_l1(cpu_gpr[a->rs1]);
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+-static bool trans_cflush_d_l2(DisasContext *ctx, arg_cflush_d_l1 *a)
|
|
|
++static bool trans_cflush_d_l2(DisasContext *ctx, arg_cflush_d_l2 *a)
|
|
|
+ {
|
|
|
+- gen_helper_cflush_d_l2(cpu_gpr[a->rs1]);
|
|
|
++ if(a->rs1 != 0)
|
|
|
++ gen_helper_cflush_d_l2(cpu_gpr[a->rs1]);
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+-static bool trans_cdiscard_d_l2(DisasContext *ctx, arg_cflush_d_l1 *a)
|
|
|
++static bool trans_cdiscard_d_l2(DisasContext *ctx, arg_cdiscard_d_l2 *a)
|
|
|
+ {
|
|
|
+- gen_helper_cdiscard_d_l2(cpu_gpr[a->rs1]);
|
|
|
++ if(a->rs1 != 0)
|
|
|
++ gen_helper_cdiscard_d_l2(cpu_gpr[a->rs1]);
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+\ No newline at end of file
|
|
|
+--
|
|
|
+2.33.1
|
|
|
+
|