[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v1 1/1] target/microblaze: mbar: Trap sleeps from user-space
From: |
Edgar E. Iglesias |
Subject: |
[PATCH v1 1/1] target/microblaze: mbar: Trap sleeps from user-space |
Date: |
Mon, 17 Aug 2020 19:30:45 +0200 |
From: "Edgar E. Iglesias" <edgar.iglesias@xilinx.com>
Trap mbar-sleeps from user-space.
Reported-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
---
target/microblaze/translate.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/target/microblaze/translate.c b/target/microblaze/translate.c
index 530c15e5ad..a96cb21d96 100644
--- a/target/microblaze/translate.c
+++ b/target/microblaze/translate.c
@@ -1250,6 +1250,11 @@ static void dec_br(DisasContext *dc)
LOG_DIS("sleep\n");
+ if (trap_userspace(dc, true)) {
+ /* Sleep is a privileged instruction. */
+ return;
+ }
+
t_sync_flags(dc);
tcg_gen_st_i32(tmp_1, cpu_env,
-offsetof(MicroBlazeCPU, env)
--
2.25.1