[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 2/2] target/riscv: Call check_access() before tcg_temp_new()
From: |
Alex Richardson |
Subject: |
[PATCH 2/2] target/riscv: Call check_access() before tcg_temp_new() |
Date: |
Fri, 19 Feb 2021 15:50:52 +0000 |
---
target/riscv/insn_trans/trans_rvh.c.inc | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/target/riscv/insn_trans/trans_rvh.c.inc
b/target/riscv/insn_trans/trans_rvh.c.inc
index 203a620723..b0a9ea1dca 100644
--- a/target/riscv/insn_trans/trans_rvh.c.inc
+++ b/target/riscv/insn_trans/trans_rvh.c.inc
@@ -32,11 +32,11 @@ static bool gen_hlv(DisasContext *ctx, arg_hlv_b *a, MemOp
memop)
{
REQUIRE_EXT(ctx, RVH);
#ifndef CONFIG_USER_ONLY
+ check_access(ctx);
+
TCGv t0 = tcg_temp_new();
TCGv t1 = tcg_temp_new();
- check_access(ctx);
-
gen_get_gpr(t0, a->rs1);
tcg_gen_qemu_ld_tl(t1, t0, ctx->mem_idx | TB_FLAGS_PRIV_HYP_ACCESS_MASK,
memop);
@@ -55,10 +55,11 @@ static bool gen_hsv(DisasContext *ctx, arg_hsv_b *a, MemOp
memop)
{
REQUIRE_EXT(ctx, RVH);
#ifndef CONFIG_USER_ONLY
+ check_access(ctx);
+
TCGv t0 = tcg_temp_new();
TCGv dat = tcg_temp_new();
- check_access(ctx);
gen_get_gpr(t0, a->rs1);
gen_get_gpr(dat, a->rs2);
@@ -134,10 +135,11 @@ static bool trans_hlvx_hu(DisasContext *ctx, arg_hlvx_hu
*a)
{
REQUIRE_EXT(ctx, RVH);
#ifndef CONFIG_USER_ONLY
+ check_access(ctx);
+
TCGv t0 = tcg_temp_new();
TCGv t1 = tcg_temp_new();
- check_access(ctx);
gen_get_gpr(t0, a->rs1);
@@ -156,10 +158,11 @@ static bool trans_hlvx_wu(DisasContext *ctx, arg_hlvx_wu
*a)
{
REQUIRE_EXT(ctx, RVH);
#ifndef CONFIG_USER_ONLY
+ check_access(ctx);
+
TCGv t0 = tcg_temp_new();
TCGv t1 = tcg_temp_new();
- check_access(ctx);
gen_get_gpr(t0, a->rs1);
--
2.30.0