mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 00:33:55 -06:00
target/riscv: enable 'vstart_eq_zero' in the end of insns
The vstart_eq_zero flag is updated at the beginning of the translation phase from the env->vstart variable. During the execution phase all functions will set env->vstart = 0 after a successful execution, but the vstart_eq_zero flag remains the same as at the start of the block. This will wrongly cause SIGILLs in translations that requires env->vstart = 0 and might be reading vstart_eq_zero = false. This patch adds a new finalize_rvv_inst() helper that is called at the end of each vector instruction that will both update vstart_eq_zero and do a mark_vs_dirty(). Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1976 Signed-off-by: Ivan Klokov <ivan.klokov@syntacore.com> Signed-off-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Message-ID: <20240314175704.478276-10-dbarboza@ventanamicro.com> Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
This commit is contained in:
parent
d57dfe4b37
commit
bac802ada8
4 changed files with 59 additions and 48 deletions
|
@ -174,7 +174,7 @@ GEN_OPIVX_GVEC_TRANS_CHECK(vandn_vx, andcs, zvkb_vx_check)
|
|||
vreg_ofs(s, a->rs2), tcg_env, \
|
||||
s->cfg_ptr->vlenb, s->cfg_ptr->vlenb, \
|
||||
data, fns[s->sew]); \
|
||||
mark_vs_dirty(s); \
|
||||
finalize_rvv_inst(s); \
|
||||
return true; \
|
||||
} \
|
||||
return false; \
|
||||
|
@ -266,7 +266,7 @@ GEN_OPIVI_WIDEN_TRANS(vwsll_vi, IMM_ZX, vwsll_vx, vwsll_vx_check)
|
|||
tcg_gen_addi_ptr(rd_v, tcg_env, vreg_ofs(s, a->rd)); \
|
||||
tcg_gen_addi_ptr(rs2_v, tcg_env, vreg_ofs(s, a->rs2)); \
|
||||
gen_helper_##NAME(rd_v, rs2_v, tcg_env, desc); \
|
||||
mark_vs_dirty(s); \
|
||||
finalize_rvv_inst(s); \
|
||||
return true; \
|
||||
} \
|
||||
return false; \
|
||||
|
@ -341,7 +341,7 @@ GEN_V_UNMASKED_TRANS(vaesem_vs, vaes_check_vs, ZVKNED_EGS)
|
|||
tcg_gen_addi_ptr(rd_v, tcg_env, vreg_ofs(s, a->rd)); \
|
||||
tcg_gen_addi_ptr(rs2_v, tcg_env, vreg_ofs(s, a->rs2)); \
|
||||
gen_helper_##NAME(rd_v, rs2_v, uimm_v, tcg_env, desc); \
|
||||
mark_vs_dirty(s); \
|
||||
finalize_rvv_inst(s); \
|
||||
return true; \
|
||||
} \
|
||||
return false; \
|
||||
|
@ -405,7 +405,7 @@ GEN_VI_UNMASKED_TRANS(vaeskf2_vi, vaeskf2_check, ZVKNED_EGS)
|
|||
s->cfg_ptr->vlenb, s->cfg_ptr->vlenb, \
|
||||
data, gen_helper_##NAME); \
|
||||
\
|
||||
mark_vs_dirty(s); \
|
||||
finalize_rvv_inst(s); \
|
||||
return true; \
|
||||
} \
|
||||
return false; \
|
||||
|
@ -457,7 +457,7 @@ static bool trans_vsha2cl_vv(DisasContext *s, arg_rmrr *a)
|
|||
s->sew == MO_32 ?
|
||||
gen_helper_vsha2cl32_vv : gen_helper_vsha2cl64_vv);
|
||||
|
||||
mark_vs_dirty(s);
|
||||
finalize_rvv_inst(s);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
@ -488,7 +488,7 @@ static bool trans_vsha2ch_vv(DisasContext *s, arg_rmrr *a)
|
|||
s->sew == MO_32 ?
|
||||
gen_helper_vsha2ch32_vv : gen_helper_vsha2ch64_vv);
|
||||
|
||||
mark_vs_dirty(s);
|
||||
finalize_rvv_inst(s);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue