[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 4/4] target/m68k: always call gen_exit_tb() after writes to SR
From: |
Mark Cave-Ayland |
Subject: |
[PATCH 4/4] target/m68k: always call gen_exit_tb() after writes to SR |
Date: |
Sat, 17 Sep 2022 12:25:15 +0100 |
Any write to SR can change the security state so always call gen_exit_tb() when
this occurs. In particular MacOS makes use of andiw/oriw in a few places to
handle the switch between user and supervisor mode.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
---
target/m68k/translate.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/target/m68k/translate.c b/target/m68k/translate.c
index be5561e1e9..892473d01f 100644
--- a/target/m68k/translate.c
+++ b/target/m68k/translate.c
@@ -2373,6 +2373,7 @@ DISAS_INSN(arith_im)
tcg_gen_or_i32(dest, src1, im);
if (with_SR) {
gen_set_sr(s, dest, opsize == OS_BYTE);
+ gen_exit_tb(s);
} else {
DEST_EA(env, insn, opsize, dest, &addr);
gen_logic_cc(s, dest, opsize);
@@ -2382,6 +2383,7 @@ DISAS_INSN(arith_im)
tcg_gen_and_i32(dest, src1, im);
if (with_SR) {
gen_set_sr(s, dest, opsize == OS_BYTE);
+ gen_exit_tb(s);
} else {
DEST_EA(env, insn, opsize, dest, &addr);
gen_logic_cc(s, dest, opsize);
@@ -2405,6 +2407,7 @@ DISAS_INSN(arith_im)
tcg_gen_xor_i32(dest, src1, im);
if (with_SR) {
gen_set_sr(s, dest, opsize == OS_BYTE);
+ gen_exit_tb(s);
} else {
DEST_EA(env, insn, opsize, dest, &addr);
gen_logic_cc(s, dest, opsize);
@@ -4592,6 +4595,7 @@ DISAS_INSN(strldsr)
}
gen_push(s, gen_get_sr(s));
gen_set_sr_im(s, ext, 0);
+ gen_exit_tb(s);
}
DISAS_INSN(move_from_sr)
--
2.30.2
- [PATCH 2/4] target/m68k: increase size of m68k CPU features from uint32_t to uint64_t, (continued)
- [PATCH 2/4] target/m68k: increase size of m68k CPU features from uint32_t to uint64_t, Mark Cave-Ayland, 2022/09/17
- Re: [PATCH 2/4] target/m68k: increase size of m68k CPU features from uint32_t to uint64_t, BALATON Zoltan, 2022/09/17
- Re: [PATCH 2/4] target/m68k: increase size of m68k CPU features from uint32_t to uint64_t, Philippe Mathieu-Daudé, 2022/09/17
- Re: [PATCH 2/4] target/m68k: increase size of m68k CPU features from uint32_t to uint64_t, Mark Cave-Ayland, 2022/09/20
- Re: [PATCH 2/4] target/m68k: increase size of m68k CPU features from uint32_t to uint64_t, Philippe Mathieu-Daudé, 2022/09/20
- Re: [PATCH 2/4] target/m68k: increase size of m68k CPU features from uint32_t to uint64_t, BALATON Zoltan, 2022/09/20
- Re: [PATCH 2/4] target/m68k: increase size of m68k CPU features from uint32_t to uint64_t, Laurent Vivier, 2022/09/21
- Re: [PATCH 2/4] target/m68k: increase size of m68k CPU features from uint32_t to uint64_t, Mark Cave-Ayland, 2022/09/20
[PATCH 3/4] target/m68k: use M68K_FEATURE_MOVEFROMSR_PRIV feature for move_from_sr privilege check, Mark Cave-Ayland, 2022/09/17
[PATCH 4/4] target/m68k: always call gen_exit_tb() after writes to SR,
Mark Cave-Ayland <=
Re: [PATCH 4/4] target/m68k: always call gen_exit_tb() after writes to SR, Richard Henderson, 2022/09/19
Re: [PATCH 4/4] target/m68k: always call gen_exit_tb() after writes to SR, Laurent Vivier, 2022/09/21