[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 4/6] target/hppa: exit tb on flush cache instructions
From: |
Sven Schnelle |
Subject: |
[PATCH v2 4/6] target/hppa: exit tb on flush cache instructions |
Date: |
Tue, 19 Mar 2024 17:19:19 +0100 |
When the guest modifies the tb it is currently executing from,
it executes a fic instruction. Exit the tb on such instruction,
otherwise we might execute stale code.
Signed-off-by: Sven Schnelle <svens@stackframe.org>
---
target/hppa/insns.decode | 6 +++---
target/hppa/translate.c | 11 +++++++++++
2 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/target/hppa/insns.decode b/target/hppa/insns.decode
index f5a3f02fd1..409e3ea9c9 100644
--- a/target/hppa/insns.decode
+++ b/target/hppa/insns.decode
@@ -143,9 +143,9 @@ getshadowregs 1111 1111 1111 1101 1110 1010 1101 0010
nop 000001 ----- ----- -- 11001010 0 ----- # fdc, disp
nop_addrx 000001 ..... ..... -- 01001010 . ----- @addrx # fdc, index
nop_addrx 000001 ..... ..... -- 01001011 . ----- @addrx # fdce
-nop_addrx 000001 ..... ..... --- 0001010 . ----- @addrx # fic 0x0a
-nop_addrx 000001 ..... ..... -- 01001111 . 00000 @addrx # fic 0x4f
-nop_addrx 000001 ..... ..... --- 0001011 . ----- @addrx # fice
+fic 000001 ..... ..... --- 0001010 . ----- @addrx # fic 0x0a
+fic 000001 ..... ..... -- 01001111 . 00000 @addrx # fic 0x4f
+fic 000001 ..... ..... --- 0001011 . ----- @addrx # fice
nop_addrx 000001 ..... ..... -- 01001110 . 00000 @addrx # pdc
probe 000001 b:5 ri:5 sp:2 imm:1 100011 write:1 0 t:5
diff --git a/target/hppa/translate.c b/target/hppa/translate.c
index 8ba31567e8..46da546eb9 100644
--- a/target/hppa/translate.c
+++ b/target/hppa/translate.c
@@ -2293,6 +2293,17 @@ static bool trans_nop_addrx(DisasContext *ctx, arg_ldst
*a)
return true;
}
+static bool trans_fic(DisasContext *ctx, arg_fic *a)
+{
+ arg_ldst b;
+
+ b.b = a->b;
+ b.x = a->x;
+ b.m = a->m;
+ ctx->base.is_jmp = DISAS_IAQ_N_STALE;
+ return trans_nop_addrx(ctx, &b);
+}
+
static bool trans_probe(DisasContext *ctx, arg_probe *a)
{
TCGv_i64 dest, ofs;
--
2.43.2
- [PATCH v2 0/6] few fixes for hppa target, Sven Schnelle, 2024/03/19
- [PATCH v2 1/6] target/hppa: ldcw,s uses static shift of 3, Sven Schnelle, 2024/03/19
- [PATCH v2 2/6] target/hppa: fix shrp for wide mode, Sven Schnelle, 2024/03/19
- [PATCH v2 6/6] target/hppa: fix do_stdby_e(), Sven Schnelle, 2024/03/19
- [PATCH v2 5/6] target/hppa: mask privilege bits in mfia, Sven Schnelle, 2024/03/19
- [PATCH v2 4/6] target/hppa: exit tb on flush cache instructions,
Sven Schnelle <=
- [PATCH v2 3/6] target/hppa: fix access_id check, Sven Schnelle, 2024/03/19