mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-02-25 18:46:47 +00:00
target/arm: Check access permission to ADDVL/ADDPL/RDVL
These instructions do not trap when SVE is disabled in EL0, causing them to be executed with wrong size information. Backports commit 5de56742a3c91de3d646326bec43a989bba83ca4 from qemu
This commit is contained in:
parent
4dc3d59fd3
commit
2392d8b8ab
|
@ -999,27 +999,33 @@ static bool trans_INDEX_rr(DisasContext *s, arg_INDEX_rr *a)
|
||||||
|
|
||||||
static bool trans_ADDVL(DisasContext *s, arg_ADDVL *a)
|
static bool trans_ADDVL(DisasContext *s, arg_ADDVL *a)
|
||||||
{
|
{
|
||||||
TCGContext *tcg_ctx = s->uc->tcg_ctx;
|
if (sve_access_check(s)) {
|
||||||
TCGv_i64 rd = cpu_reg_sp(s, a->rd);
|
TCGContext *tcg_ctx = s->uc->tcg_ctx;
|
||||||
TCGv_i64 rn = cpu_reg_sp(s, a->rn);
|
TCGv_i64 rd = cpu_reg_sp(s, a->rd);
|
||||||
tcg_gen_addi_i64(tcg_ctx, rd, rn, a->imm * vec_full_reg_size(s));
|
TCGv_i64 rn = cpu_reg_sp(s, a->rn);
|
||||||
|
tcg_gen_addi_i64(tcg_ctx, rd, rn, a->imm * vec_full_reg_size(s));
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool trans_ADDPL(DisasContext *s, arg_ADDPL *a)
|
static bool trans_ADDPL(DisasContext *s, arg_ADDPL *a)
|
||||||
{
|
{
|
||||||
TCGContext *tcg_ctx = s->uc->tcg_ctx;
|
if (sve_access_check(s)) {
|
||||||
TCGv_i64 rd = cpu_reg_sp(s, a->rd);
|
TCGContext *tcg_ctx = s->uc->tcg_ctx;
|
||||||
TCGv_i64 rn = cpu_reg_sp(s, a->rn);
|
TCGv_i64 rd = cpu_reg_sp(s, a->rd);
|
||||||
tcg_gen_addi_i64(tcg_ctx, rd, rn, a->imm * pred_full_reg_size(s));
|
TCGv_i64 rn = cpu_reg_sp(s, a->rn);
|
||||||
|
tcg_gen_addi_i64(tcg_ctx, rd, rn, a->imm * pred_full_reg_size(s));
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool trans_RDVL(DisasContext *s, arg_RDVL *a)
|
static bool trans_RDVL(DisasContext *s, arg_RDVL *a)
|
||||||
{
|
{
|
||||||
TCGContext *tcg_ctx = s->uc->tcg_ctx;
|
if (sve_access_check(s)) {
|
||||||
TCGv_i64 reg = cpu_reg(s, a->rd);
|
TCGContext *tcg_ctx = s->uc->tcg_ctx;
|
||||||
tcg_gen_movi_i64(tcg_ctx, reg, a->imm * vec_full_reg_size(s));
|
TCGv_i64 reg = cpu_reg(s, a->rd);
|
||||||
|
tcg_gen_movi_i64(tcg_ctx, reg, a->imm * vec_full_reg_size(s));
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue